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> | |
using namespace std; | |
int main(){ | |
int TestCase; | |
scanf("%d", &TestCase); | |
while(TestCase--){ | |
int a, b; | |
scanf("%d,%d", &a, &b); | |
printf("%d\n", a+b); |
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> | |
using namespace std; | |
int main(){ | |
int a, b; | |
while(scanf("%d%d", &a, &b)!=EOF) | |
printf("%d\n", a+b); | |
return 0; | |
} |
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> | |
using namespace std; | |
int main(){ | |
int TestCase; | |
cin>>TestCase; | |
while(TestCase--){ | |
int a, b; | |
cin>>a>>b; | |
cout<<a+b<<endl; |
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> | |
using namespace std; | |
int main(){ | |
int a, b; | |
cin>>a>>b; | |
cout<<a+b<<endl; | |
return 0; | |
} |
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
// 1. O(log(n)) | |
while(n) | |
n/=2; | |
// 2. O(sqrt(n)) | |
for(int i=0;i*i<=n;i++); | |
// 3. O(n) | |
for(int i=0;i<n;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 <bits/stdc++.h> | |
using namespace std; | |
int dist[101][101]; | |
int n, m, k, p; | |
int main(){ | |
int TestCase; | |
scanf("%d", &TestCase); | |
for(int tc=1;tc<=TestCase;tc++){ | |
scanf("%d%d%d", &n, &m, &k); | |
memset(dist, 0x3f, sizeof(dist)); |
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 <bits/stdc++.h> | |
using namespace std; | |
int n, s; | |
int arr[100000]; | |
int main(){ | |
int TestCase; | |
scanf("%d", &TestCase); | |
for(int tc=1;tc<=TestCase;tc++){ | |
scanf("%d%d", &n, &s); | |
for(int i=0;i<n;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 <bits/stdc++.h> | |
using namespace std; | |
const int INF=0x3f3f3f3f; | |
int N; | |
int cache[2501][51]; | |
int b[51]; | |
vector<pair<int, int> > dish; | |
int solve(int idx,int front) { | |
if (idx == dish.size()) |
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 <bits/stdc++.h> | |
using namespace std; | |
int n, m; | |
int x, y; | |
int k; | |
int mat[20][20]; | |
// 1 2 3 4 5 6 | |
int dice[7]={0, 0, 0, 0, 0, 0, 0}; | |
int dx[4]={0, 0, -1, 1}; | |
int dy[4]={1, -1, 0, 0}; |
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 <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int TestCase; | |
scanf("%d", &TestCase); | |
for(int tc=1;tc<=TestCase;tc++){ | |
int n, m; | |
scanf("%d%d", &n, &m); | |
vector<int> arr(n); | |
for(int i=0;i<n;i++) |