buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
change_count
int64
0
100
#include <cstdlib> #include <iostream> #include <string> #define DIGIT 80 using namespace std; class largenum { int nums[DIGIT]; bool overflow; int most; public: largenum() { overflow = false; most = DIGIT - 1; for (int i = 0; i < DIGIT; i++) nums[i] = 0; } bool isoverflow() { return ove...
#include <cstdlib> #include <iostream> #include <string> #define DIGIT 80 using namespace std; class largenum { int nums[DIGIT]; bool overflow; int most; public: largenum() { overflow = false; most = DIGIT - 1; for (int i = 0; i < DIGIT; i++) nums[i] = 0; } bool isoverflow() { return ove...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
644
3
#include <algorithm> #include <iostream> #include <stack> #include <stdio.h> #include <string.h> using namespace std; int main() { int n, i, j, flag; char ch1[100], ch2[100]; cin >> n; fgets(ch1, 100, stdin); for (i = 0; i < n; i++) { fgets(ch1, 100, stdin); fgets(ch2, 100, stdin); if (strlen(ch1...
#include <algorithm> #include <iostream> #include <stack> #include <stdio.h> #include <string.h> using namespace std; int main() { int n, i, j, flag; char ch1[100], ch2[100]; cin >> n; fgets(ch1, 100, stdin); for (i = 0; i < n; i++) { fgets(ch1, 100, stdin); fgets(ch2, 100, stdin); if (strlen(ch1...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
404
4
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; int main() { int n; cin >> n; for (int y = 0; y < n; y++) { string s, t; cin >> s >> t; int ls = s.size(), lt = t.size(); if (ls ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; int main() { int n; cin >> n; for (int y = 0; y < n; y++) { string s, t; cin >> s >> t; int ls = s.size(), lt = t.size(); if (ls ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]]
1
310
2
#include <algorithm> #include <bits/stdc++.h> #include <list> #include <queue> #include <stack> #include <vector> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { char c1[80], c2[80]; scanf("%s", &c1); scanf("%s", &c2); string s1, s2; s1 = c1, s2 = c2; if (s1 == "0"...
#include <algorithm> #include <bits/stdc++.h> #include <list> #include <queue> #include <stack> #include <vector> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { //???????????±?????§???????????? char c1[1000], c2[1000]; scanf("%s", &c1); scanf("%s", &c2); string s1, s2...
[["-", 0, 52, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 80, 81, 13]]
1
394
4
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
415
2
#include <bits/stdc++.h> using namespace std; int main() { string s; int n, num1[101], num2[101], num3[102]; cin >> n; for (int i = 0; i < n; ++i) { memset(num1, 0, sizeof(num1)); memset(num2, 0, sizeof(num2)); memset(num3, 0, sizeof(num3)); cin >> s; for (int i = 0, len = s.size(); ...
#include <bits/stdc++.h> using namespace std; int main() { string s; int n, num1[101], num2[101], num3[102]; cin >> n; for (int i = 0; i < n; ++i) { memset(num1, 0, sizeof(num1)); memset(num2, 0, sizeof(num2)); memset(num3, 0, sizeof(num3)); cin >> s; for (int i = 0, len = s.size(); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
324
2
#include <bits/stdc++.h> using namespace std; char str[102], str1[102], ans[102]; int sam(int ma1, int ma2) { int co, carry = 0, a, b; for (int i = 0; ma1 - i >= 0 || ma2 - i >= 0 || carry == 1; i++) { if (ma1 - i >= 0 && ma2 - i >= 0) { a = str[ma1 - i] - '0'; b = str1[ma2 - i] - '0'; if (a +...
#include <bits/stdc++.h> using namespace std; char str[102], str1[102], ans[102]; int sam(int ma1, int ma2) { int co, carry = 0, a, b; for (int i = 0; ma1 - i >= 0 || ma2 - i >= 0 || carry == 1; i++) { if (ma1 - i >= 0 && ma2 - i >= 0) { a = str[ma1 - i] - '0'; b = str1[ma2 - i] - '0'; if (a +...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 44], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
440
5
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b; bool cu = false; cin >> a >> b; int al = a.length(), bl = b.length(), ans[101] = {0}; for (int i = 0; i < min(al, bl); i++) { ans[i] = a[al - i - 1] + b[bl - i - 1] - 48 * ...
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b; bool cu = false; cin >> a >> b; int al = a.length(), bl = b.length(), ans[101] = {0}; for (int i = 0; i < min(al, bl); i++) { ans[i] = a[al - i - 1] + b[bl - i - 1] - 48 * ...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
335
2
#include <cstring> #include <iostream> #include <string> using namespace std; string S, T; int n, x[10000], a[10000], b[10000], cnt; char U[11] = "0123456789"; int main() { cin >> n; for (int times = 0; times < n; times++) { cin >> S >> T; memset(x, 0, sizeof(x)); memset(a, 0, sizeof(a)); memset(b, ...
#include <cstring> #include <iostream> #include <string> using namespace std; string S, T; int n, x[10000], a[10000], b[10000], cnt; char U[11] = "0123456789"; int main() { cin >> n; for (int times = 0; times < n; times++) { cin >> S >> T; memset(x, 0, sizeof(x)); memset(a, 0, sizeof(a)); memset(b, ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
472
4
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string a, b; vector<int> ans; int n, num, ai, bi, c = 0; bool flag; cin >> n; if (n > 0 && n <= 100) { for (int i = 0; i < n; i++) { cin >> a >> b; flag = false; for (int j = 0; j < 100; j...
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string a, b; vector<int> ans; int n, num, ai, bi, c = 0; bool flag; cin >> n; if (n > 0 && n <= 100) { for (int i = 0; i < n; i++) { cin >> a >> b; flag = false; for (int j = 0; j < 100; j...
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
279
2
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b) for (int i = a; i <= b; ++i) #define LL long long using namespace std; static const LL INF = 1LL << 61LL; typedef pair<int, int> PII; string a, b; string ans; int M; char t[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b) for (int i = a; i <= b; ++i) #define LL long long using namespace std; static const LL INF = 1LL << 61LL; typedef pair<int, int> PII; string a, b; string ans; int M; char t[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 75, 76, 0, 1, 0, 35]]
1
405
5
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { string s1, s2; cin >> s1; cin >> s2; int s1_itr = s1.length() - 1; int s2_itr = s2.length...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { string s1, s2; cin >> s1; cin >> s2; int s1_itr = s1.length() - 1; int s2_itr = s2.length...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
267
2
#include <cstdlib> #include <iostream> #include <stack> #include <string> using namespace std; int main() { int N; cin >> N; for (int N_i = 0; N_i < N; N_i++) { bool overflow = false; string str_data1, str_data2; cin >> str_data1; cin >> str_data2; stack<int> data1, data2; for (int da...
#include <cstdlib> #include <iostream> #include <stack> #include <string> using namespace std; int main() { int N; cin >> N; for (int N_i = 0; N_i < N; N_i++) { bool overflow = false; string str_data1, str_data2; cin >> str_data1; cin >> str_data2; stack<int> data1, data2; for (int da...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
477
6
#include <cstdlib> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { int n; string a, b; cin >> n; for (int j = 0; j < n; j++) { cin >> a >> b; int asize = a.length(); int bsize = b.length(); int smax = max(asize, bsize); bool flag = false; int s...
#include <cstdlib> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { int n; string a, b; cin >> n; for (int j = 0; j < n; j++) { cin >> a >> b; int asize = a.length(); int bsize = b.length(); int smax = max(asize, bsize); bool flag = false; int s...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
334
2
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int n; cin >> n; for (int j = 0; j < n; ++j) { string numA; string numB; cin >> numA >> numB; /* if(numA.size()<numB.size())swap(numA,numB); while(numA.size()>numB.size())numB="...
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int n; cin >> n; for (int j = 0; j < n; ++j) { string numA; string numB; cin >> numA >> numB; while (numA.size() != numB.size()) { if (numA.size() < numB.size()) { numA =...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
308
2
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <stack> #include <string> using namespace std; int main(void) { int n = 0; string as; string bs; int a[100] = {}; int b[100] = {}; int c[100] = {}; int i = 0; int alen = 0; int blen = 0; int clen = 0; int k = 0;...
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <stack> #include <string> using namespace std; int main(void) { int n = 0; string as; string bs; int a[100] = {}; int b[100] = {}; int c[100] = {}; int i = 0; int alen = 0; int blen = 0; int clen = 0; int k = 0;...
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
670
3
#include <math.h> #include <stdio.h> using namespace std; int main() { char buf1[101], buf2[101]; bool overflowFLG; int n, length1, length2, kuriagari, tmp, output[101]; scanf("%d", &n); for (int loop = 0; loop < n; loop++) { length1 = length2 = 0; scanf("%s", buf1); scanf("%s", buf2); for ...
#include <math.h> #include <stdio.h> using namespace std; int main() { char buf1[101], buf2[101]; bool overflowFLG; int n, length1, length2, kuriagari, tmp, output[101]; scanf("%d", &n); for (int loop = 0; loop < n; loop++) { length1 = length2 = 0; scanf("%s", buf1); scanf("%s", buf2); for ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107]]
1
753
4
#include <algorithm> #include <cstdio> #include <iostream> #include <stack> using namespace std; int main() { stack<int> n1, n2; int n, nn1, nn2, up, k, f, num[100]; char c; cin >> n; scanf("%c", &c); for (int i = 0; i < n; i++) { while (1) { scanf("%c", &c); if (c == '\n') break; ...
#include <algorithm> #include <cstdio> #include <iostream> #include <stack> using namespace std; int main() { stack<int> n1, n2; int n, nn1, nn2, up, k, f, num[1000]; char c; cin >> n; scanf("%c", &c); for (int i = 0; i < n; i++) { while (1) { scanf("%c", &c); if (c == '\n') break; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
342
4
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n; scanf("%d", &n); rep(i, n) { string s, t; cin >> s >> t; string ans; int back = 0; for (int j = 1; j <= min(s.size(), t.size()); j++) { int d = s[s.size() - j] - '0' + t[t.siz...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n; scanf("%d", &n); rep(i, n) { string s, t; cin >> s >> t; string ans; int back = 0; for (int j = 1; j <= min(s.size(), t.size()); j++) { int d = s[s.size() - j] - '0' + t[t.siz...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
286
1
#include "bits/stdc++.h" using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for (int i = 0; i < N; i++) { vector<int> v1(101), v2(101); string str1, str2; cin >> str1 >> str2; for (int j = 0; j < str1.size(); j++) v1[j] = str1[str1.size() - j - 1]...
#include "bits/stdc++.h" using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for (int i = 0; i < N; i++) { vector<int> v1(101), v2(101); string str1, str2; cin >> str1 >> str2; for (int j = 0; j < str1.size(); j++) v1[j] = str1[str1.size() - j - 1]...
[["-", 0, 7, 8, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 7, 8, 1, 0, 11, 31, 69, 28, 22]]
1
290
2
#include <algorithm> #include <iostream> #include <string> using namespace std; string reverse(const string &str) { string ret; string::const_reverse_iterator it = str.rbegin(); for (; it != str.rend(); it++) { ret.push_back(*it); } return ret; } int main() { int N; cin >> N; for (int i = 0; i < N...
#include <algorithm> #include <iostream> #include <string> using namespace std; string reverse(const string &str) { string ret; string::const_reverse_iterator it = str.rbegin(); for (; it != str.rend(); it++) { ret.push_back(*it); } return ret; } int main() { int N; cin >> N; for (int i = 0; i < N...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
317
2
/* C++ ???????????????????????????????????¬?????? ??????AOJ-ITP1?????????????????? */ #define _USE_MATH_DEFINES #include <algorithm> // max??¢??°?????? #include <cmath> // ??°?????? #include <fstream> // ??????????????\?????? #include <iomanip> // stream???????????¢??? #include <iostream> // ?¨??????\?????? #...
/* C++ ???????????????????????????????????¬?????? ??????AOJ-ITP1?????????????????? */ #define _USE_MATH_DEFINES #include <algorithm> // max??¢??°?????? #include <cmath> // ??°?????? #include <fstream> // ??????????????\?????? #include <iomanip> // stream???????????¢??? #include <iostream> // ?¨??????\?????? #...
[["-", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 15, 339, 51, 16, 12, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 15, 339, 51, 16, 12, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, ...
1
333
10
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF 2000000000 //#define int ll #define ll long long #define ld long double #define vi vector<int> #define pa pair<int, int> #define fi first #define se second #define pb push_back #define mp make_pair #define INIT ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF 2000000000 //#define int ll #define ll long long #define ld long double #define vi vector<int> #define pa pair<int, int> #define fi first #define se second #define pb push_back #define mp make_pair #define INIT ...
[["-", 8, 9, 0, 57, 64, 37, 0, 5, 0, 6], ["+", 8, 9, 0, 57, 64, 37, 0, 5, 0, 6]]
1
480
2
#include <bits/stdc++.h> using namespace std; using VI = vector<int>; using VVI = vector<VI>; using PII = pair<int, int>; using LL = long long; using VL = vector<LL>; using VVL = vector<VL>; using PLL = pair<LL, LL>; using VS = vector<string>; #define ALL(a) begin((a)), end((a)) #define RALL(a) (a).rbegin(), (a).rend...
#include <bits/stdc++.h> using namespace std; using VI = vector<int>; using VVI = vector<VI>; using PII = pair<int, int>; using LL = long long; using VL = vector<LL>; using VVL = vector<VL>; using PLL = pair<LL, LL>; using VS = vector<string>; #define ALL(a) begin((a)), end((a)) #define RALL(a) (a).rbegin(), (a).rend...
[["-", 8, 123, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 51, 22], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["-", 8, 9, 0, 52, 15, 339, 51, 27, 17, 68], ["+", 8, 9, 0, 52, 15, 339, 51, 27, 17, 68]]
1
3,396
6
#include <algorithm> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b; cin >> a >> b; reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); if (b.size() < a.size()) swap(a, b); b += "0"; fo...
#include <algorithm> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b; cin >> a >> b; reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); if (b.size() < a.size()) swap(a, b); b += "0"; fo...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
274
2
#include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> sum(string A, string B); int main() { int n; cin >> n; string a, b; for (int i = 0; i < n; i++) { cin >> a; cin >> b; if ((int)a.size() > 80 || (int)b.size() > 80) cout << "overflow\n"; else { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> sum(string A, string B); int main() { int n; cin >> n; string a, b; for (int i = 0; i < n; i++) { cin >> a; cin >> b; if ((int)a.size() > 80 || (int)b.size() > 80) cout << "overflow\n"; else { ...
[["-", 31, 16, 31, 74, 51, 69, 341, 342, 0, 22], ["+", 31, 16, 31, 74, 51, 69, 341, 342, 0, 22]]
1
542
4
#include <algorithm> #include <iostream> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long LL; static const double EPS = 1e-9; #define FOR(i, k, n) for (int i = (k); i < (int)(n); ++i) #define REP(i, n) FOR(i, 0, n) int main(void) { int n; cin >> n; REP...
#include <algorithm> #include <iostream> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long LL; static const double EPS = 1e-9; #define FOR(i, k, n) for (int i = (k); i < (int)(n); ++i) #define REP(i, n) FOR(i, 0, n) int main(void) { int n; cin >> n; REP...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
338
4
#include <cstdio> #include <cstring> #include <iostream> using namespace std; char ans[101]; char n1[101]; char n2[101]; int main() { int d; int h1, h2, limit; for (cin >> d; d > 0; d--) { for (int j = 0; j < 100; j++) ans[j] = '0'; scanf("%s", n1); scanf("%s", n2); h1 = strlen(n1) - 1; ...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; char ans[101]; char n1[101]; char n2[101]; int main() { int d; int h1, h2, limit; for (cin >> d; d > 0; d--) { for (int j = 0; j < 100; j++) ans[j] = '0'; scanf("%s", n1); scanf("%s", n2); h1 = strlen(n1) - 1; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
400
2
// 0015 National Budget // 80Œ…‚܂łÌ2‚‚̐®”‚Ì‘«‚µŽZŒ‹‰Ê‚ðo—Í‚¹‚æ // 1s–ڂɃf[ƒ^ƒZƒbƒg”n‚ª—^‚¦‚ç‚ê‚é //—^‚¦‚ç‚ꂽ”‚â‚»‚̘a‚ª80Œ…‚ð’´‚¦‚½ê‡Aoverflow‚Əo—Í‚µ‚Ä‚­‚¾‚³‚¢ #include <algorithm> #include <cstring> #include <iostream> #include <string> using namespace std; int main(void) { int n; cin >> n; whi...
// 0015 National Budget // 80Œ…‚܂łÌ2‚‚̐®”‚Ì‘«‚µŽZŒ‹‰Ê‚ðo—Í‚¹‚æ // 1s–ڂɃf[ƒ^ƒZƒbƒg”n‚ª—^‚¦‚ç‚ê‚é //—^‚¦‚ç‚ꂽ”‚â‚»‚̘a‚ª80Œ…‚ð’´‚¦‚½ê‡Aoverflow‚Əo—Í‚µ‚Ä‚­‚¾‚³‚¢ #include <algorithm> #include <cstring> #include <iostream> #include <string> using namespace std; int main(void) { int n; cin >> n; whi...
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13]]
1
327
4
stack = [] while True: try: n = int(input) except: break stack.append(n) if n else print(stack.pop())
stack = [] while True: try: n = int(input()) except: break stack.append(n) if n else print(stack.pop())
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
35
2
list = {} while True: try: num = int(input()) if num == 0: print(list.pop()) else: list.append(num) except: break
list = [] while True: try: num = int(input()) if num == 0: print(list.pop()) else: list.append(num) except: break
[["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 45], ["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 46], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73]]
5
41
4
a=[] while 1: try:n=int(input());a.append(e)if e else print(a.pop()) except:break
a=[] while 1: try:n=int(input());a.append(n)if n else print(a.pop()) except:break
[["-", 0, 1, 0, 41, 0, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 41, 0, 652, 3, 4, 0, 22], ["-", 0, 246, 8, 196, 0, 1, 0, 41, 0, 22], ["+", 0, 246, 8, 196, 0, 1, 0, 41, 0, 22]]
5
38
4
import sys a=[int(i)for i in sys.stdin] b=[] print(a) for j in a: if j == 0: print(b.pop()) else: b.append(j)
import sys a=[int(i)for i in sys.stdin] b=[] for j in a: if j == 0: print(b.pop()) else: b.append(j)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
50
4
import sys a=[map(int,i)for i in sys.stdin] b=[] for j in a: if j == 0: print(b.pop()) else: b.append(j)
import sys a=[int(i)for i in sys.stdin] b=[] for j in a: if j == 0: print(b.pop()) else: b.append(j)
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["-", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 658, 8, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24]]
5
48
4
import sys lst = [] for line in sys.stdin: num = int(line.split()) if num == 0: print(lst.pop()) else: lst.append(num) sys.exit(0)
import sys lst = [] for line in sys.stdin: num = line.strip() if num == "0": print(lst.pop()) else: lst.append(num) sys.exit(0)
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 655...
5
50
7
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = null; try { sc = new Scanner(System.in); while (sc.hasNextInt()) { int d = sc.nextInt(); int areaCulcCount = 600 / d; long sum = 0L; for (int i = 1; i <= areaCulcCount; ...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = null; try { sc = new Scanner(System.in); while (sc.hasNextInt()) { int d = sc.nextInt(); int areaCulcCount = (600 - d) / d; long sum = 0L; for (int i = 1; i <= areaCulcC...
[["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 25]]
3
126
4
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int d = sc.nextInt(); double sum = 0; for (int i = 1; 600 >= d * (i + 1); i++) { sum += Math.pow(i * d, 2...
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int d = sc.nextInt(); int sum = 0; for (int i = 1; 600 >= d * (i + 1); i++) { sum += Math.pow(i * d, 2) *...
[["-", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507]]
3
118
2
import java.io.*; public class Main { public static void main(String args[]) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String s; int sum = 0; while ((s = reader.readLine()) != null) { int x = Integer.parseInt(s); for (i...
import java.io.*; public class Main { public static void main(String args[]) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String s; int sum = 0; while ((s = reader.readLine()) != null) { int x = Integer.parseInt(s); for (i...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35]]
3
145
4
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(), ans = 0; for (int i = 1; i < 600 / n; i++) { ans += Math.pow(i * n, 2) * n; System.out.println(ans); } ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(), ans = 0; for (int i = 1; i < 600 / n; i++) { ans += Math.pow(i * n, 2) * n; } System.out.println(ans); } ...
[["+", 0, 52, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 52, 8, 196, 0, 7, 8, 196, 0, 46]]
3
100
2
#include <stdio.h> int main(void) { int i, a, b, c, d, e; while (scanf("%d", &a) != EOF) { b = 600 / a; int sum = 0; for (i = 1; i < b; i++) { e = i * a; d = e * e; c = a * d; sum += c; } printf("%d", sum); if (a == 0) { break; } } return 0; }
#include <stdio.h> int main(void) { int i, a, b, c, d, e; while (scanf("%d", &a) != EOF) { b = 600 / a; int sum = 0; for (i = 1; i < b; i++) { e = i * a; d = e * e; c = a * d; sum += c; } printf("%d\n", sum); if (a == 0) { break; } } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
108
1
#include <stdio.h> int main(void) { int x, d, area; while (scanf("%d", &d) != EOF) { area = 0; x = d; while (x < 600) { area += d * x * x; x += d; } printf("%d", area); } return 0; }
#include <stdio.h> int main(void) { int x, d, area; while (scanf("%d", &d) != EOF) { area = 0; x = d; while (x < 600) { area += d * x * x; x += d; } printf("%d\n", area); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
72
1
#include <stdio.h> int main() { int d; while (scanf("%d", &d) != EOF) { int i, length, sum; length = 600; sum = 0; for (i = 1; i < length / d; i++) { sum += i * i * d * d; } printf("%d", sum * d); } return 0; }
#include <stdio.h> int main() { int d; while (scanf("%d", &d) != EOF) { int i, length, sum; length = 600; sum = 0; for (i = 1; i < length / d; i++) { sum += i * i * d * d; } printf("%d\n", sum * d); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
83
1
#include <stdio.h> int main(void) { int d; int len; int i; int s = 0; int y; while (scanf("%d", &d)) { y = d; len = 600 / d; for (i = 1; i < len; i++) { s += d * y * y; y += d; } printf("%d\n", s); d = 0; s = 0; } return 0; }
#include <stdio.h> int main(void) { int d; int len; int i; int s = 0; int y; while (scanf("%d", &d) != EOF) { y = d; len = 600 / d; for (i = 1; i < len; i++) { s += d * y * y; y += d; } printf("%d\n", s); d = 0; s = 0; } return 0; }
[["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 12, 22]]
0
98
2
#include <stdio.h> int main() { int n, value; int i; while (scanf("%d", &n) != EOF) { value = 0; for (i = 0; i < 600; i += n) value += i * i; printf("%d\n", value); } return 0; }
#include <stdio.h> int main() { int n, value; int i; while (scanf("%d", &n) != EOF) { value = 0; for (i = 0; i < 600; i += n) value += i * i * n; printf("%d\n", value); } return 0; }
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
0
69
2
#include <stdio.h> int main() { int d, x; int sum = 0; while (scanf("%d", &d) != EOF) { for (x = d; x < 600; x += d) { sum += x * x * d; } printf("%d\n", sum); } return 0; }
#include <stdio.h> int main() { int d, x; int sum = 0; while (scanf("%d", &d) != EOF) { sum = 0; for (x = d; x < 600; x += d) { sum += x * x * d; } printf("%d\n", sum); } return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
0
71
4
#include <stdio.h> int main(void) { int num; while (scanf("%d", &num) != EOF) { int o = 1, sum = num * num; while (num * o != 600 - num) { o++; sum += num * o * num * o; } printf("%d\n", sum); } return 0; }
#include <stdio.h> int main(void) { int num; while (scanf("%d", &num) != EOF) { int o = 1, sum = num * num * num; while (num * o != 600 - num) { o++; sum += num * o * num * o * num; } printf("%d\n", sum); } return 0; }
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
77
4
for x in range(eval(input())): a = eval(input()) + eval(input()) print(a if len(str(a)) < 80 else "overflow")
for x in range(eval(input())): a = eval(input()) + eval(input()) print(a if len(str(a)) < 81 else "overflow")
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 0, 612], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 612]]
5
46
2
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); /*answer*/ int r, t, i, k; double x, y; char[] ch; String str; t = 90; x = 0; y = 0; k = 0; for (; sc.hasNext();) { str = sc.next(...
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); /*answer*/ int r, t, i, k; double x, y; char[] ch; String str; t = 90; x = 0; y = 0; k = 0; for (; sc.hasNext();) { str = sc.next(...
[["-", 0, 492, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 3, 4, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 3, 4, 0, 16, 31, 16, 12, 5, 0, 491], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 25], ["+", 8, 498, 0, 195, 8, 196, 0, 1, 0, 35], ["+", 0, 195, 8, 196, 0, 1, 0, 492, 500, 22], ["+", 0, 195, 8,...
3
374
11
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int theta = 90; double x = 0; double y = 0; int d = 0; int a = 0; while (sc.hasNext()) { String[] str = sc.nextLine().split(","); d = Integer.parseInt(st...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int theta = 90; double x = 0; double y = 0; int d = 0; int a = 0; while (sc.hasNext()) { String[] str = sc.nextLine().split(","); d = Integer.parseInt(st...
[["-", 0, 1, 0, 11, 12, 16, 31, 74, 51, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 51, 22]]
3
197
2
import java.util.Scanner; public class Main { public static class P { public double x; public double y; public P(double x, double y) { this.x = x; this.y = y; } } public static P ta(int d, int a) { double dx = d * Math.sin(a * Math.PI / 180.0); double dy = d * Math.cos(a * Ma...
import java.util.Scanner; public class Main { public static class P { public double x; public double y; public P(double x, double y) { this.x = x; this.y = y; } } public static P ta(int d, int a) { double dx = d * Math.sin(a * Math.PI / 180.0); double dy = d * Math.cos(a * Ma...
[["-", 0, 503, 49, 200, 51, 492, 3, 4, 0, 22], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 22]]
3
279
2
import java.math.BigInteger; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[] position = new double[2]; int x = 0; int theta = 90; while (true) { String str = sc.next(); String[] strArr = str.split(","); ...
import java.math.BigInteger; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double[] position = new double[2]; int x = 0; int theta = 90; while (true) { String str = sc.next(); String[] strArr = str.split(","); ...
[["-", 0, 1, 0, 11, 12, 16, 12, 492, 141, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 492, 141, 22]]
3
205
4
import java.io.*; public class Main { public static void main(String[] args) { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); String s; String[] t; int l, kakudo; int sumkakudo = 0; double x, y, sumX, sumY; sumX = 0; sumY = 0; try { while ((s = r.re...
import java.io.*; public class Main { public static void main(String[] args) { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); String s; String[] t; int l, kakudo; int sumkakudo = 0; double x, y, sumX, sumY; sumX = 0; sumY = 0; try { while ((s = r.re...
[["-", 3, 4, 0, 16, 31, 16, 12, 5, 0, 491], ["+", 3, 4, 0, 16, 31, 16, 12, 5, 0, 44]]
3
239
2
#include <math.h> #include <stdio.h> int main() { int d, r; double x, y; double rad = 90; int a, b; while (scanf("%d,%d", &d, &r) != EOF) { if (!d && !r) break; x += d * cos(rad * M_PI / 180); y += d * sin(rad * M_PI / 180); rad -= r; } a = (int)x; b = (int)y; printf("%d %d...
#include <math.h> #include <stdio.h> int main() { int d, r; double x = 0, y = 0; double rad = 90; int a, b; while (scanf("%d,%d", &d, &r) != EOF) { if (!d && !r) break; x += d * cos(rad * M_PI / 180); y += d * sin(rad * M_PI / 180); rad -= r; } a = (int)x; b = (int)y; print...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
118
8
#include <math.h> #include <stdio.h> int main(void) { int d, t, deg; double rad, x, y; deg = 90; x = y = 0; while (scanf("%d,%d", &d, &t) != EOF && d && t) { rad = deg * M_PI / 180; x += cos(rad) * d; y += sin(rad) * d; deg = (deg - t + 360) % 360; } printf("%d\n%d\n", (int)x, (int)y); ...
#include <math.h> #include <stdio.h> int main(void) { int d, t, deg; double rad, x, y; deg = 90; x = y = 0; while (scanf("%d,%d", &d, &t) != EOF && (d || t)) { rad = deg * M_PI / 180; x += cos(rad) * d; y += sin(rad) * d; deg = (deg - t + 360) % 360; } printf("%d\n%d\n", (int)x, (int)y);...
[["+", 0, 52, 15, 23, 0, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 98], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 106], ["+", 0, 52, 15, 23, 0, 16, 12, 23, 0, 25]]
0
119
4
#include <math.h> #include <stdio.h> #define PI 3.14159265358 int main(void) { double x, y; int int_x, int_y; int angle_sum, s, a; x = 0; y = 0; angle_sum = 90; while (1) { scanf("%d,%d", &s, &a); if (s != 0 && a != 0) { break; } x += s * cos(angle_sum * PI / 180.0); y += s...
#include <math.h> #include <stdio.h> #define PI 3.14159265358 int main(void) { double x, y; int int_x, int_y; int angle_sum, s, a; x = 0; y = 0; angle_sum = 90; while (1) { scanf("%d,%d", &s, &a); if (s == 0 && a == 0) { break; } x += s * cos(angle_sum * PI / 180.0); y += s...
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 60]]
0
133
4
#include <math.h> #include <stdio.h> int main() { double l, r = 90, nr; double pos_x = 0, pos_y = 0; while (1) { scanf("%lf,%lf", &l, &nr); ; pos_x += l * cos(r / 180 * M_PI); pos_y += l * sin(r / 180 * M_PI); r += nr; if (l == 0 && nr == 0) break; } printf("%d\n%d\n", (int)pos_...
#include <math.h> #include <stdio.h> int main() { double l, r = 90, nr; double pos_x = 0, pos_y = 0; while (1) { scanf("%lf,%lf", &l, &nr); ; pos_x -= l * cos(r / 180 * M_PI); pos_y += l * sin(r / 180 * M_PI); r += nr; if (l == 0 && nr == 0) break; } printf("%d\n%d\n", (int)pos_...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]]
0
113
2
#include <math.h> #include <stdio.h> #define PI 3.1415926 int main(void) { double x = 0, y = 0; int z, turn; double angle = 0; while (scanf("%d,%d", &z, &turn) != EOF) { if (z == 0 && turn == 0) break; x += cos(PI * angle / 180.0) * z; y += sin(PI * angle / 180.0) * z; angle += turn...
#include <math.h> #include <stdio.h> #define PI 3.1415926 int main(void) { double x = 0, y = 0; int z, turn; double angle = 0; while (scanf("%d,%d", &z, &turn) != EOF) { if (z == 0 && turn == 0) break; x += cos(PI * angle / 180.0) * z; y += sin(PI * angle / 180.0) * z; angle += turn...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
114
5
#include <math.h> #include <stdio.h> #define pi 3.14159265358 int main() { double x, y, R = 90; int d, r; while (1) { scanf("%d,%d", &d, &r); if (d == 0 && r == 0) break; x += d * cos(R / 180.0 * pi); y += d * sin(R / 180.0 * pi); R += r; // printf("%lf %lf\n",cos(R/180.0*pi),sin(R/1...
#include <math.h> #include <stdio.h> #define pi 3.14159265358 int main() { double x, y, R = 90; int d, r; while (1) { scanf("%d,%d", &d, &r); if (d == 0 && r == 0) break; x += d * cos(R / 180.0 * pi); y += d * sin(R / 180.0 * pi); R += r; // printf("%lf %lf\n",cos(R/180.0*pi),sin(R/1...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 2, 3, 4, 0, 74, 51, 91, 17, 33], ["-", 0, 2, 3, 4, 0, 74, 51, 91, 17, 33]]
0
112
6
#include <math.h> #include <stdio.h> int main(void) { int distance = 0, angle = 90, rotate; double x = 0, y = 0, Pi = 3.141592; while (1) { scanf("%d,", &distance); x += distance * cos(angle * Pi / 180); y += distance * sin(angle * Pi / 180); scanf("%d", &rotate); if (distance == 0 && rotate ...
#include <math.h> #include <stdio.h> int main(void) { int distance = 0, angle = 90, rotate; double x = 0, y = 0, Pi = 3.141592; while (1) { scanf("%d,", &distance); x += distance * cos(angle * Pi / 180); y += distance * sin(angle * Pi / 180); scanf("%d", &rotate); if (distance == 0 && rotate ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
124
4
#include <math.h> #include <stdio.h> int main(void) { int w, a; double x = 0.0, y = 0.0; double age = 90.0; double r; while (1) { scanf("%d,%d", &w, &a); if (w == 0 && a == 0) break; r = (age / 180.0 * M_PI); x += cos(r) * w; y += sin(r) * w; age -= a; } printf("%d\n%d\n", ...
#include <math.h> #include <stdio.h> int main(void) { int w, a; double x = 0.0, y = 0.0; double age = 90.0; double r; while (1) { scanf("%d,%d", &w, &a); if (w == 0 && a == 0) break; r = (age / 180.0 * M_PI); x += cos(r) * w; y += sin(r) * w; age -= a; } printf("%d\n%d\n", ...
[["+", 0, 1, 0, 2, 3, 4, 0, 74, 0, 24], ["+", 0, 2, 3, 4, 0, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 2, 3, 4, 0, 74, 0, 25]]
0
113
6
#include <math.h> #include <stdio.h> int main(void) { int aa = 90, d, a; float x = 0, y = 0; while (1) { scanf("%d,%d", &d, &a); if (d == 0 && a == 0) { break; } y = y + (float)d * sin(aa * 3.14159265358979 / 180); x = x + (float)d * cos(aa * 3.14159265358979 / 180); aa = aa - a; ...
#include <math.h> #include <stdio.h> int main(void) { int aa = 90, d, a; float x = 0, y = 0; while (1) { scanf("%d,%d", &d, &a); if (d == 0 && a == 0) { break; } y = y + (float)d * sin(aa * 3.14159265358979 / 180); x = x + (float)d * cos(aa * 3.14159265358979 / 180); aa = aa - a; ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
125
4
#include <math.h> #include <stdio.h> int main() { int r, dc, c = 90; double x = 0, y = 0; while (scanf("%d,%d", &r, &dc), (r && dc)) { x += r * cos(c * M_PI / 180); y += r * sin(c * M_PI / 180); c -= dc; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
#include <math.h> #include <stdio.h> int main() { int r, dc, c = 90; double x = 0, y = 0; while (scanf("%d,%d", &r, &dc), (r || dc)) { x += r * cos(c * M_PI / 180); y += r * sin(c * M_PI / 180); c -= dc; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
[["-", 15, 23, 0, 34, 12, 23, 0, 16, 17, 98], ["+", 15, 23, 0, 34, 12, 23, 0, 16, 17, 106]]
0
104
2
#include <math.h> #include <stdio.h> int main(void) { double x = 0, y = 0, v = 90; double line, angle; while (scanf("%lf,%lf", &line, &angle), line && angle) { x += line * cos(M_PI * v / 180); y += line * sin(M_PI * v / 180); v -= angle; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
#include <math.h> #include <stdio.h> int main(void) { double x = 0, y = 0, v = 90; double line, angle; while (scanf("%lf,%lf", &line, &angle), line || angle) { x += line * cos(M_PI * v / 180); y += line * sin(M_PI * v / 180); v -= angle; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
[["-", 0, 52, 15, 23, 0, 34, 12, 16, 17, 98], ["+", 0, 52, 15, 23, 0, 34, 12, 16, 17, 106]]
0
103
2
#include <math.h> #include <stdio.h> double x, y, a; int main() { double mov, dir; while (scanf("%lf,%lf", &mov, &dir), mov, dir) { x += mov * sin(a * M_PI / 180); y += mov * cos(a * M_PI / 180); a += dir; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
#include <math.h> #include <stdio.h> double x, y, a; int main() { double mov, dir; while (scanf("%lf,%lf", &mov, &dir), mov || dir) { x += mov * sin(a * M_PI / 180); y += mov * cos(a * M_PI / 180); a += dir; } printf("%d\n%d\n", (int)x, (int)y); return 0; }
[["-", 0, 52, 15, 23, 0, 34, 12, 34, 0, 21], ["+", 0, 52, 15, 23, 0, 34, 12, 16, 17, 106]]
0
96
2
#include <math.h> #include <stdio.h> int main() { int r, p, t; double x, y; scanf("%d,%d", &r, &p); y = r; t = p; while (1) { scanf("%d,%d", &r, &p); if (r == 0 && p == 0) break; y += r * sin(M_PI_2 - t * M_PI / 180); x += r * cos(M_PI_2 - t * M_PI / 180); t = p; } printf("%d\...
#include <math.h> #include <stdio.h> int main() { int r, p, t; double x, y; scanf("%d,%d", &r, &p); y = r; t = p; while (1) { scanf("%d,%d", &r, &p); if (r == 0 && p == 0) break; y += r * sin(M_PI_2 - t * M_PI / 180); x += r * cos(M_PI_2 - t * M_PI / 180); t += p; } printf("%d...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107]]
0
131
2
#include <math.h> #include <stdio.h> int main() { double x = 0.0, y = 0.0; int theta = 90; int a, b; for (;;) { scanf("%d,%d", &a, &b); if (a == 0 && b == 0) break; x += a * cos(theta * M_PI / 180); y += a * sin(theta * M_PI / 180); theta -= b; } printf("%d,%d\n", (int)x, (int...
#include <math.h> #include <stdio.h> int main() { double x = 0.0, y = 0.0; int theta = 90; int a, b; for (;;) { scanf("%d,%d", &a, &b); if (a == 0 && b == 0) break; x += a * cos(theta * M_PI / 180); y += a * sin(theta * M_PI / 180); theta -= b; } printf("%d\n%d\n", (int)x, (in...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
112
4
#include <math.h> #include <stdio.h> #include <stdlib.h> #define PI 3.14159265358979323 // int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y); // void quick(int *,long long,long long); // int comp(char *a,char *b); int main() { double x, y; int a, b, r, i; x = 0; y = 0; r = 90; ...
#include <math.h> #include <stdio.h> #include <stdlib.h> #define PI 3.14159265358979323 // int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y); // void quick(int *,long long,long long); // int comp(char *a,char *b); int main() { double x, y; int a, b, r, i; x = 0; y = 0; r = 90; ...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]]
0
143
2
// ヘッダファイルのインクルード #include <math.h> #include <stdio.h> // マクロ定義 #define X 0 #define Y 1 #define X_AND_Y 2 #define NORTH 90 //度表現 #define compile 0 //デバッグ用,0:実装版,1:デバッグ版 // 関数のプロトタイプ宣言 double func_cal_rad(double angle); //度からラジアンへ変換する関数 double func_cal_x(double edge, double angle_r, double x); // x座標を計算する関数 double fu...
// ヘッダファイルのインクルード #include <math.h> #include <stdio.h> // マクロ定義 #define X 0 #define Y 1 #define X_AND_Y 2 #define NORTH 90 //度表現 #define compile 0 //デバッグ用,0:実装版,1:デバッグ版 // 関数のプロトタイプ宣言 double func_cal_rad(double angle); //度からラジアンへ変換する関数 double func_cal_x(double edge, double angle_r, double x); // x座標を計算する関数 double fu...
[["-", 0, 9, 0, 52, 15, 23, 0, 16, 17, 98], ["+", 0, 9, 0, 52, 15, 23, 0, 16, 17, 106], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
504
4
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> const int MOD = 1000000007; ...
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> const int MOD = 1000000007; ...
[["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
1,932
6
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; template <class T, class U> void assign(V<T> &v, int n, const U &a) { v.assign(n, a); } ...
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; template <class T, class U> void assign(V<T> &v, int n, const U &a) { v.assign(n, a); } ...
[["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 8, 9, 0, 1, 0, 16, 12, 103, 0, 44], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
358
4
#include <complex> #include <cstdio> #include <iostream> using namespace std; const double PI = 3.141592653589793238462643383279502884L; int main(int argc, char **argv) { int degree = 90; int d, t; char c; complex<double> v(0, 0); while (cin >> d >> c >> t) { if (!d && !t) break; auto next = ...
#include <complex> #include <cstdio> #include <iostream> using namespace std; const double PI = 3.141592653589793238462643383279502884L; int main(int argc, char **argv) { int degree = 90; int d, t; char c; complex<double> v(0, 0); while (cin >> d >> c >> t) { if (!d && !t) break; auto next = ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
135
4
#include <complex> #include <cstdio> #include <iostream> #define _USE_MATH_DEFFINES #include <cmath> using namespace std; typedef complex<double> P; double convert(double angle) { return ((M_PI * (angle / 180.0))); } P now(0, 0); double angle = 0; int main(void) { int fd, spin; while (scanf("%d,%d", &fd, &spin)...
#include <complex> #include <cstdio> #include <iostream> #define _USE_MATH_DEFFINES #include <cmath> using namespace std; typedef complex<double> P; double convert(double angle) { return ((M_PI * (angle / 180.0))); } P now(0, 0); double angle = 0; int main(void) { int fd, spin; while (scanf("%d,%d", &fd, &spin)...
[["-", 49, 50, 51, 16, 12, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 16, 12, 2, 63, 22]]
1
169
4
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int r, deg, theta; double x, y, rad; x = 0.0; y = 0.0; theta = 0; rad = M_PI / 180; do { scanf("%d, %d", &r, &deg); if (r == 0 && deg == 0) break; x += r * cos(theta * rad); y += r * sin(theta...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int r, deg, theta; double x, y, rad; x = 0.0; y = 0.0; theta = 0; rad = M_PI / 180; do { scanf("%d, %d", &r, &deg); if (r == 0 && deg == 0) break; x += r * cos(theta * rad); y += r * sin(theta...
[["-", 31, 16, 31, 16, 31, 16, 12, 74, 51, 22], ["+", 31, 16, 31, 16, 31, 16, 12, 74, 51, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 74, 51, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 74, 51, 22]]
1
128
4
#include <cmath> #include <iostream> using namespace std; int main() { double nx = 0, ny = 0, x, y, ro = 0; while (true) { cin >> x; cin.ignore(); cin >> y; if (x == 0 && y == 0) break; ny += x * sin(ro / 180 * M_PI); nx += x * cos(ro / 180 * M_PI); ro += y; // cout<<nx<<" "<<n...
#include <cmath> #include <iostream> using namespace std; int main() { double nx = 0, ny = 0, x, y, ro = 90; while (true) { cin >> x; cin.ignore(); cin >> y; if (x == 0 && y == 0) break; ny += x * sin(ro / 180 * M_PI); nx += x * cos(ro / 180 * M_PI); ro -= y; // if(ro<0)ro=360-...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]]
1
113
4
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> using namespace std; int main() { double x = 0, y = 0, a, b, now = 90; char c; while (cin >> a >> c >> b, a || b) { x += a * cos(M_PI * now / 180); y += a * sin(M_PI * now / 180); now = now - b; } if (x >= 0) x = floor(x); else ...
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> using namespace std; int main() { double x = 0, y = 0, a, b, now = 90; char c; while (cin >> a >> c >> b, a || b) { x += a * cos(M_PI * now / 180); y += a * sin(M_PI * now / 180); now = now - b; } if (x >= 0) x = floor(x); else ...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
150
6
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int>> vii; #define rrep(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define erep(i, m, n) for (int(i) = (m); (i) <= (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) <...
[["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106], ["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 25]]
1
842
4
#include <math.h> #include <stdio.h> #define pi 3.14159265358979 int main() { double teku[10000] = {0.0}, sita = pi / 2, set_sita[10000] = {0.0}, x = 0.0, y = 0.0; int i = 0; while (scanf("%lf,%lf", &teku[i], &set_sita[i]) != EOF) { if (teku[i] == 0 && set_sita[i] == 0) break; set_sita[i...
#include <math.h> #include <stdio.h> #define pi 3.14159265358979 int main() { double teku[10000] = {0.0}, sita = pi / 2, set_sita[10000] = {0.0}, x = 0.0, y = 0.0; int i = 0; while (scanf("%lf,%lf", &teku[i], &set_sita[i]) != EOF) { if (teku[i] == 0 && set_sita[i] == 0) break; set_sita[i...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]]
1
207
2
#include <iostream> #include <math.h> #include <stdio.h> #define PI 3.141592 using namespace std; int main() { int a, b; double x = 0, y = 0, dig = 0; while (scanf("%d,%d", &a, &b)) { if (a == 0 && b == 0) break; x += a * sin(dig * PI / 180.0); y += a * cos(dig * PI / 180.0); dig += b; } ...
#include <iostream> #include <math.h> #include <stdio.h> #define PI 3.141592 using namespace std; int main() { int a, b; double x = 0, y = 0, dig = 0; while (scanf("%d,%d", &a, &b)) { if (a == 0 && b == 0) break; x += a * sin(dig * PI / 180.0); y += a * cos(dig * PI / 180.0); dig += b; } ...
[["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
113
2
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { double PI = 4 * atan(1); int l, t1, t2 = 0, c = 0; double x = 0, y = 0; while (scanf("%d,%d", &l,...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { double PI = 4 * atan(1); int l, t1, t2 = 0, c = 0; double x = 0, y = 0; while (scanf("%d,%d", &l,...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
149
6
#include <iostream> #define _USE_MATH_DEFINES #include <cmath> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); double x = 0, y = 0; double m, d; char c; double next = 0; while (cin >> m >> c >> d && m != 0 && d != 0) { double rad = (90 - next) / 180.0 * M_PI; x += m *...
#include <iostream> #define _USE_MATH_DEFINES #include <cmath> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); double x = 0, y = 0; double m, d; char c; double next = 0; while (cin >> m >> c >> d && (m != 0 || d != 0)) { double rad = (90 - next) / 180.0 * M_PI; x += m...
[["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106], ["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 25]]
1
128
4
#include <cmath> #include <cstdio> #include <iostream> constexpr auto PI = 3.14159265358979323846264338; auto main() -> int { int d, t; double x = 0, y = 0; int angle = 0; while (std::scanf("%d,%d", &d, &t) == 2 && d && t) { x += d * std::sin(angle * PI / 180.0); y += d * std::cos(angle * PI / 180.0);...
#include <cmath> #include <cstdio> #include <iostream> constexpr auto PI = 3.14159265358979323846264338; auto main() -> int { int d, t; double x = 0, y = 0; int angle = 0; while (std::scanf("%d,%d", &d, &t) == 2 && (d || t)) { x += d * std::sin(angle * PI / 180.0); y += d * std::cos(angle * PI / 180.0...
[["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106], ["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 25]]
1
130
4
#include <iostream> using namespace std; int main() { string s, t, u; int n; char ch; cin >> n; for (int loop = 0; loop < n; loop++) { cin >> s >> t; // cout << "\ns=" << s << endl << "t=" << t << endl; if (s.length() > 80 || t.length() > 80) { cout << "overflow" << endl; conti...
#include <iostream> using namespace std; int main() { string s, t, u; int n; char ch; cin >> n; for (int loop = 0; loop < n; loop++) { cin >> s >> t; // cout << "\ns=" << s << endl << "t=" << t << endl; if (s.length() > 80 || t.length() > 80) { cout << "overflow" << endl; conti...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
267
2
#include <cmath> #include <iostream> #include <sstream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int p1[100], p2[100]; for (int i = 0; i < 100; i++) { p1[i] = 0; p2[i] = 0; } string a, b; cin >> a; cin >> b; if (a.size() > 80 || b.si...
#include <cmath> #include <iostream> #include <sstream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int p1[100], p2[100]; for (int i = 0; i < 100; i++) { p1[i] = 0; p2[i] = 0; } string a, b; cin >> a; cin >> b; if (a.size() > 80 || b.si...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
336
6
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <sstream> #include <stack> using namespace std; int main() { int t; scanf("%d", &t); for (int i = 0; i < t; i++) { string a; string b; cin >> a; cin >> b; string res; reverse(a.begin(), a.end()); rev...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <sstream> #include <stack> using namespace std; int main() { int t; scanf("%d", &t); for (int i = 0; i < t; i++) { string a; string b; cin >> a; cin >> b; string res; reverse(a.begin(), a.end()); rev...
[["-", 0, 1, 0, 11, 12, 41, 64, 5, 0, 6], ["+", 0, 1, 0, 11, 12, 41, 64, 5, 0, 6]]
1
388
2
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b, ans; cin >> a >> b; int as = a.size(), bs = b.size(), ms = (as > bs) ? as : bs, t = 0; for (int i = 0; i < ms; i++) { if (i < as && i < bs) { t = a[as - i - 1] + b[bs -...
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; while (n--) { string a, b, ans; cin >> a >> b; int as = a.size(), bs = b.size(), ms = (as > bs) ? as : bs, t = 0; for (int i = 0; i < ms; i++) { if (i < as && i < bs) { t = a[as - i - 1] + b[bs -...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
282
4
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctime> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int i, j, n, f; string s1, s2; cin >> n; while (n--) { cin >> s1 >> s2; f = 0; if (s1.size() < s2.size()) s...
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctime> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int i, j, n, f; string s1, s2; cin >> n; while (n--) { cin >> s1 >> s2; f = 0; if (s1.size() < s2.size()) s...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
241
2
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef complex<double> P; int main() { int t; cin >> t; while (t--) { string s, t; ...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef complex<double> P; int main() { int t; cin >> t; while (t--) { string s, t; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
296
2
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string a, b; vector<int> sum; int al, bl, sl; int n, up, num; cin >> n; for (int i = 0; i < n; ++i) { cin >> a >> b; al = a.size() - 1; bl = b.size() - 1; up = 0; while (al >= 0 || bl >= 0) { ...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string a, b; vector<int> sum; int al, bl, sl; int n, up, num; cin >> n; for (int i = 0; i < n; ++i) { cin >> a >> b; al = a.size() - 1; bl = b.size() - 1; up = 0; while (al >= 0 || bl >= 0) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
260
4
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define EPS (1e-10) using namespace std; #define PI (3.1415926535) int main() { string a, b; ...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define EPS (1e-10) using namespace std; #define PI (3.1415926535) int main() { string a, b; ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
399
2
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> #define MOJI 48 using namespace std; int multiple(string a, string b); char c[111111]; int main() { int n; string a, b; while (cin >> n) { for (int i = 0; i < n; i++) { cin >> a; cin >> b; int k =...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> #define MOJI 48 using namespace std; int multiple(string a, string b); char c[111111]; int main() { int n; string a, b; while (cin >> n) { for (int i = 0; i < n; i++) { cin >> a; cin >> b; int k =...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
399
2
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> //strlen #include <iostream> #include <stack> #include <vector> using namespace std; bool solve() { char str1[10000], str2[10000]; scanf("%s %s", str1, str2); int n1 = strlen(str1)...
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> //strlen #include <iostream> #include <stack> #include <vector> using namespace std; bool solve() { // なぜかわからないがstirngだと数字が大きいとSegmentation fault /* string str1,str2; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
307
2
#include <stdio.h> #include <string.h> int main() { int n, ans[100], kuri, i, j, ap, bp; char a[1000], b[1000]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s%s", a, b); if (strlen(a) > 80 || strlen(b) > 80) { printf("overflow\n"); continue; } ap = strlen(a) - 1; bp = strl...
#include <stdio.h> #include <string.h> int main() { int n, ans[100], kuri, i, j, ap, bp; char a[1000], b[1000]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s%s", a, b); if (strlen(a) > 80 || strlen(b) > 80) { printf("overflow\n"); continue; } ap = strlen(a) - 1; bp = strl...
[["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 109], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 132]]
1
282
2
#include <cstdio> #include <cstring> #define MAX_NUM 100 using namespace std; void array_add(int *a, int *b) { int i; for (i = MAX_NUM - 1; i > 0; i--) { a[i] = a[i] + b[i]; a[i - 1] = a[i - 1] + a[i] / 10; a[i] %= 10; } } int main(void) { int n, i, j, len1, len2, val1[MAX_NUM], val2[MAX_NUM]; ...
#include <cstdio> #include <cstring> #define MAX_NUM 32767 using namespace std; void array_add(int *a, int *b) { int i; for (i = MAX_NUM - 1; i > 0; i--) { a[i] = a[i] + b[i]; a[i - 1] = a[i - 1] + a[i] / 10; a[i] %= 10; } } int main(void) { int n, i, j, len1, len2, val1[MAX_NUM], val2[MAX_NUM]; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
444
2
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { string a; string b; int kari; cin >> kari; for (int o = 0; o < kari; o++) { int c[80] = {0}; int d[80] = {0}; int e[81] = {0}; int counter; cin >> a; cin >> b; if (a.size() > 80 || b.s...
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { string a; string b; int kari; cin >> kari; for (int o = 0; o < kari; o++) { int c[80] = {0}; int d[80] = {0}; int e[81] = {0}; int counter = 0; cin >> a; cin >> b; if (a.size() > 80 ||...
[["+", 0, 7, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 7, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117]]
1
358
4
#include <algorithm> #include <iostream> #include <string> using namespace std; char calc(char x, char y, char z, bool &C) { int a = x - '0', b = y - '0', c = z - '0'; int d = a + b + c; if (d >= 10) { C = true; d -= 10; } return d + '0'; } string sum(string a, string b) { string res = ""; r...
#include <algorithm> #include <iostream> #include <string> using namespace std; char calc(char x, char y, char z, bool &C) { int a = x - '0', b = y - '0', c = z - '0'; int d = a + b + c; if (d >= 10) { C = true; d -= 10; } return d + '0'; } string sum(string a, string b) { string res = ""; r...
[["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
472
5
#include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; while (n-- > 0) { string num1, num2; cin >> num1 >> num2; if (num1.size() > 80 || num2.size() > 80) { cout << "overflow" << endl; continue; } int sum[101];...
#include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; while (n-- > 0) { string num1, num2; cin >> num1 >> num2; if (num1.size() > 80 || num2.size() > 80) { cout << "overflow" << endl; continue; } int sum[101];...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
329
2
#include <algorithm> #include <iostream> #include <string> int main() { int n; std::cin >> n; for (int i = 0; i < n; i++) { std::string str, str2, res; std::cin >> str >> str2; std::reverse(str.begin(), str.end()); std::reverse(str2.begin(), str2.end()); bool up = 0; for (int i = 0; u...
#include <algorithm> #include <iostream> #include <string> int main() { int n; std::cin >> n; for (int i = 0; i < n; i++) { std::string str, str2, res; std::cin >> str >> str2; std::reverse(str.begin(), str.end()); std::reverse(str2.begin(), str2.end()); bool up = 0; for (int i = 0; u...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
283
2
n = gets.to_i n.times do a = gets.to_i b = gets.to_i if (10 ** 81) < (a + b) puts "overflow" else puts (a + b) end end
n = gets.to_i n.times do a = gets.to_i b = gets.to_i if (10 ** 80) <= (a + b) puts "overflow" else puts (a + b) end end
[["-", 0, 121, 15, 738, 31, 739, 0, 738, 12, 612], ["+", 0, 121, 15, 738, 31, 739, 0, 738, 12, 612], ["-", 196, 737, 8, 736, 0, 121, 15, 738, 17, 18], ["+", 196, 737, 8, 736, 0, 121, 15, 738, 17, 19]]
4
44
4
n = gets.to_i n.times do a = gets.to_i b = gets.to_i c = a + b c = c.to_s if c.length >= 80 puts 'overflow' else puts c end end
n = gets.to_i n.times do a = gets.to_i b = gets.to_i c = a + b c = c.to_s if c.length > 80 puts 'overflow' else puts c end end
[["-", 196, 737, 8, 736, 0, 121, 15, 738, 17, 20], ["+", 196, 737, 8, 736, 0, 121, 15, 738, 17, 47]]
4
44
2
gets.to_i.times do a = gets.chomp.split(//).reverse b = gets.chomp.split(//).reverse if (a.length > 80) || (b.length > 80) p 'overflow' else a.push(*Array.new(80 - a.length, 0)) b.push(*Array.new(80 - b.length, 0)) result = [] temp = 0 80.times do |i| result.unshift((a[i].to_i + b[...
gets.to_i.times do a = gets.chomp.split(//).reverse b = gets.chomp.split(//).reverse if (a.length > 80) || (b.length > 80) puts 'overflow' else a.push(*Array.new(80 - a.length, 0)) b.push(*Array.new(80 - b.length, 0)) result = [] temp = 0 80.times do |i| result.unshift((a[i].to_i +...
[["-", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 8, 736, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 75, 95, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 75, 95, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 75, 95, 0, 121, 75, 95, 0, 652, 735, 22], ["+", 75, 95, 0, 121, 75, 95, 0, 652, 735, 22]]
4
169
6