Skip to content

Commit

Permalink
chore: fix the url of problem & add new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzcdev committed Feb 2, 2023
1 parent f3142b7 commit 9f07f67
Show file tree
Hide file tree
Showing 732 changed files with 1,581 additions and 1,495 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/696
// https://pintia.cn/problem-sets/16/exam/problems/696
Deque CreateDeque(){
PtrToNode header = (PtrToNode)malloc(sizeof(struct Node));
header -> Next = header -> Last = NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/706
// https://pintia.cn/problem-sets/16/exam/problems/706
void ShortestDist(LGraph Graph, int dist[], Vertex S) {
int INF = 0x7FFFFFFF;
for (int i = 0; i < Graph->Nv; i++) dist[i] = INF;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/707
// https://pintia.cn/problem-sets/16/exam/problems/707
void ShortestDist(MGraph Graph, int dist[], Vertex S) {
for (int i = 0; i < Graph->Nv; i++) dist[i] = INFINITY;
dist[S] = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/708
// https://pintia.cn/problem-sets/16/exam/problems/708
bool TopSort(LGraph Graph, Vertex TopOrder[]) {
int front = 0, tail = 0, cnt = 0, indegree[MaxVertexNum] = {0};
for (int i = 0; i < Graph->Nv; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/962
// https://pintia.cn/problem-sets/16/exam/problems/962
bool vis[MaxVertexNum] = {false};
void dfs(LGraph Graph, int u) {
vis[u] = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/1046
// https://pintia.cn/problem-sets/16/exam/problems/1046
void swap(int *x, int *y) {
int t = *x;
*x = *y;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/1085
// https://pintia.cn/problem-sets/16/exam/problems/1085
int known[MaxVertexNum];

void ShortestDist(MGraph Graph, int dist[], int count[], Vertex S) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/1086
// https://pintia.cn/problem-sets/16/exam/problems/1086
void ShortestDist(MGraph Graph, int dist[], int path[], Vertex S) {
for (int i = 0; i < Graph->Nv; i++) dist[i] = INFINITY;
dist[S] = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/697
// https://pintia.cn/problem-sets/16/exam/problems/697
Stack CreateStack( int MaxElements )
{
Stack stack =(Stack)malloc(sizeof(struct StackRecord));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/698
// https://pintia.cn/problem-sets/16/exam/problems/698
Polynomial Add(Polynomial a, Polynomial b) {
Polynomial P = (Polynomial)malloc(sizeof(struct Node)), s = P;
P->Next = NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/699
// https://pintia.cn/problem-sets/16/exam/problems/699
List Reverse( List L ){
if(L -> Next == NULL) return L;
Position t,p = L -> Next -> Next,k = L -> Next;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/700
// https://pintia.cn/problem-sets/16/exam/problems/700
typedef struct StackRecord *Stack;
struct StackRecord {
double Array[Max_Expr];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/701
// https://pintia.cn/problem-sets/16/exam/problems/701
void Level_order(Tree T, void (*visit)(Tree ThisNode)) {
if (T == NULL) return;
Tree q[1000];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/702
// https://pintia.cn/problem-sets/16/exam/problems/702
int Isomorphic(Tree T1, Tree T2) {
if (T1 == NULL && T2 == NULL) return 1;
if ((T1 == NULL && T2 != NULL) || (T2 == NULL && T1 != NULL)) return 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/703
// https://pintia.cn/problem-sets/16/exam/problems/703
void PercolateUp(int p, PriorityQueue H) {
int i = p, j = i / 2;
while (j >= 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/704
// https://pintia.cn/problem-sets/16/exam/problems/704
void MySort(ElementType A[], int N) {
int cntMaybe = 0, pos = 0;
for (int i = 0; i < N; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/663
// https://pintia.cn/problem-sets/16/exam/problems/663
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/674
// https://pintia.cn/problem-sets/16/exam/problems/674
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805377432928256
// https://pintia.cn/problem-sets/16/exam/problems/675
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/676
// https://pintia.cn/problem-sets/16/exam/problems/676
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/678
// https://pintia.cn/problem-sets/16/exam/problems/678
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/664
// https://pintia.cn/problem-sets/16/exam/problems/664
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/682
// https://pintia.cn/problem-sets/16/exam/problems/682
// 4 2
// 3 1 4 2
// 3 4 1 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/683
// https://pintia.cn/problem-sets/16/exam/problems/683
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/689
// https://pintia.cn/problem-sets/16/exam/problems/689
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/665
// https://pintia.cn/problem-sets/16/exam/problems/665
// 5 7 5
// 1 2 3 4 5 6 7
// 3 2 1 7 5 6 4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/666
// https://pintia.cn/problem-sets/16/exam/problems/666
#include <bits/stdc++.h>
using namespace std;
struct node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/667
// https://pintia.cn/problem-sets/16/exam/problems/667
#include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/668
// https://pintia.cn/problem-sets/16/exam/problems/668
#include <bits/stdc++.h>
using namespace std;
struct node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/669
// https://pintia.cn/problem-sets/16/exam/problems/669
#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/16/problems/670
// https://pintia.cn/problem-sets/16/exam/problems/670
#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805528788582400
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805528788582400
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805526272000000
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805526272000000
#include <cstdio>
int main() {
double p[1010] = {0}, c;
Expand Down
4 changes: 2 additions & 2 deletions PAT_(Advanced_Level)_Practice/编程题/1003 Emergency.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805523835109376
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805523835109376
#include <bits/stdc++.h>
using namespace std;
const int N = 510, INF = 0x7FFFFFF;
Expand Down Expand Up @@ -79,7 +79,7 @@ bool vis[N] = {false};
void dijkstra(int s){
fill(d, d + n, INF); // 用无穷大表示起点s->all都无路径
d[s] = 0; // s->s的最短距离为0
w[s] = weight[s]; // s->s的最小点权和为0
w[s] = weight[s]; // s->s的最小点权和为0
num[s] = 1; // s->s的最短路径个数为1
for (int i = 0; i < n; i++){ // 循环n次, 每一次都从离上个起点最近的点开始继续向下记录
int u = -1, MIN = INF; // 最小值取INF, 只要小于INF则表示连通
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805521431773184
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805521431773184
#include<cstdio>
#include<cstring>
struct Node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805519074574336
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805519074574336

#include<cstdio>
#include<cstring>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805516654460928
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805516654460928
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805514284679168
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805514284679168
#include <cstdio>
const int maxn = 10010;
int a[maxn], dp[maxn];
Expand Down
2 changes: 1 addition & 1 deletion PAT_(Advanced_Level)_Practice/编程题/1008 Elevator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805511923286016
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805511923286016
#include <cstdio>
int main() {
int n, total = 0, now = 0, to;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805509540921344
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805509540921344
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
2 changes: 1 addition & 1 deletion PAT_(Advanced_Level)_Practice/编程题/1010 Radix.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805507225665536
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805507225665536
#include <algorithm>
#include <string.h>
#include <cctype>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805504927186944
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805504927186944
#include <bits/stdc++.h>
using namespace std;
int main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805502658068480
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805502658068480
#include <iostream>
#include <cstdio>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805500414115840
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805500414115840
#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805498207911936
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805498207911936
#include <cstdio>
#include <queue>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805495863296000
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805495863296000
#include <cstdio>
const int maxn = 30;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805493648703488
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805493648703488
#include<vector>
#include<string>
#include<iostream>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805491530579968
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805491530579968
#include <cstdio>
#include <algorithm>
#include <queue>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805489282433024
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805489282433024
#include <cstdio>
#include <vector>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805487143337984
#include <cstdio>
#include <vector>
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805487143337984
#include <bits/stdc++.h>
using namespace std;

int main(){
int main() {
int n, b;
scanf("%d%d", &n, &b);
vector<int> ans;
while (n != 0){
ans.push_back(n % b);
n /= b;
}
int i = 0, len = ans.size();
while (i < len / 2 && ans[i] == ans[len - i - 1]){
i++;
}
if (i == len / 2){
printf("Yes\n");
} else {
printf("No\n");
}
for (int i = len - 1; i >= 0; i--){
printf("%d", ans[i]);
if (i > 0) printf(" ");
vector<int> d;
for (; n != 0; n /= b) d.push_back(n % b);
int i = 0, len = d.size();
while (i < len / 2 && d[i] == d[len - i - 1]) i++;
printf("%s\n", i == len / 2 ? "Yes" : "No");
for (int i = len - 1; i >= 0; i--) {
if (i != len - 1) printf(" ");
printf("%d", d[i]);
}
return 0;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805485033603072
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805485033603072
#include <cstdio>
#include <cstring>
#include <queue>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805482919673856
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805482919673856
#include <cstdio>
#include <cstring>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805480801550336
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805480801550336
#include <iostream>
#include <algorithm>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805478658260992
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805478658260992
#include <cstdio>
#include <cstring>
const int maxn = 25;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805476473028608
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805476473028608
#include <cstdio>
#include <cstring>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805474338127872
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805474338127872
#include<cstdio>
#include<cstring>
#include<algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805472333250560
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805472333250560
#include <iostream>
#include <vector>
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805470349344768
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805470349344768
#include <cstdio>
char change(int x){
if (x > 9){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://pintia.cn/problem-sets/994805342720868352/problems/994805468327690240
// https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805468327690240
#include <iostream>
#include <cstring>
#include <algorithm>
Expand Down
Loading

0 comments on commit 9f07f67

Please sign in to comment.