This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<cstdio> | |
| struct Person { | |
| int age; | |
| char name[101]; | |
| bool operator <= (const Person &v) const { | |
| return age <= v.age; | |
| } | |
| }; | |
| Person a[100000], b[100000]; | |
| void merge(int start, int end) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<vector> | |
| #include<set> | |
| #include<string> | |
| using namespace std; | |
| struct Node { | |
| int val; | |
| Node *left; | |
| Node *right; | |
| Node() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <queue> | |
| using namespace std; | |
| int main() { | |
| int n, m; | |
| scanf("%d %d",&n,&m); | |
| queue<int> q; | |
| for (int i=1; i<=n; i++) { | |
| q.push(i); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <algorithm> | |
| using namespace std; | |
| int main() { | |
| for (int t = 1; ; t++) { | |
| int L, P, V; | |
| scanf("%d %d %d", &L, &P, &V); | |
| if (V == 0) break; | |
| printf("Case %d: %d\n", t, V / P*L + min(V%P, L)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<cstdio> | |
| #include<algorithm> | |
| using namespace std; | |
| int main() { | |
| int n, l; | |
| scanf("%d %d", &n, &l); | |
| int *a = new int[n]; | |
| for (int i = 0;i < n;i++) { | |
| scanf("%d", &a[i]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<cstdio> | |
| #include<algorithm> | |
| using namespace std; | |
| int a[100]; | |
| int main() { | |
| for (int test = 1;test <= 10;test++) { | |
| int dump; | |
| scanf("%d", &dump); | |
| for (int i = 0;i < 100;i++) { | |
| scanf("%d", &a[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<cstdio> | |
| #include<algorithm> | |
| using namespace std; | |
| int a[1000]; | |
| int main() { | |
| for (int test = 1;test <= 10;test++) { | |
| int n; | |
| scanf("%d", &n); | |
| for (int i = 0;i < n;i++) { | |
| scanf("%d", &a[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<cstdio> | |
| #include<vector> | |
| #include<algorithm> | |
| using namespace std; | |
| int dx[] = { 0,0,1,-1 }; | |
| int dy[] = { 1,-1,0,0 }; | |
| int n, k; | |
| int ans; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<vector> | |
| #include<algorithm> | |
| #include<cstring> | |
| using namespace std; | |
| int a[10][10]; | |
| int main() { | |
| int t; | |
| cin >> t; | |
| for(int test=1;test<=t;test++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include<map> | |
| using namespace std; | |
| map<pair<int, int>, int> mp; | |
| int solve(int b, int g) { | |
| if (b >= 40) | |
| return 0; | |
| if (g == 1) | |
| return b == 0; | |
| if (mp.count({ b, g }) != 0) |
NewerOlder