problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p00027
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int INF = 1e+9 * 2; double eps = 1e-10; string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"}; int main() { int m, d; while (cin >> m >> d && (m || d)) { int cnt = 0; for (int i = 1; i <= 12; +...
#include <bits/stdc++.h> using namespace std; const int INF = 1e+9 * 2; double eps = 1e-10; string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"}; int main() { int m, d; while (cin >> m >> d && (m || d)) { int cnt = 0; for (int i = 1; i <= 12; +...
replace
15
16
15
16
0
p00027
C++
Runtime Error
#include <iostream> using namespace std; int getDay(int y, int m, int d) { if (m < 3) m += 12, y--; int J = y / 100, K = y % 100; return (d + ((m + 1) * 26) / 10 + K + K / 4 + J / 4 - 2 * J) % 7; } int main() { string table[] = {"Saturday", "Sunday", "Monday", "Tuesday", "Wednesday",...
#include <iostream> using namespace std; int getDay(int y, int m, int d) { if (m < 3) m += 12, y--; int J = y / 100, K = y % 100; return (d + (((m + 1) * 26) / 10) + K + (K / 4) + (J / 4) + 5 * J) % 7; } int main() { string table[] = {"Saturday", "Sunday", "Monday", "Tuesday", "Wedne...
replace
7
8
7
8
0
p00027
C++
Runtime Error
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; int main() { ifstream cin("../test.txt"); int year[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string day[7] = {"Monday", "Tuesday", "Wednesday", "...
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; int main() { int year[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string day[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "F...
delete
10
12
10
10
-11
p00027
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; string a[7] = {"Monday",...
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; string a[7] = {"Monday",...
replace
26
27
26
27
0
p00027
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int m, d; string week[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while (cin >> m >> d) { if (m == 0) break; bool fl...
#include <bits/stdc++.h> using namespace std; int main() { int m, d; string week[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while (cin >> m >> d) { if (m == 0) break; bool fl...
replace
15
16
15
16
TLE
p00027
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { int k, m, d; string today[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while (cin >> m >> d) { if (m == 0) ...
#include <iostream> #include <string> using namespace std; int main() { int k, m, d; string today[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; int mon[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while (cin >> m >> d) { if (m == 0) ...
replace
18
19
18
19
TLE
p00027
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <vector> using namespace std; int main() { int M[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string w[7] = {"Wednesday", "Thursday", "Friday...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <vector> using namespace std; int main() { int M[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string w[7] = {"Wednesday", "Thursday", "Friday...
delete
25
26
25
25
0
1 60
p00028
C++
Time Limit Exceeded
#include <iostream> #include <map> using namespace std; void solve() { map<int, int> Map; int n; while (cin >> n, n) { ++Map[n]; } int Max = 0; for (map<int, int>::iterator Ite = Map.begin(); Ite != Map.end(); ++Ite) { if (Max < Ite->second) { Max = Ite->second; } } for (map<int, int...
#include <iostream> #include <map> using namespace std; void solve() { map<int, int> Map; int n; while (~scanf("%d", &n)) { ++Map[n]; } int Max = 0; for (map<int, int>::iterator Ite = Map.begin(); Ite != Map.end(); ++Ite) { if (Max < Ite->second) { Max = Ite->second; } } for (map<int...
replace
8
9
8
9
TLE
p00028
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n = 0, i, a[100], b[100] = {}; while (cin >> i) a[n++] = i; for (int i = 0; i < n; ++i) ++b[a[i]]; int max = 0; for (int i = 1; i <= 100; ++i) if (b[i] > max) max = b[i]; for (int i = 1; i <= 100; ++i) if (max == b[i]) ...
#include <iostream> using namespace std; int main(void) { int n = 0, i, a[100], b[101] = {}; while (cin >> i) a[n++] = i; for (int i = 0; i < n; ++i) ++b[a[i]]; int max = 0; for (int i = 1; i <= 100; ++i) if (b[i] > max) max = b[i]; for (int i = 1; i <= 100; ++i) if (max == b[i]) ...
replace
4
5
4
5
0
p00028
C++
Time Limit Exceeded
#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 <...
replace
49
50
49
50
TLE
p00028
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, max = 0, x[100] = {0}; int x_max; while (scanf("%d", &n)) { if (n == 0) { break; } x[n - 1]++; } for (int i = 0; i < 100; i++) { if (max < x[i]) { max = x[i]; x_max = i; } } cout << x_max + 1 << endl; ...
#include <iostream> using namespace std; int main() { int n, max = 0, x[100] = {0}; int x_max; while (scanf("%d", &n) != EOF) { x[n - 1]++; } for (int i = 0; i < 100; i++) { if (max < x[i]) { max = x[i]; x_max = i; } } cout << x_max + 1 << endl; for (int i = x_max + 1; i < 1...
replace
8
12
8
9
TLE
p00028
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { int a[100]; int b; b = 0; while (b < 100) { a[b] = 0; } int n; while (cin >> n) { a[n] = a[n] + 1; } int c; c = 0; b = 0; while (b < 100) { if (a[b] > c) { c = a[b]; } b = b + 1; } b = 0; whil...
#include <iostream> #include <string> using namespace std; int main() { int a[100]; int b; b = 0; while (b < 100) { a[b] = 0; b = b + 1; } int n; while (cin >> n) { a[n] = a[n] + 1; } int c; c = 0; b = 0; while (b < 100) { if (a[b] > c) { c = a[b]; } b = b + 1; } ...
insert
9
9
9
10
TLE
p00028
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, max = 0; int in[100] = {0}; while (cin >> n) { in[n]++; if (max < in[n]) max = in[n]; } for (int i = 1; i <= 100; i++) { if (max == in[i]) cout << i << endl; } return 0; }
#include <iostream> using namespace std; int main() { int n, max = 0; int in[100] = {0}; while (cin >> n) { in[n]++; if (max < in[n]) max = in[n]; } for (int i = 0; i < 100; i++) { if (max == in[i]) cout << i << endl; } return 0; }
replace
12
13
12
13
0
p00028
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { int x; vector<int> freq; int X[100] = {0}; while (cin >> x) { freq.push_back(x); } int maxf = 0; for (int i = 0; i < freq.size(); i++) { X[freq[i]]++; maxf = max(maxf, X[freq[i]]...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { int x; vector<int> freq; int X[120] = {0}; while (cin >> x) { freq.push_back(x); } int maxf = 0; for (int i = 0; i < freq.size(); i++) { X[freq[i]]++; maxf = max(maxf, X[freq[i]]...
replace
8
9
8
9
0
p00028
C++
Time Limit Exceeded
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long Int; #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; Int aa[120]; int main() { ...
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> typedef long long Int; #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; Int aa[120]; int main() { ...
replace
20
21
20
21
TLE
p00028
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
replace
48
49
48
49
TLE
p00028
C++
Time Limit Exceeded
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include ...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include ...
replace
31
32
31
32
TLE
p00028
C++
Runtime Error
#include <iostream> using namespace std; int main() { int ans[100] = {0}, i, n; int b = 0; while (cin >> n) { ans[n]++; if (ans[n] > b) { b = ans[n]; } } for (i = 1; i <= 100; i++) { if (b == ans[i]) { cout << i << endl; } } return 0; }
#include <iostream> using namespace std; int main() { int ans[101] = {0}, i, n; int b = 0; while (cin >> n) { ans[n]++; if (ans[n] > b) { b = ans[n]; } } for (i = 1; i <= 100; i++) { if (b == ans[i]) { cout << i << endl; } } return 0; }
replace
5
6
5
6
0
p00028
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define EPS 1e-10 using namespace std; typedef long long llong; int main...
#define _USE_MATH_DEFINES #include <algorithm> #include <cctype> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define EPS 1e-10 using namespace std; typedef long long llong; int main...
replace
25
26
25
26
0
p00029
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int i, i1, len, len1, check, max1, memo1, max2, memo2; max1 = 0; max2 = 0; memo1 = 0; memo2 = 0; string t; vector<string> s; vector<int> a, u; for (int h ...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int i, i1, len, len1, check, max1, memo1, max2, memo2; max1 = 0; max2 = 0; memo1 = 0; memo2 = 0; string t; vector<string> s; vector<int> a, u; for (int h ...
replace
41
42
41
42
TLE
p00029
C++
Runtime Error
#include <cmath> #include <cstdio> #include <iostream> #include <string.h> #include <string> #include <utility> using namespace std; int main() { string str; char word[35][35]; int x = 0, y = 0, i = 0, j, length = 0, maxl = 0, maxq[35], q, p = 0; maxq[0] = 0; getline(cin, str); while (1) { if (str[i] =...
#include <cmath> #include <cstdio> #include <iostream> #include <string.h> #include <string> #include <utility> using namespace std; int main() { string str; char word[1010][35]; int x = 0, y = 0, i = 0, j, length = 0, maxl = 0, maxq[35], q, p = 0; maxq[0] = 0; getline(cin, str); while (1) { if (str[i]...
replace
10
11
10
11
0
p00029
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { char a[1100] = {0}; scanf("%[^\n]", a); int cnt = 0; int mx = 0; int len[50] = {0}; string ans[50]; for (int i = 0, j = 0; i <= strlen(a); i++) { if ('a' <= a[i] && a[i] <=...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { char a[1100] = {0}; scanf("%[^\n]", a); int cnt = 0; int mx = 0; int len[1100] = {0}; string ans[1100]; for (int i = 0, j = 0; i <= strlen(a); i++) { if ('a' <= a[i] && a[i...
replace
11
13
11
13
0
p00030
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <stack> #include <string> #include <vector> using namespace std; int A[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int cunt = 0; void depth(int n, int s, int i) { if (n == 0 && s == 0) { cunt++; return; } else if ...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <stack> #include <string> #include <vector> using namespace std; int A[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int cunt = 0; void depth(int n, int s, int i) { if (n == 0 && s == 0) { cunt++; return; } else if ...
replace
25
27
25
27
-11
p00030
C++
Runtime Error
#include <algorithm> #include <cctype> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}...
#include <algorithm> #include <cctype> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}...
replace
25
28
25
31
-11
p00030
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #includ...
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #includ...
replace
40
41
40
41
TLE
p00030
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; int cnt_sum_s(int n, int k, int s, int tmp_sum) { if (n == 0) { return (tmp_sum == s) ? 1 : 0; } int res = 0; for (int i = k + 1; i < 10; i++) { res +...
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; int cnt_sum_s(int n, int k, int s, int tmp_sum) { if (n == 0) { return (tmp_sum == s) ? 1 : 0; } int res = 0; for (int i = k + 1; i < 10; i++) { res +...
replace
23
24
23
24
TLE
p00030
C++
Time Limit Exceeded
#include <iostream> using namespace std; int n, s; int recursion(int sum, int num, int cnt) { if (sum > s || cnt > n) return 0; if (cnt == n && sum == s) return 1; if (num > s) return 0; int hoge = 0; hoge += recursion(sum + num, num + 1, cnt + 1); hoge += recursion(sum, num + 1, cnt); retur...
#include <iostream> using namespace std; int n, s; int recursion(int sum, int num, int cnt) { if (sum > s || cnt > n) return 0; if (cnt == n && sum == s) return 1; if (num > 9) return 0; int hoge = 0; hoge += recursion(sum + num, num + 1, cnt + 1); hoge += recursion(sum, num + 1, cnt); retur...
replace
10
11
10
11
TLE
p00030
C++
Time Limit Exceeded
#include <iostream> using namespace std; int a; int f(int n, int s, int i) { if (n == 1 && i >= s && s >= 0) { a++; return 0; } if (s <= 0) return 0; for (int j = i; j >= n - 1; j--) f(n - 1, s - j, j - 1); } int main() { int n, s; while (cin >> n >> s) { a = 0; if (n == 0 && s == 0...
#include <iostream> using namespace std; int a; int f(int n, int s, int i) { if (n == 1 && i >= s && s >= 0) { a++; return 0; } if (s <= 0 || s >= i * n) return 0; for (int j = i; j >= n - 1; j--) f(n - 1, s - j, j - 1); } int main() { int n, s; while (cin >> n >> s) { a = 0; if (n ...
replace
9
10
9
10
TLE
p00030
C++
Time Limit Exceeded
#include <cstring> #include <iostream> #include <vector> using namespace std; int n, s, *num, pattern; void search(int th) { if (th == n) { int sum = 0; for (int i = 0; i < n; i++) sum += num[i]; if (s == sum) { for (int j = 0; j + 1 < n; j++) if (num[j] >= num[j + 1]) retu...
#include <cstring> #include <iostream> #include <vector> using namespace std; int n, s, *num, pattern; void search(int th) { if (th == n) { int sum = 0; for (int i = 0; i < n; i++) sum += num[i]; if (s == sum) { for (int j = 0; j + 1 < n; j++) if (num[j] >= num[j + 1]) retu...
replace
24
25
24
28
TLE
p00030
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
insert
39
39
39
41
TLE
p00030
C++
Runtime Error
#include <stdio.h> #include <string.h> int dp[20][55][20]; int cnt_sum(int n, int s, int x) { if (dp[n][s][x] != -1) { return dp[n][s][x]; } if (n == 0 && s == 0) { return (1); } if (x > 9) { return (0); } return dp[n][s][x] = (cnt_sum(n - 1, s - x, x + 1) + cnt_sum(n, s, x + 1)); } int mai...
#include <stdio.h> #include <string.h> int dp[20][55][20]; int cnt_sum(int n, int s, int x) { if (n < 0 || s < 0) { return 0; } if (dp[n][s][x] != -1) { return dp[n][s][x]; } if (n == 0 && s == 0) { return (1); } if (x > 9) { return (0); } return dp[n][s][x] = (cnt_sum(n - 1, s - x,...
insert
6
6
6
9
0
p00030
C++
Runtime Error
#include <stdio.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) int dp[16][64]; int main() { dp[0][0] = 1; rep(k, 10) { for (int i = 10; i >= 0; i--) { rep(j, 64) if (dp[i][j]) dp[i + 1][j + k] += dp[i][j]; } } for (;;) { int n, s; scanf("%d%d", &n, &s); if (n == 0 && s == 0)...
#include <stdio.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) int dp[16][64]; int main() { dp[0][0] = 1; rep(k, 10) { for (int i = 10; i >= 0; i--) { rep(j, 64) if (dp[i][j]) dp[i + 1][j + k] += dp[i][j]; } } for (;;) { int n, s; scanf("%d%d", &n, &s); if (n == 0 && s == 0)...
replace
17
18
17
18
0
p00030
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #include <iomanip> #include <iostream> #include <list> #include <math.h> #include <stack> #include <string> using namespace std; int n = 0; int s = 0; static int ans; void check(int atai, int num, int count) { if (num > s || atai > s) { if (count == n && atai == s) { ans+...
#define _CRT_SECURE_NO_WARNINGS #include <iomanip> #include <iostream> #include <list> #include <math.h> #include <stack> #include <string> using namespace std; int n = 0; int s = 0; static int ans; void check(int atai, int num, int count) { if (num > 9) { if (atai == s && count == n) { ans++; } ...
replace
16
18
16
18
TLE
p00030
C++
Runtime Error
#include <iostream> using namespace std; int dp[11][46] = {0}; int main() { dp[0][0] = 1; for (int k = 0; k < 10; k++) { for (int i = k; i >= 0; i--) for (int j = 0; j < 46 - k; j++) { dp[i + 1][j + k] += dp[i][j]; } } int N, S; while (cin >> N >> S, N || S) { cout << dp[N][S] <...
#include <iostream> using namespace std; int dp[11][46] = {0}; int main() { dp[0][0] = 1; for (int k = 0; k < 10; k++) { for (int i = k; i >= 0; i--) for (int j = 0; j < 46 - k; j++) { dp[i + 1][j + k] += dp[i][j]; } } int N, S; while (cin >> N >> S, N || S) { if (0 <= N && N < ...
replace
16
17
16
21
0
p00030
C++
Time Limit Exceeded
#include <iostream> using namespace std; int n, s; int dfs(int i, int c, int sum) { int res = 0; if (c + 10 - i < n || s < sum) return 0; if (c == n && sum == s) return 1; res += dfs(i + 1, c, sum); res += dfs(i + 1, c + 1, sum + i); return res; } int main() { while (cin >> n >> s, n || s) c...
#include <iostream> using namespace std; int n, s; int dfs(int i, int c, int sum) { int res = 0; if (n < c || c + 10 - i < n || s < sum) return 0; if (c == n && sum == s) return 1; res += dfs(i + 1, c, sum); res += dfs(i + 1, c + 1, sum + i); return res; } int main() { while (cin >> n >> s, n ||...
replace
7
8
7
8
TLE
p00030
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, s, j, k; int a[11][46]; for (int s = 0; s < 46; s++) for (int n = 0; n < 11; n++) a[n][s] = 0; n = s = 0; for (int i = 0; i < 1024; i++) { for (j = i, n = 0; j > 0; j /= 2) n += j % 2; for (j = i, s = 0, k = 0; j > 0; j /= 2,...
#include <iostream> using namespace std; int main() { int n, s, j, k; int a[11][46]; for (int s = 0; s < 46; s++) for (int n = 0; n < 11; n++) a[n][s] = 0; n = s = 0; for (int i = 0; i < 1024; i++) { for (j = i, n = 0; j > 0; j /= 2) n += j % 2; for (j = i, s = 0, k = 0; j > 0; j /= 2,...
replace
20
21
20
24
0
p00031
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int weight[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; int gram; vector<int> ans; while (cin >> gram) { for (int i = 9; i >= 0; i--) { if (gram >= weight[i]) { ans.push_back(i); gram -= weight[i]; } } ...
#include <iostream> #include <vector> using namespace std; int main() { int weight[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; int gram; vector<int> ans; while (cin >> gram) { for (int i = 9; i >= 0; i--) { if (gram >= weight[i]) { ans.push_back(i); gram -= weight[i]; } } ...
replace
17
18
17
18
-11
p00031
C++
Runtime Error
#include <stdio.h> #include <string.h> int main(void) { char line[80]; int w; int f[10]; int u[10]; int k = 512; for (int &d : f) { d = k; k >>= 1; } while (true) { if (fgets(line, sizeof line, stdin) == NULL) { break; } if (sscanf(line, "%d", &w) != 1) { break; ...
#include <stdio.h> #include <string.h> int main(void) { char line[80]; int w; int f[10]; int u[10]; int k = 512; for (int &d : f) { d = k; k >>= 1; } while (true) { if (fgets(line, sizeof line, stdin) == NULL) { break; } if (sscanf(line, "%d", &w) != 1) { break; ...
replace
27
28
27
28
0
p00031
C++
Time Limit Exceeded
#include <cstdio> int main() { int n, s; while (scanf("%d", &n)) { for (s = 1; n; s *= 2) { n &s &&printf("%d%c", s, n - s ? 32 : 10); n -= n & s; } } }
#include <cstdio> int main() { int n, s; while (scanf("%d", &n) + 1) { for (s = 1; n; s *= 2) { n &s &&printf("%d%c", s, n - s ? 32 : 10); n -= n & s; } } }
replace
3
4
3
4
TLE
p00031
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int w; while (cin >> w) { bool flag = 0; for (int i = 1; w >= 0; i *= 2) { if (w % 2 > 0) { if (flag) { cout << ' '; } cout << i; flag = 1; w--; } w /= 2; } cout << endl; } r...
#include <iostream> using namespace std; int main() { int w; while (cin >> w) { bool flag = 0; for (int i = 1; w > 0; i *= 2) { if (w % 2 > 0) { if (flag) { cout << ' '; } cout << i; flag = 1; w--; } w /= 2; } cout << endl; } re...
replace
6
7
6
7
TLE
p00031
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { int n; while (cin...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { int n; while (cin...
delete
20
21
20
20
0
5 7 127
p00031
Python
Runtime Error
while True: g = int(input()) now = 512 ans = [] while True: if g == 0: break elif g >= now: g -= now ans.append(now) now //= 2 temp = "" for i in ans[::-1]: temp += str(i) + " " print(temp[:-1])
import sys for line in sys.stdin: g = int(line) now = 512 ans = [] while True: if g == 0: break elif g >= now: g -= now ans.append(now) now //= 2 temp = "" for i in ans[::-1]: temp += str(i) + " " print(temp[:-1])
replace
0
2
0
4
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00031/Python/s012591157.py", line 2, in <module> g = int(input()) EOFError: EOF when reading a line
p00032
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <algorithm> #include <cfloat> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { int x = 0, y = 0; int a, b, c; char ...
#define _USE_MATH_DEFINES #include <algorithm> #include <cfloat> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { int x = 0, y = 0; int a, b, c; char ...
replace
19
20
19
20
TLE
p00032
C++
Time Limit Exceeded
#include <stdio.h> int main() { int l1, l2, dia, rc, lc; rc = lc = 0; while (scanf("%d %d %d", &l1, &l2, &dia) != EOF) { if (l1 * l1 + l2 * l2 == dia * dia) { rc++; } if (l1 == l2) { lc++; } } printf("%d\n%d\n", rc, lc); return 0; }
#include <stdio.h> int main() { int l1, l2, dia, rc, lc; rc = lc = 0; while (scanf("%d,%d,%d", &l1, &l2, &dia) != EOF) { if (l1 * l1 + l2 * l2 == dia * dia) { rc++; } if (l1 == l2) { lc++; } } printf("%d\n%d\n", rc, lc); return 0; }
replace
5
6
5
6
TLE
p00032
C++
Time Limit Exceeded
#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() { int a, b, c, t = 0, h = 0; while (scanf("%d,%d,%d", &a, &b, &c)) { if (a * a + b * b == c * c) { ...
#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() { int a, b, c, t = 0, h = 0; while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { if (a * a + b * b == c ...
replace
14
15
14
15
TLE
p00032
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int main() { int n, m, d, r = 0, l = 0; char c; while (cin >> n >> c >> m >> c >> d, n) { if (n == m) l++; if (n * n + m * m == d * d) r++; } cout << r << endl << l << endl; return 0; }
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int main() { int n, m, d, r = 0, l = 0; char c; while (cin >> n >> c >> m >> c >> d) { if (n == m) l++; if (n * n + m * m == d * d) r++; } cout << r << endl << l << endl; return 0; }
replace
8
9
8
9
TLE
p00032
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int, int> pii; #define REP(i, n) for (ll i = 0; i < n; ++i) #define REPR(i, n) for (ll i = 1; i < n; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int, int> pii; #define REP(i, n) for (ll i = 0; i < n; ++i) #define REPR(i, n) for (ll i = 1; i < n; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ...
replace
27
28
27
28
TLE
p00032
C++
Time Limit Exceeded
#define scanf_s scanf // #define gets_s gets #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; #define MAX 10 #define MIN -100001 #define _MAX 10 int main(void) { int a, b, c, s = 0, h = 0; while (scanf_s("%d,%d,%d", &a, &b, &c)) { if (a == b) ++h; else if...
#define scanf_s scanf // #define gets_s gets #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; #define MAX 10 #define MIN -100001 #define _MAX 10 int main(void) { int a, b, c, s = 0, h = 0; while (scanf_s("%d,%d,%d", &a, &b, &c) != EOF) { if (a == b) ++h; ...
replace
12
13
12
13
TLE
p00032
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; int main() { int ans_a = 0, ans_b = 0; for (;;) { int a, b, c; scanf("%d,%d,%d", &a, &b, &c); if (a * a + b * b == c * c) { ans_a++; } if (a == b) { ans_b++; } } cout << ans_a << endl << ans_b << endl; return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { int ans_a = 0, ans_b = 0; for (;;) { int a, b, c; if (scanf("%d,%d,%d", &a, &b, &c) == EOF) { break; } if (a * a + b * b == c * c) { ans_a++; } if (a == b) { ans_b++; } } cout << ans_a << endl <...
replace
7
8
7
10
TLE
p00032
C++
Time Limit Exceeded
#include <cstdio> using namespace std; int main() { int side[3]; int iso = 0, cho = 0; while (scanf("%d,%d,%d", &side[0], &side[1], &side[2])) { if (side[0] == side[1]) iso++; else if ((side[0] * side[0]) + (side[1] * side[1]) == (side[2] * side[2])) cho++; } printf("%d\n", cho); print...
#include <cstdio> using namespace std; int main() { int side[3]; int iso = 0, cho = 0; while (scanf("%d,%d,%d", &side[0], &side[1], &side[2]) != EOF) { if (side[0] == side[1]) iso++; else if ((side[0] * side[0]) + (side[1] * side[1]) == (side[2] * side[2])) cho++; } printf("%d\n", cho); ...
replace
7
8
7
8
TLE
p00032
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int a, b, c, sum1, sum2; sum1 = 0; sum2 = 0; while (scanf("%d,%d,%d", &a, &b, &c)) { if (a * a + b * b == c * c) { sum1 += 1; } if (a == b) { ...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int a, b, c, sum1, sum2; sum1 = 0; sum2 = 0; while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { if (a * a + b * b == c * c) { sum1 += 1; } if (a == b)...
replace
11
12
11
12
TLE
p00032
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> #define p(n) pow(n, 2) using namespace std; int main() { int a, b, c, rhom = 0, rect = 0; while (scanf("%d,%d,%d", &a, &b, &c)) { if (p(a) + p(b) == p(c)) rect++; if (a == b...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> #define p(n) pow(n, 2) using namespace std; int main() { int a, b, c, rhom = 0, rect = 0; while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { if (p(a) + p(b) == p(c)) rect++; if ...
replace
11
12
11
12
TLE
p00032
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c; int t = 0, h = 0; while (scanf("%d,%d,%d", &a, &b, &c)) { // if(a==0)break; if (a == b) h++; if (c * c == a * a + b * b) t++; } cout << t << endl << h << endl; }
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, c; int t = 0, h = 0; while (scanf("%d,%d,%d", &a, &b, &c) + 1) { // if(a==0)break; if (a == b) h++; if (c * c == a * a + b * b) t++; } cout << t << endl << h << endl; }
replace
6
7
6
7
TLE
p00032
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int main(void) { int a, b, c; int x = 0, y = 0; while (scanf("%d,%d,%d", &a, &b, &c)) { if (a * a + b * b == c * c) { x++; // cout<<a<<b<<c<<endl; } if (a == b) { y++...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int main(void) { int a, b, c; int x = 0, y = 0; while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { if (a * a + b * b == c * c) { x++; // cout<<a<<b<<c<<endl; } if (a == b) { ...
replace
10
11
10
11
TLE
p00033
C++
Runtime Error
#include <cstdio> #define N 10 int D, Ball[N]; int R, L; bool solve(int i) { if (i == N) return true; if (R < Ball[i]) { R = Ball[i]; if (solve(i + 1)) return true; } if (L < Ball[i]) { L = Ball[i]; if (solve(i + 1)) return true; } return false; } int main() { scanf("%d...
#include <cstdio> #define N 10 int D, Ball[N]; int R, L; bool solve(int i) { if (i == N) return true; if (R < Ball[i]) { R = Ball[i]; if (solve(i + 1)) return true; } if (L < Ball[i]) { L = Ball[i]; if (solve(i + 1)) return true; } return false; } int main() { scanf("%d...
replace
24
25
24
25
-11
p00034
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int l[10], v1, v2; int len; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", l, &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2)) { len = 0; for (int i = 0; i < 10; i++) { len += l[i]; } do...
#include <bits/stdc++.h> using namespace std; int main() { int l[10], v1, v2; int len; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", l, &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2) != EOF) { len = 0; for (int i = 0; i < 10; i++) { len += l[i]; }...
replace
8
9
8
9
TLE
p00034
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { vector<int> l(10); v...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { vector<int> l(10); v...
replace
21
22
21
23
TLE
p00034
C++
Time Limit Exceeded
#include <iostream> using namespace std; int data[11]; int sum = 0; bool input() { fill(data, data + 11, 0); char c; int x; for (int i = 1; i <= 10; i++) { cin >> x; cin >> c; data[i] = data[i - 1] + x; } return true; } int main() { while (input()) { int v1, v2; char c; cin >> v1...
#include <iostream> using namespace std; int data[11]; int sum = 0; bool input() { fill(data, data + 11, 0); char c; int x; for (int i = 1; i <= 10; i++) { if (!(cin >> x)) return false; cin >> c; data[i] = data[i - 1] + x; } return true; } int main() { while (input()) { int v1, v2...
replace
11
12
11
13
TLE
p00034
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> using namespace std; int main() { int dis[10], v1, v2; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &dis[0], &dis[1], &dis[2], &dis[3], &dis[4], &dis[5], &dis[6], &dis[7], &dis[8], &dis[9], &v1, &v2)) { int sum = 0; for (int i = 0; ...
#include <iostream> #include <stdio.h> using namespace std; int main() { int dis[10], v1, v2; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &dis[0], &dis[1], &dis[2], &dis[3], &dis[4], &dis[5], &dis[6], &dis[7], &dis[8], &dis[9], &v1, &v2) != EOF) { int sum = 0; for (int ...
replace
7
8
7
8
TLE
p00034
C++
Time Limit Exceeded
#include <algorithm> #include <stdio.h> using namespace std; int pow(int a, int n) { if (n <= 0) { return 1; } return a * pow(a, n - 1); } int main() { int v1, v2; int a[10]; int sum1; int sum2; int ans = 0; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], ...
#include <algorithm> #include <stdio.h> using namespace std; int pow(int a, int n) { if (n <= 0) { return 1; } return a * pow(a, n - 1); } int main() { int v1, v2; int a[10]; int sum1; int sum2; int ans = 0; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], ...
replace
19
20
19
20
TLE
p00034
C++
Time Limit Exceeded
#include <ctype.h> #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; int main() { double b[10]; double v1, v2; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &b[0], &b[1], &b[2], &b[3], &b[4], &b[5], &b[6], &b[7], &b[8], &b[9], &v1, ...
#include <ctype.h> #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; int main() { double b[10]; double v1, v2; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &b[0], &b[1], &b[2], &b[3], &b[4], &b[5], &b[6], &b[7], &b[8], &b[9], &v1, ...
replace
14
15
14
15
TLE
p00034
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; int main(void) { double line[10]; double v1, v2; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &line[0], &line[1], &line[2], &line[3], &line[4], &line[5], &line[6], &line[7], &line[8], &line[9], &v1, &v2)...
#include <cstdio> #include <iostream> using namespace std; int main(void) { double line[10]; double v1, v2; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &line[0], &line[1], &line[2], &line[3], &line[4], &line[5], &line[6], &line[7], &line[8], &line[9], &v1, &v2)...
replace
11
12
11
12
TLE
p00034
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <numeric> using namespace std; int main() { int l[10], v1, v2, ret; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2)) { int sum = accumulate(l, l + 10, 0), k = 0; ...
#include <algorithm> #include <cstdio> #include <numeric> using namespace std; int main() { int l[10], v1, v2, ret; while (~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l[0], &l[1], &l[2], &l[3], &l[4], &l[5], &l[6], &l[7], &l[8], &l[9], &v1, &v2)) { int sum = accumulate(l, l + 10, 0), k = 0; ...
replace
6
8
6
8
TLE
p00034
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int dis[10], v_0 = 0, v_1 = 0; while (scanf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", &dis[0], &dis[1], &dis[2], &dis[3], &dis[4], &dis[5], &dis[6], &dis[7], &dis[8], &dis[9], &v_0, &v_1))...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int dis[10], v_0 = 0, v_1 = 0; while (scanf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", &dis[0], &dis[1], &dis[2], &dis[3], &dis[4], &dis[5], &dis[6], &dis[7], &dis[8], &dis[9], &v_0, &v_1) ...
replace
9
10
9
10
TLE
p00034
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define pb push_back #define mp make_pair #def...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define pb push_back #define mp make_pair #def...
replace
28
29
28
29
TLE
p00035
C++
Runtime Error
#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) <...
replace
129
132
129
136
0
(0,0) (1,0) (1,1) (0,1) (0,0) (3,0) (1,1) (1,3)
p00035
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> using namespace std; // ------ Classes ------ // class Point { public: long double px, py; Point() : px(0), py(0){}; Point(long double px_, long double py_) : px(px_), py(py_){}; friend bool operator==(const Point &p1, const Point &p2) { return p1.px...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; // ------ Classes ------ // class Point { public: long double px, py; Point() : px(0), py(0){}; Point(long double px_, long double py_) : px(px_), py(py_){}; friend bool operator==(const Point &p1, const Point &p2) { return p1.px...
replace
101
103
101
103
-11
p00035
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; typedef pair<double, double> P; double Helon(P pa, P pb, P pc) { double a, b, c; a = sqrt((pb.first - pa.first) * (pb.first - pa.first) + (pb.second - pa.second) * (pb.second - pa.second)); b = sqrt((pc.f...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; typedef pair<double, double> P; double Helon(P pa, P pb, P pc) { double a, b, c; a = sqrt((pb.first - pa.first) * (pb.first - pa.first) + (pb.second - pa.second) * (pb.second - pa.second)); b = sqrt((pc.f...
replace
22
26
22
25
TLE
p00035
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { double xa, ya, xb, yb, xc, yc, xd, yd, s1, s2, s3, s4; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd)) { s1 =...
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { double xa, ya, xb, yb, xc, yc, xd, yd, s1, s2, s3, s4; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF) { ...
replace
10
11
10
11
TLE
p00035
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
replace
57
59
57
59
TLE
p00035
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <iostream> using namespace std; //??´???AB????§?????????´???BC????§??????????RotType????¨????(A???B???C????????§??????) // RotType = ????????¢1, ????????¢-1, ??´???0 int getRotType(double angle_a, double angle_b) { const int eps = 1e-8; const double PAI = 3.1415926535897...
#include <cmath> #include <cstdio> #include <iostream> using namespace std; //??´???AB????§?????????´???BC????§??????????RotType????¨????(A???B???C????????§??????) // RotType = ????????¢1, ????????¢-1, ??´???0 int getRotType(double angle_a, double angle_b) { const int eps = 1e-8; const double PAI = 3.1415926535897...
replace
26
27
26
27
TLE
p00035
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> using namespace std; bool check(double X1, double Y1, double X2, double Y2, double X3, double Y3, double X4, double Y4) { return ((X1 - X2) * (Y3 - Y1) - (Y1 - Y2) * (X3 - X1)) * ((X1 - X2) * (Y4 - Y1) - (Y1 - Y2) * (X4 - X1)) > 0.0; } void so...
#include <iostream> #include <stdio.h> using namespace std; bool check(double X1, double Y1, double X2, double Y2, double X3, double Y3, double X4, double Y4) { return ((X1 - X2) * (Y3 - Y1) - (Y1 - Y2) * (X3 - X1)) * ((X1 - X2) * (Y4 - Y1) - (Y1 - Y2) * (X4 - X1)) > 0.0; } void so...
replace
14
16
14
16
TLE
p00036
C++
Time Limit Exceeded
#include <array> #include <iostream> #include <sstream> #include <string> #include <vector> #define _X_ 0 #define _Y_ 1 int main() { while (true) { std::vector<std::array<int, 2>> p; p.reserve(4); for (int i = 0; i < 8; i++) { std::string temp; std::cin >> temp; std::stringstream st(temp...
#include <array> #include <iostream> #include <sstream> #include <string> #include <vector> #define _X_ 0 #define _Y_ 1 int main() { while (true) { std::vector<std::array<int, 2>> p; p.reserve(4); for (int i = 0; i < 8; i++) { std::string temp; std::cin >> temp; std::stringstream st(temp...
insert
23
23
23
26
TLE
p00036
C++
Time Limit Exceeded
#include <cstdio> #include <cstring> int main() { char p[7][19] = { "1100000011", "10000000100000001", "1111", "1000000110000001", "11000000011", "100000001100000001", "110000011"}; char f[65]; char t; while (1 + scanf("%c", &t)) { while (t == 10) { scanf("%c", &t); } f[0] =...
#include <cstdio> #include <cstring> int main() { char p[7][19] = { "1100000011", "10000000100000001", "1111", "1000000110000001", "11000000011", "100000001100000001", "110000011"}; char f[65]; char t; while (1 + scanf("%c", &t)) { while (t == 10) { scanf("%c", &t); } f[0] =...
insert
27
27
27
28
TLE
p00036
C++
Runtime Error
#include <iomanip> #include <iostream> #include <vector> using namespace std; vector<string> f; const string P[7][4] = { {// A "1100", "1100", "0000", "0000"}, {// B "1000", "1000", "1000", "1000"}, {// C "1111", "0000", "0000", "0000"}, {// D "0100", "1100", "1000", "0000"}, {...
#include <iomanip> #include <iostream> #include <vector> using namespace std; vector<string> f; const string P[7][4] = { {// A "1100", "1100", "0000", "0000"}, {// B "1000", "1000", "1000", "1000"}, {// C "1111", "0000", "0000", "0000"}, {// D "0100", "1100", "1000", "0000"}, {...
replace
30
31
30
31
0
p00036
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> #define X first #define Y second #define WIDTH 8 #define HEIGHT 8 using namespace std; vector<string> init() { vector<string> map; fo...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> #define X first #define Y second #define WIDTH 8 #define HEIGHT 8 using namespace std; vector<string> init() { vector<string> map; fo...
insert
68
68
68
70
TLE
p00036
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <iterator> #include <map> #include <queue> #include <stack> #include <string> #include <vector> typedef long long int lli; using namespace std; int dx[7][4] = {{0, 0, 1, 1}, {0, 0, 0, 0}, {0, 1, 2, 3}, {0, 0, -1, -1}, ...
#include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <iterator> #include <map> #include <queue> #include <stack> #include <string> #include <vector> typedef long long int lli; using namespace std; int dx[7][4] = {{0, 0, 1, 1}, {0, 0, 0, 0}, {0, 1, 2, 3}, {0, 0, -1, -1}, ...
replace
23
25
23
25
TLE
p00036
C++
Runtime Error
// A Figure on Surface #include <iostream> #include <string> using namespace std; int main(void) { const int N = 8; while (1) { string a[N]; int i, j; for (i = 0; i < N; i++) { cin >> a[i]; } if (!cin) break; // ¶ã‚©‚ç‚̍À•W‚𒲂ׂé for (i = 0; i < N; i++) { for (j...
// A Figure on Surface #include <iostream> #include <string> using namespace std; int main(void) { const int N = 8; while (1) { string a[N]; int i, j; for (i = 0; i < N; i++) { cin >> a[i]; } if (!cin) break; // ¶ã‚©‚ç‚̍À•W‚𒲂ׂé for (i = 0; i < N; i++) { for (j...
replace
26
28
26
28
0
p00036
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { while (true) { int i = 0; string map[8]; while (cin >> map[i], !cin.eof()) { i++; if (i == 8) { break; } } if (cin.eof()) { break; } for (int i = 0; i < 8; i++) { for (int j = 0; ...
#include <iostream> #include <string> using namespace std; int main() { while (true) { int i = 0; string map[8]; while (cin >> map[i], !cin.eof()) { i++; if (i == 8) { break; } } if (cin.eof()) { break; } for (int i = 0; i < 8; i++) { for (int j = 0; ...
replace
19
40
19
60
0
p00036
C++
Time Limit Exceeded
#include <iostream> using namespace std; char m[8][8]; void figure(int, int); int main() { while (1) { bool f = true; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cin >> m[i][j]; } } for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (m[i...
#include <iostream> using namespace std; char m[8][8]; void figure(int, int); int main() { while (1) { bool f = true; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cin >> m[i][j]; if (cin.eof()) { return 0; } } } for (int i = 0; i < 8; i++...
insert
13
13
13
16
TLE
p00037
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; class Dot { public: bool d[4]; Dot() { d[0] = d[1] = d[2] = d[3] = false; } }; int main() { Dot data[5][5]; for (int i = 0; i < 9; i++) { string str; getline(cin, str); int y = i / 2; if (i % 2 == 0) { for (int j = 0; j < 4; j++)...
#include <iostream> #include <string> using namespace std; class Dot { public: bool d[4]; Dot() { d[0] = d[1] = d[2] = d[3] = false; } }; int main() { Dot data[5][5]; for (int i = 0; i < 9; i++) { string str; getline(cin, str); int y = i / 2; if (i % 2 == 0) { for (int j = 0; j < 4; j++)...
replace
36
37
36
37
TLE
p00037
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> #include <string> using namespace std; string str[100]; int len; int fie[101][101]; int m; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; char s[4] = {'R', 'D', 'L', 'U'}; int main(void) { int n = 9; for (int i = 0; i < 10; i++) cin >> str[i]; m = str[0].size(); ...
#include <cstdio> #include <iostream> #include <string> using namespace std; string str[100]; int len; int fie[101][101]; int m; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; char s[4] = {'R', 'D', 'L', 'U'}; int main(void) { int n = 9; for (int i = 0; i < 10; i++) cin >> str[i]; m = str[0].size(); ...
replace
43
44
43
48
TLE
p00037
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; vector<string> strs; int H, W; bool isroad(int fx, int fy, int tx, int ty) { int fromx, fromy, tox, toy; fromx = min(fx, tx); fromy = min(fy, ty); tox = max(fx, tx); toy = max(fy, ty); if (fromx < 1 || tox < 1 |...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; vector<string> strs; int H, W; bool isroad(int fx, int fy, int tx, int ty) { int fromx, fromy, tox, toy; fromx = min(fx, tx); fromy = min(fy, ty); tox = max(fx, tx); toy = max(fy, ty); if (fromx < 1 || tox < 1 |...
replace
41
42
41
42
TLE
p00037
C++
Runtime Error
#include <stdio.h> int f[5][5], i, j, a, y, x, p; int main() { for (; i < 9; ++i) { char s[6]; scanf("%s", s); for (j = 0; j < 4 + i % 2; ++j) { a = s[j] - 48; f[i / 2][j] |= a << (1 + i % 2); f[i / 2 + i % 2][j + !(i % 2)] |= a << 3 - i % 2 * 3; } } do { do p = (p + 1)...
#include <stdio.h> int f[5][5], i, j, a, y, x, p; int main() { for (; i < 9; ++i) { char s[6]; scanf("%s", s); for (j = 0; j < 4 + i % 2; ++j) { a = s[j] - 48; f[i / 2][j] |= a << (1 + i % 2); f[i / 2 + i % 2][j + !(i % 2)] |= a << 3 - i % 2 * 3; } } do { do p = (p + 1)...
replace
21
22
21
22
1
p00037
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, -1, 0, 1}; const char ch[] = {"ULDR"}; bool g[10][10][10][10]; int main() { char c; for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 4; j++) { scanf(" %c", &c); if (c == '0') continue; ...
#include <bits/stdc++.h> using namespace std; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, -1, 0, 1}; const char ch[] = {"ULDR"}; bool g[10][10][10][10]; int main() { char c; for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 4; j++) { scanf(" %c", &c); if (c == '0') continue; ...
replace
37
38
37
38
TLE
p00037
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define DEBUG(x) cerr << #x << " = " << x << endl int main() { static bool wall[6][6][4]; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; REP(i...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define DEBUG(x) cerr << #x << " = " << x << endl int main() { static bool wall[6][6][4]; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; REP(i...
replace
56
57
56
57
0
X = 1, Y = 0, dir = 0 X = 2, Y = 0, dir = 0 X = 3, Y = 0, dir = 0 X = 4, Y = 0, dir = 0 X = 5, Y = 1, dir = 1 X = 5, Y = 2, dir = 1 X = 5, Y = 3, dir = 1 X = 5, Y = 4, dir = 1 X = 4, Y = 5, dir = 2 X = 3, Y = 5, dir = 2 X = 2, Y = 5, dir = 2 X = 1, Y = 4, dir = 3 X = 1, Y = 3, dir = 3 X = 1, Y = 2, dir = 3 X = 2, Y = 1...
p00037
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, a) FOR(i, 0, a) int maze[20][20]; char s[6]; char ans[100]; int sz = 0; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; char sym[] = "RDLU"; int main() { REP(i, 9) { scanf("%s", s); REP(j...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, a) FOR(i, 0, a) int maze[20][20]; char s[6]; char ans[100]; int sz = 0; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; char sym[] = "RDLU"; int main() { REP(i, 9) { scanf("%s", s); REP(j...
delete
28
32
28
28
0
00000000000 00101010100 00000000010 00001010000 00010001010 00000010000 00010101010 00000010000 00010000010 00001010100 00000000000
p00038
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main(void) { int a[5] = {0}; string str = "null"; while (scanf("%d,%d,%d,%d,%d", a[0], a[1], a[2], a[3], a[4]) != EOF) { sort(a, a + 5); if (((a[0] == a[1]) && (a[2] == a[3]) && (a[2] == a[1])) || ((a[1] == a[2]) ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main(void) { int a[5] = {0}; string str = "null"; while (scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4]) != EOF) { sort(a, a + 5); if (((a[0] == a[1]) && (a[2] == a[3]) && (a[2] == a[1])) || ((a[1] == a...
replace
8
9
8
9
-11
p00038
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int c[5]; // card bool straight() { if (c[4] == 13 && c[3] == 12 && c[2] == 11 && c[1] == 10 && c[0] == 1) return true; for (int i = 0; i < 4; i++) { if (c[i ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int c[5]; // card bool straight() { if (c[4] == 13 && c[3] == 12 && c[2] == 11 && c[1] == 10 && c[0] == 1) return true; for (int i = 0; i < 4; i++) { if (c[i ...
replace
22
23
22
23
TLE
p00038
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; string s[] = {"one pair", "two pair", "three card", "straight", "null"}; int str(int n) { cout << s[n] << endl; return 0; } int main() { int a[5], t[14], ans, m; while (scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2]...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; string s[] = {"one pair", "two pair", "three card", "straight", "null"}; int str(int n) { cout << s[n] << endl; return 0; } int main() { int a[5], t[14], ans, m; while (scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2]...
replace
14
15
14
15
TLE
p00038
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; bool isstraight(int c[]); int main() { int card[5]; while (scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4])) { sort(card, card + 5); int n = 0; for (int i = 0; i < 4; i++) { for (int j = i + 1;...
#include <algorithm> #include <iostream> using namespace std; bool isstraight(int c[]); int main() { int card[5]; while (~scanf("%d,%d,%d,%d,%d", &card[0], &card[1], &card[2], &card[3], &card[4])) { sort(card, card + 5); int n = 0; for (int i = 0; i < 4; i++) { for (int j = i + ...
replace
9
11
9
11
TLE
p00038
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, a) FOR(i, 0, a) int card[5]; int c[13]; void solve() { memset(c, 0, sizeof(c)); REP(i, 5) { c[card[i] - 1]++; } bool f1 = false, f2 = false; REP(i, 13) { if (c[i] >= 4) { f1 = true; ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, a) FOR(i, 0, a) int card[5]; int c[13]; void solve() { memset(c, 0, sizeof(c)); REP(i, 5) { c[card[i] - 1]++; } bool f1 = false, f2 = false; REP(i, 13) { if (c[i] >= 4) { f1 = true; ...
replace
76
78
76
78
TLE
p00038
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long LL; #define SORT(c) sort((c).begin(), (c).end()) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; int main(void) { for (;;) { int n[5]; char c; REP(i, 5) { if (i) cin >> c; if ((scanf("...
#include <bits/stdc++.h> typedef long long LL; #define SORT(c) sort((c).begin(), (c).end()) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; int main(void) { for (;;) { int n[5]; char c; REP(i, 5) { if (i) cin >> c; n[i] = 0; ...
replace
15
16
15
18
TLE
p00038
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int main() { int c; int cards[14], pairs[5]; while (scanf("%d", &c), c) { memset(cards, 0, sizeof(cards)); memset(pairs, 0, sizeof(pairs)); cards[c]++; for (int i = 0; i < 4; i++) { scanf(",%d...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int main() { int c; int cards[14], pairs[5]; while (scanf("%d", &c) != -1) { memset(cards, 0, sizeof(cards)); memset(pairs, 0, sizeof(pairs)); cards[c]++; for (int i = 0; i < 4; i++) { scanf("...
replace
9
10
9
10
TLE
p00039
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int changeTheChar(char c) { if (c == 'I') { return 1; } else if (c == 'V') { return 5; } else if (c == 'X') { return 10; } else if (c == 'L') { return 50; } else if (c == 'C') { return 100; } else if (c == 'D') { return 500...
#include <iostream> #include <vector> using namespace std; int changeTheChar(char c) { if (c == 'I') { return 1; } else if (c == 'V') { return 5; } else if (c == 'X') { return 10; } else if (c == 'L') { return 50; } else if (c == 'C') { return 100; } else if (c == 'D') { return 500...
replace
26
31
26
28
TLE
p00040
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> using namespace std; string change(int a, int b, string str) { for (int i = 0; i < str.size(); i++) str[i] = ((str[i] - 'a') * a + b) % 26 + 'a'; return str; } string out(int a, int b, string str) { f...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> using namespace std; string change(int a, int b, string str) { for (int i = 0; i < str.size(); i++) str[i] = ((str[i] - 'a') * a + b) % 26 + 'a'; return str; } string out(int a, int b, string str) { f...
replace
30
31
30
32
TLE
p00041
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; const int N = 4; const int MAX_E = 100; const char ope[] = {'+', '-', '*'}; bool is_end(vector<int> a) { REP(i, a.size()) if (a[i] != 0) return false; return true; } int calc(int type, int val, int x) { if (type...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; const int N = 4; const int MAX_E = 72; const char ope[] = {'+', '-', '*'}; bool is_end(vector<int> a) { REP(i, a.size()) if (a[i] != 0) return false; return true; } int calc(int type, int val, int x) { if (type ...
replace
6
7
6
7
TLE
p00041
C++
Time Limit Exceeded
#include <cstdio> using namespace std; int a[4]; int c[8]; int k; int calc() { int op = c[k++]; int ret = 0; if (op >= 0) { ret = op; } else if (op >= -3) { int x = calc(); int y = calc(); if (op == -1) { ret = x + y; } else if (op == -2) { ret = x - y; } else { ret =...
#include <cstdio> using namespace std; int a[4]; int c[8]; int k; int calc() { int op = c[k++]; int ret = 0; if (op >= 0) { ret = op; } else if (op >= -3) { int x = calc(); int y = calc(); if (op == -1) { ret = x + y; } else if (op == -2) { ret = x - y; } else { ret =...
replace
50
51
50
51
TLE
p00041
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int d[4]; bool flg = false; string s = "+-*"; int calc(int a, int op, int b) { if (op == 0) return a + b; if (op == 1) return ...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int d[4]; bool flg = false; string s = "+-*"; int calc(int a, int op, int b) { if (op == 0) return a + b; if (op == 1) return ...
replace
39
40
39
40
TLE
p00042
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <list> #define MAX(x, y) ((x > y) ? x : y) using namespace std; FILE *wfp = fopen("output.txt", "w"); FILE *rfp = fopen("input.txt", "r"); int W; int N; int kati[10000]; int omosa[10000]; int DP[1005][10005]; //[i][j]i番目までにjより小さくなるような価値 int DP_W[1...
#include <algorithm> #include <cstdio> #include <iostream> #include <list> #define MAX(x, y) ((x > y) ? x : y) using namespace std; FILE *wfp = fopen("output.txt", "w"); FILE *rfp = fopen("input.txt", "r"); int W; int N; int kati[10000]; int omosa[10000]; int DP[1005][10005]; //[i][j]i番目までにjより小さくなるような価値 int DP_W[1...
replace
22
24
22
24
-11