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
p02399
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a / b << " " << a % b << " " << setprecision(10) << ((double)a) / b << endl; system("pause"); return 0; }
#include <iomanip> #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a / b << " " << a % b << " " << setiosflags(ios::fixed) << setprecision(10) << ((double)a) / b << endl; return 0; }
replace
9
12
9
12
0
sh: 1: pause: not found
p02399
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cout << a / b << " " << a % b << " " << 1.0 * a / b << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << a / b << " " << a % b << " "; printf("%.5f\n", (double)a / b); return 0; }
replace
4
5
4
7
0
p02399
C++
Runtime Error
#include <stdio.h> int main() { int a, b, c, d, r; double f; scanf("%d,%d", &a, &b); d = a / b; r = a % b; f = a % b; printf("%d %d %lf\n", d, r, f); return 0; }
#include <stdio.h> int main() { int a; int b; scanf("%d", &a); scanf("%d", &b); printf("%d %d %lf\n", a / b, a % b, a / (double)b); return 0; }
replace
2
9
2
7
-8
p02399
C++
Runtime Error
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, d, r; double f; scanf("%d %d", a, b); d = a / b; r = a % b; f = (double)a / b; printf("%d %d %f\n", d, r, f); return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = (double)a / b; printf("%d %d %f\n", d, r, f); return 0; }
replace
8
9
8
9
-11
p02399
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef unsigned long long int ulint; typedef long long int llint; typedef long double lldo; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase #define RE return 0 // ios::sync_with_stdio(false); // std::cin.tie(0); //<< setprecision(20) const int mod = (int)1e9 + 7; const llint big = (llint)(2.19e12 + 1); const long double pai = 3.141592653589793238462643383279502884197; const long double ena = 2.71828182845904523536; const long double eps = 1e-7; template <class T, class U> bool mineq(T &a, U b) { if (a > b) { a = b; return true; } return false; } template <class T, class U> bool maxeq(T &a, U b) { if (a < b) { a = b; return true; } return false; } template <class T> void soun(T &ar) { sort(ar.begin(), ar.end()); ar.erase(unique(ar.begin(), ar.end()), ar.end()); } llint gcd(llint a, llint b) { if (a % b == 0) { return b; } else { return gcd(b, a % b); } } llint lcm(llint a, llint b) { return a / gcd(a, b) * b; } template <class T, class U> auto LB(T &ve, U in) { return lower_bound(ve.begin(), ve.end(), in); } template <class T, class U> auto UB(T &ve, U in) { return upper_bound(ve.begin(), ve.end(), in); } template <class T, class U> auto LBI(T &ve, U in) { return LB(ve, in) - ve.begin(); } template <class T, class U> auto UBI(T &ve, U in) { return UB(ve, in) - ve.begin(); } template <class T> void SO(T &ve) { sort(ve.begin(), ve.end()); } template <class T> void REV(T &ve) { reverse(ve.begin(), ve.end()); } int main(void) { int a, b; cin >> a; cout << setprecision(20); cout << a / b << " " << a % b << " " << ((double)a) / b << endl; RE; }
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef unsigned long long int ulint; typedef long long int llint; typedef long double lldo; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase #define RE return 0 // ios::sync_with_stdio(false); // std::cin.tie(0); //<< setprecision(20) const int mod = (int)1e9 + 7; const llint big = (llint)(2.19e12 + 1); const long double pai = 3.141592653589793238462643383279502884197; const long double ena = 2.71828182845904523536; const long double eps = 1e-7; template <class T, class U> bool mineq(T &a, U b) { if (a > b) { a = b; return true; } return false; } template <class T, class U> bool maxeq(T &a, U b) { if (a < b) { a = b; return true; } return false; } template <class T> void soun(T &ar) { sort(ar.begin(), ar.end()); ar.erase(unique(ar.begin(), ar.end()), ar.end()); } llint gcd(llint a, llint b) { if (a % b == 0) { return b; } else { return gcd(b, a % b); } } llint lcm(llint a, llint b) { return a / gcd(a, b) * b; } template <class T, class U> auto LB(T &ve, U in) { return lower_bound(ve.begin(), ve.end(), in); } template <class T, class U> auto UB(T &ve, U in) { return upper_bound(ve.begin(), ve.end(), in); } template <class T, class U> auto LBI(T &ve, U in) { return LB(ve, in) - ve.begin(); } template <class T, class U> auto UBI(T &ve, U in) { return UB(ve, in) - ve.begin(); } template <class T> void SO(T &ve) { sort(ve.begin(), ve.end()); } template <class T> void REV(T &ve) { reverse(ve.begin(), ve.end()); } int main(void) { llint a, b; cin >> a >> b; cout << fixed << setprecision(20); cout << a / b << " " << a % b << " " << ((double)a) / b << endl; RE; }
replace
86
89
86
89
0
p02399
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; double d, f; d = a / b; f = 1.00000 * a / b; cout << d << " " << a % b << " " << f << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; printf("%d %d %f\n", a / b, a % b, (double)a / b); return 0; }
replace
5
9
5
7
0
p02399
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; int main() { double a, b, df, r; df = a / b; r = (int)a % (int)b; cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl; return 0; }
#include <iomanip> #include <iostream> using namespace std; int main() { double a, b, df, r; cin >> a >> b; df = a / b; r = (int)a % (int)b; cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl; return 0; }
insert
6
6
6
7
-8
p02400
Python
Runtime Error
import math r = int(input()) print(math.pi * r * r, 2 * math.pi * r)
import math r = float(input()) print(math.pi * r * r, 2 * math.pi * r)
replace
2
3
2
3
0
p02400
Python
Runtime Error
Pi = 3.14159265 R = int(input()) M = 2 * R * Pi E = R**2 * Pi """ print("{:.10}".format(M)) print("{:.10}".format(E)) """ print(M) print(E)
import math r = float(input()) print("{} {}".format(r**2 * math.pi, r * 2 * math.pi))
replace
0
10
0
4
0
p02400
Python
Runtime Error
pi = 3.14159265359 r = int(input()) print(f"{r*r*pi:.6f} {2*r*pi:.6f}")
pi = 3.14159265359 r = float(input()) print(f"{r*r*pi:.6f} {2*r*pi:.6f}")
replace
1
2
1
2
0
p02400
Python
Runtime Error
import math a = int(input()) print( str("{0:.6f}".format((a * a) * math.pi)) + " " + str("{0:.5f}".format((a + a) * math.pi)) )
import math a = float(input()) print( str("{0:.6f}".format((a * a) * math.pi)) + " " + str("{0:.5f}".format((a + a) * math.pi)) )
replace
2
3
2
3
0
p02400
Python
Runtime Error
import math p = input() r = int(p) area = math.pi * r**2 length = 2 * math.pi * r print(f"{area:.6f} {length:.6f}")
import math r = float(input()) area = math.pi * r**2 length = 2 * math.pi * r print(f"{area:.6f} {length:.6f}")
replace
2
4
2
3
0
p02400
Python
Runtime Error
r = int(input()) pi = 3.141592653589793238 print(pi * r * r, 2 * pi * r)
r = float(input()) pi = 3.1415926535897932384626 print(pi * r * r, 2 * pi * r)
replace
0
2
0
2
0
p02400
Python
Runtime Error
import math r = int(input()) print(f"{r**2*math.pi:.8f}")
import math r = float(input()) print(f"{r**2*math.pi:.8f} {math.pi*r*2:.8f}")
replace
2
4
2
4
0
p02400
Python
Runtime Error
pi = 3.141592653589793 r = int(input()) print("%.6f %.6f" % (pi * r**2, 2 * pi * r))
pi = 3.141592653589793 r = float(input()) print("%.6f %.6f" % (pi * r**2, 2 * pi * r))
replace
2
3
2
3
0
p02400
Python
Runtime Error
r = int(input()) pi = 3.141592653589 print("{:.10f} {:.10f}".format(r**2 * pi, 2 * r * pi))
r = float(input()) pi = 3.141592653589 print("{:.10f} {:.10f}".format(r**2 * pi, 2 * r * pi))
replace
0
1
0
1
0
p02400
C++
Runtime Error
#include <iomanip> #include <iostream> using namespace std; int main() { int a, b, d; cin >> a >> b; d = a / b; cout << d << " " << a - b * d << " " << fixed << setprecision(5) << (double)a / b << endl; return 0; }
#include <iomanip> #include <iostream> using namespace std; int main() { double pi = 3.141592653589793; double r, pir; cin >> r; pir = pi * r; cout << fixed << setprecision(5) << pir * r << " " << pir * 2 << endl; return 0; }
replace
5
10
5
10
0
p02400
Python
Runtime Error
r = int(input()) pi = 3.141592653589793 area = pi * r * r circum = 2 * pi * r print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))
import math r = float(input()) area = math.pi * r * r circum = 2 * math.pi * r print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))
replace
0
4
0
6
0
p02400
C++
Runtime Error
#include <cstdio> int main() { int a, b; scanf("%d %d", &a, &b); printf("%d %d %lf\n", a / b, a % b, (double)a / b); return 0; }
#include <cstdio> int main() { double r, pi = 3.141592653589; scanf("%lf", &r); printf("%lf %lf\n", r * r * pi, 2 * r * pi); return 0; }
replace
2
5
2
5
-8
p02400
C++
Runtime Error
#include <cassert> #include <cmath> #include <iostream> // #define NDEBUG int main(void) { using namespace std; static const int INPUT_R_MAX = 10000; static const int INPUT_R_MIN = 1; double input_r = 0; double area = 0; /* 面積 */ double circumference = 0; /* 円周 */ cin >> input_r; /* 半径 */ /* 入力値の前提条件 */ assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX); /* Calculation */ area = input_r * input_r * M_PI; circumference = input_r * 2 * M_PI; /* Output */ cout << fixed << area << " " << circumference << endl; return 0; }
#include <cassert> #include <cmath> #include <iostream> // #define NDEBUG int main(void) { using namespace std; static const int INPUT_R_MAX = 10000; static const int INPUT_R_MIN = 0; double input_r = 0; double area = 0; /* 面積 */ double circumference = 0; /* 円周 */ cin >> input_r; /* 半径 */ /* 入力値の前提条件 */ assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX); /* Calculation */ area = input_r * input_r * M_PI; circumference = input_r * 2 * M_PI; /* Output */ cout << fixed << area << " " << circumference << endl; return 0; }
replace
7
8
7
8
0
p02400
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { cout << fixed << setprecision(12); int a, b; cin >> a >> b; cout << a / b << " " << a % b << " " << (double)a / b << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cout << fixed << setprecision(6); double a; cin >> a; cout << a * a * acos(-1) << " " << 2 * a * acos(-1) << endl; return 0; }
replace
4
8
4
8
0
p02400
Python
Runtime Error
import math r = input() print(r**2 * math.pi, r * 2 * math.pi)
import math r = float(input()) print(float(r**2 * math.pi), float(r * 2 * math.pi))
replace
2
4
2
4
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02400/Python/s075858822.py", line 4, in <module> print(r ** 2 * math.pi, r * 2 * math.pi) TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
p02400
Python
Runtime Error
from math import pi r = int(input()) print(r**2 * pi, 2 * r * pi)
from math import pi r = float(input()) print(r**2 * pi, 2 * r * pi)
replace
2
3
2
3
0
p02400
Python
Runtime Error
import math r = int(input()) print(f"{math.pi * r ** 2} {2 * math.pi * r}")
import math r = float(input()) print(f"{math.pi * r ** 2} {2 * math.pi * r}")
replace
2
3
2
3
0
p02400
Python
Runtime Error
r = int(input()) print(r * r * 3.14159265359, 2 * r * 3.14159265359)
r = float(input()) print("{:.6f} {:.6f}".format(r * r * 3.14159265359, 2 * r * 3.14159265359))
replace
0
2
0
2
0
p02400
C++
Runtime Error
#include <stdio.h> int main() { int a, b, d = 0, r = 0; double f = 0.0; scanf("%d%d", &a, &b); d = a / b; r = a % b; f = (double)a / b; printf("%d %d %f\n", d, r, f); return 0; }
#include <stdio.h> int main() { double r; double S = 0.0, L = 0.0, pi = 3.14159265359; scanf("%lf", &r); S = r * r * pi; L = 2 * r * pi; printf("%.6lf %.6lf\n", S, L); return 0; }
replace
2
9
2
8
-8
p02400
Python
Runtime Error
import math r = int(input()) print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))
import math r = float(input()) print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))
replace
2
3
2
3
0
p02400
Python
Runtime Error
from math import pi r = int(input()) # 面積 circle_area = r * r * pi # 円周 circumference = 2.0 * r * pi print("{} {}".format(circle_area, circumference))
from math import pi r = float(input()) print("{} {}".format(r * r * pi, 2 * pi * r))
replace
2
10
2
4
0
p02400
Python
Runtime Error
r = int(input()) pi = 3.141592653589793 A = float(pow(r, 2) * pi) S = float(2 * pi * r) print("{0:.8f}".format(A) + " " + "{0:.8f}".format(S))
r = float(input()) pi = 3.141592653589793 A = float(pow(r, 2) * pi) S = float(2 * pi * r) print("{0:.8f}".format(A) + " " + "{0:.8f}".format(S))
replace
0
1
0
1
0
p02401
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b, c, d, e, f; char op; while (true) { cin >> a >> op >> b; if (op == '?') break; c = a + b; d = a - b; e = a * b; f = a / b; if (op == '+') cout << c << "\n"; if (op == '-') cout << d << "\n"; if (op == '*') cout << e << "\n"; if (op == '/') cout << f << "\n"; } }
#include <iostream> using namespace std; int main() { int a, b, c, d, e, f; char op; while (true) { cin >> a >> op >> b; if (op == '?') break; c = a + b; d = a - b; e = a * b; if (b != 0) f = a / b; if (op == '+') cout << c << "\n"; if (op == '-') cout << d << "\n"; if (op == '*') cout << e << "\n"; if (op == '/') cout << f << "\n"; } }
replace
14
15
14
16
0
p02401
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { while (1 == 1) { int a, b; string op; int result; cin >> a >> op >> b; if (op == "&") break; if (op == "+") { result = a + b; cout << result << endl; } if (op == "-") { result = a - b; cout << result << endl; } if (op == "*") { result = a * b; cout << result << endl; } if (op == "/") { result = a / b; cout << result << endl; } } }
#include <iostream> #include <string> using namespace std; int main() { while (1 == 1) { int a, b; string op; int result; cin >> a >> op >> b; if (op == "?") break; if (op == "+") { result = a + b; cout << result << endl; } if (op == "-") { result = a - b; cout << result << endl; } if (op == "*") { result = a * b; cout << result << endl; } if (op == "/") { result = a / b; cout << result << endl; } } }
replace
11
12
11
12
TLE
p02401
C++
Time Limit Exceeded
#include <stdio.h> int main(void) { int a, b, ans; char c; while (1) { scanf("%d %c %d", &a, &c, &b); if (c == '+') ans = a + b; else if (c == '-') ans = a - b; else if (c == '*') ans = a * b; else if (c == '/') ans = a / b; printf("%d\n", ans); } return 0; }
#include <stdio.h> int main(void) { int a, b, ans; char c; while (1) { scanf("%d %c %d", &a, &c, &b); if (c == '+') ans = a + b; else if (c == '-') ans = a - b; else if (c == '*') ans = a * b; else if (c == '/') ans = a / b; else break; printf("%d\n", ans); } return 0; }
insert
15
15
15
17
TLE
p02401
C++
Runtime Error
#include <cassert> #include <cmath> #include <iostream> // #define NDEBUG int main(void) { using namespace std; static const int INPUT_MAX = 20000; static const int INPUT_MIN = 0; int input_a = 0; int input_b = 0; int ans = 0; /* 解 */ char op = 0; /* 演算子 */ while (1) { cin >> input_a >> op >> input_b; /* 入力値の前提条件 最大・最小の制限*/ assert(INPUT_MIN <= input_a && input_a <= INPUT_MAX); assert(INPUT_MIN <= input_b && input_b <= INPUT_MAX); /* 入力値の前提条件 0の割り算でないこと*/ assert(!((input_a == 0 || input_b == 0) && op == '/')); /* Calculation */ if (op == '+') { ans = input_a + input_b; cout << ans << endl; } else if (op == '-') { ans = input_a - input_b; cout << ans << endl; } else if (op == '*') { ans = input_a * input_b; cout << ans << endl; } else if (op == '/') { ans = input_a / input_b; cout << ans << endl; } else if (op == '?') { break; } else { cout << "Input Error" << endl; break; } } return 0; }
#include <cassert> #include <cmath> #include <iostream> // #define NDEBUG int main(void) { using namespace std; static const int INPUT_MAX = 20000; static const int INPUT_MIN = 0; int input_a = 0; int input_b = 0; int ans = 0; /* 解 */ char op = 0; /* 演算子 */ while (1) { cin >> input_a >> op >> input_b; /* 入力値の前提条件 最大・最小の制限*/ assert(INPUT_MIN <= input_a && input_a <= INPUT_MAX); assert(INPUT_MIN <= input_b && input_b <= INPUT_MAX); /* 入力値の前提条件 0の割り算でないこと*/ assert(!(input_b == 0 && op == '/')); /* Calculation */ if (op == '+') { ans = input_a + input_b; cout << ans << endl; } else if (op == '-') { ans = input_a - input_b; cout << ans << endl; } else if (op == '*') { ans = input_a * input_b; cout << ans << endl; } else if (op == '/') { ans = input_a / input_b; cout << ans << endl; } else if (op == '?') { break; } else { cout << "Input Error" << endl; break; } } return 0; }
replace
20
21
20
21
0
p02401
C++
Time Limit Exceeded
#include <cstdio> using namespace std; int main() { int x, y; char z; while (1) { scanf("%d %c %d", &x, z, &y); if (z == '?') { return 0; } else if (z == '+') { printf("%d\n", x + y); } else if (z == '-') { printf("%d\n", x - y); } else if (z == '/') { printf("%d\n", x / y); } else if (z == '*') { printf("%d\n", x * y); } } return 0; }
#include <cstdio> using namespace std; int main() { int x, y; char z; while (1) { scanf("%d %c %d", &x, &z, &y); if (z == '?') { return 0; } else if (z == '+') { printf("%d\n", x + y); } else if (z == '-') { printf("%d\n", x - y); } else if (z == '/') { printf("%d\n", x / y); } else if (z == '*') { printf("%d\n", x * y); } } return 0; }
replace
6
7
6
7
TLE
p02401
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int a, b; char op = '0'; while (op != '?') { cin >> a >> op >> b; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else { cout << a / b << endl; } } return 0; }
#include <iostream> using namespace std; int main(void) { int a, b; char op = '0'; while (op != '?') { cin >> a >> op >> b; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } } return 0; }
replace
16
17
16
17
-8
p02401
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; #define MAX 20000 int main(void) { int a, b, flag = 0; char op; while (1) { do { cin >> a >> op >> b; } while (a < 0 || a > MAX || b < 0 || b > MAX && op != '+' && op != '-' && op != '*' && op != '/' && op != '?'); switch (op) { case '+': printf("%d\n", a + b); break; case '-': printf("%d\n", a - b); break; case '*': printf("%d\n", a * b); break; case '/': printf("%d\n", a / b); if (b == 0) break; break; case '?': if (a == 0 && b == 0) flag = 1; break; } if (flag == 1) break; } return 0; }
#include <cstdio> #include <iostream> using namespace std; #define MAX 20000 int main(void) { int a, b, flag = 0; char op; while (1) { do { cin >> a >> op >> b; } while (a < 0 || a > MAX || b < 0 || b > MAX && op != '+' && op != '-' && op != '*' && op != '/' && op != '?'); switch (op) { case '+': printf("%d\n", a + b); break; case '-': printf("%d\n", a - b); break; case '*': printf("%d\n", a * b); break; case '/': printf("%d\n", a / b); if (b == 0) break; break; case '?': flag = 1; break; } if (flag == 1) break; } return 0; }
replace
32
34
32
33
TLE
p02401
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) // #define shosu(n) setprecision(n) // #define ENDL endl using namespace std; int main() { int A, B; char s; while (cin >> A >> s >> B) { if (s == '?') break; if (s == '+') cout << A + B << endl; if (s == '-') cout << A - B << endl; if (s == '*') cout << A * B << endl; if (s == '/') cout << A / B << endl; } return 9; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) // #define shosu(n) setprecision(n) // #define ENDL endl using namespace std; int main() { int A, B; char s; while (cin >> A >> s >> B) { if (s == '?') break; if (s == '+') cout << A + B << endl; if (s == '-') cout << A - B << endl; if (s == '*') cout << A * B << endl; if (s == '/') cout << A / B << endl; } return 0; }
replace
20
21
20
21
9
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, op, result; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') { result = a + b; cout << result << "\n"; } else if (op == '-') { result = a - b; cout << result << "\n"; } else if (op == '*') { result = a * b; cout << result << "\n"; } else if (op == '/') { result = a / b; cout << result << "\n"; } } return 0; }
#include <iostream> using namespace std; int main() { int a, b, result; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') { result = a + b; cout << result << "\n"; } else if (op == '-') { result = a - b; cout << result << "\n"; } else if (op == '*') { result = a * b; cout << result << "\n"; } else if (op == '/') { result = a / b; cout << result << "\n"; } } return 0; }
replace
5
6
5
7
TLE
p02401
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> using namespace std; int main() { string op; int a, b; while (1) { cin >> a >> op >> b; if (a == 0 && b == 0) { break; } if (op == "+") { cout << a + b << endl; } else if (op == "-") { cout << a - b << endl; } else if (op == "*") { cout << a * b << endl; } else { cout << a / b << endl; } } return 0; }
#include <iomanip> #include <iostream> using namespace std; int main() { string op; int a, b; while (1) { cin >> a >> op >> b; if (op == "?") { break; } if (op == "+") { cout << a + b << endl; } else if (op == "-") { cout << a - b << endl; } else if (op == "*") { cout << a * b << endl; } else { cout << a / b << endl; } } return 0; }
replace
10
11
10
11
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op != '?') { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } } return 0; }
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op != '?') { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } cin >> a >> op >> b; } return 0; }
insert
17
17
17
18
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; #include <iomanip> #define _USE_MATH_DEFINES #include <cmath> int main() { int a, b; char op; cin >> a >> op >> b; while (!(a == 0 && op == '?' && b == 0)) { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } cin >> a >> op >> b; } return 0; }
#include <iostream> using namespace std; #include <iomanip> #define _USE_MATH_DEFINES #include <cmath> int main() { int a, b; char op; cin >> a >> op >> b; while (!(op == '?')) { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } cin >> a >> op >> b; } return 0; }
replace
12
13
12
13
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, c; char b; while (true) { cin >> a >> b >> c; if (a == 0 && c == 0) break; if (b == '+') cout << a + c << endl; else if (b == '-') cout << a - c << endl; else if (b == '*') cout << a * c << endl; else cout << a / c << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, c; char b; while (true) { cin >> a >> b >> c; if (b == '?') break; if (b == '+') cout << a + c << endl; else if (b == '-') cout << a - c << endl; else if (b == '*') cout << a * c << endl; else cout << a / c << endl; } return 0; }
replace
10
11
10
11
TLE
p02401
C++
Time Limit Exceeded
/* ????????°??§???????????¨???????????? */ #include <algorithm> #include <ctype.h> #include <iostream> #include <iterator> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> #define LLU unsigned long long int #define LL long long int #define LD long double using namespace std; #define LLUmax ULLONG_MAX #define LLmax LLONG_MAX #define dmax INT_MAX #define vd vector<int> #define vLL vector<long long int> #define vLLU vector<unsigned long long int> #define pb push_back #define mp make_pair #define fi first #define sec second #define debug printf("asd\n") #define debugd(a) printf("--%d\n", a) #define debugdd(a, b) printf("--%d %d\n", a, b) #define debugarr(a, b) \ for (int i = 0; i < b; i++) \ printf("%d ", a[i]); \ printf("\n") #define newline printf("\n") #define forin(a, b, c) for (int a = b; a < c; a++) #define forde(a, b, c) for (int a = b; a < c; a--) inline void scd(int &a) { scanf("%d", &a); } inline void scdd(int &a, int &b) { scanf("%d %d", &a, &b); } inline void sctd(int &a, int &b, int &c) { scanf("%d %d %d", &a, &b, &c); } inline void scdlld(long int &a, long int &b) { scanf("%I64d %I64d", &a, &b); } inline void sclld(long long int &a) { scanf("%I64d", &a); } #define scarrd(a, b) \ for (int i = 0; i < b; i++) \ scanf("%d", &a[i]) #define prdlld(a, b) printf("%I64d %I64d", a, b) #define prdd(a, b) printf("%d %d", a, b) #define prd(a) printf("%d", a) #define prarr(a, b) \ for (int i = 0; i < b; i++) \ printf("%d ", a[i]) #define iniarr(a, b) \ for (int i = 0; i < b; i++) \ a[i] = 0 #define arr(a, b) int *a = (int *)malloc(b * sizeof(int)) #define llarr(a, b) \ long long int *a = (long long int *)malloc(b * sizeof(long long int)) #define st(a, b) char *a = (char *)malloc(b * sizeof(char)) #define grav 9.8 #define pi 3.14159265 int main() { LL a, c; char b; scanf("%lld %c %lld", &a, &b, &c); while (a != 0 || b != '?' || c != 0) { if (b == '+') printf("%lld\n", a + c); else if (b == '-') printf("%lld\n", a - c); else if (b == '*') printf("%lld\n", a * c); else if (b == '/') printf("%lld\n", a / c); scanf("%lld %c %lld", &a, &b, &c); } return 0; }
/* ????????°??§???????????¨???????????? */ #include <algorithm> #include <ctype.h> #include <iostream> #include <iterator> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> #define LLU unsigned long long int #define LL long long int #define LD long double using namespace std; #define LLUmax ULLONG_MAX #define LLmax LLONG_MAX #define dmax INT_MAX #define vd vector<int> #define vLL vector<long long int> #define vLLU vector<unsigned long long int> #define pb push_back #define mp make_pair #define fi first #define sec second #define debug printf("asd\n") #define debugd(a) printf("--%d\n", a) #define debugdd(a, b) printf("--%d %d\n", a, b) #define debugarr(a, b) \ for (int i = 0; i < b; i++) \ printf("%d ", a[i]); \ printf("\n") #define newline printf("\n") #define forin(a, b, c) for (int a = b; a < c; a++) #define forde(a, b, c) for (int a = b; a < c; a--) inline void scd(int &a) { scanf("%d", &a); } inline void scdd(int &a, int &b) { scanf("%d %d", &a, &b); } inline void sctd(int &a, int &b, int &c) { scanf("%d %d %d", &a, &b, &c); } inline void scdlld(long int &a, long int &b) { scanf("%I64d %I64d", &a, &b); } inline void sclld(long long int &a) { scanf("%I64d", &a); } #define scarrd(a, b) \ for (int i = 0; i < b; i++) \ scanf("%d", &a[i]) #define prdlld(a, b) printf("%I64d %I64d", a, b) #define prdd(a, b) printf("%d %d", a, b) #define prd(a) printf("%d", a) #define prarr(a, b) \ for (int i = 0; i < b; i++) \ printf("%d ", a[i]) #define iniarr(a, b) \ for (int i = 0; i < b; i++) \ a[i] = 0 #define arr(a, b) int *a = (int *)malloc(b * sizeof(int)) #define llarr(a, b) \ long long int *a = (long long int *)malloc(b * sizeof(long long int)) #define st(a, b) char *a = (char *)malloc(b * sizeof(char)) #define grav 9.8 #define pi 3.14159265 int main() { LL a, c; char b; scanf("%lld %c %lld", &a, &b, &c); while (b != '?') { if (b == '+') printf("%lld\n", a + c); else if (b == '-') printf("%lld\n", a - c); else if (b == '*') printf("%lld\n", a * c); else if (b == '/') printf("%lld\n", a / c); scanf("%lld %c %lld", &a, &b, &c); } return 0; }
replace
70
71
70
71
TLE
p02401
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define PI 3.14159265358979323 int main(int argc, char *argv[]) { char op; int a, b; while (1) { cin >> a >> b >> op; if (op == '?') break; switch (op) { case '+': cout << a + b << endl; break; case '-': cout << a - b << endl; break; case '*': cout << a * b << endl; break; case '/': cout << a / b << endl; break; } } return 0; }
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define PI 3.14159265358979323 int main(int argc, char *argv[]) { char op; int a, b; while (1) { cin >> a >> op >> b; if (op == '?') break; switch (op) { case '+': cout << a + b << endl; break; case '-': cout << a - b << endl; break; case '*': cout << a * b << endl; break; case '/': cout << a / b << endl; break; } } return 0; }
replace
12
13
12
13
TLE
p02401
C++
Runtime Error
#include <stdio.h> int main(void) { int a, b, flag = 0; char op; while (flag == 0) { scanf("%d %c %d", &a, &op, &b); if (op == '?') flag = 1; else if (op == '+') printf("%d\n", (a + b)); else if (op == '-') printf("%d\n", (a - b)); else if (op == '/') printf("%d\n", (a / b)); else if (op == '*') printf("%d\n", (a * b)); } return 1; }
#include <stdio.h> int main(void) { int a, b, flag = 0; char op; while (flag == 0) { scanf("%d %c %d", &a, &op, &b); if (op == '?') flag = 1; else if (op == '+') printf("%d\n", (a + b)); else if (op == '-') printf("%d\n", (a - b)); else if (op == '/') printf("%d\n", (a / b)); else if (op == '*') printf("%d\n", (a * b)); } }
delete
18
19
18
18
1
p02401
C++
Time Limit Exceeded
#include <cstdio> int main() { int a, b; char op; while (scanf("%d %c %d", &a, &op, &b)) { if (a == 0 && op == '?' && b == 0) break; if (op == '+') printf("%d\n", a + b); if (op == '-') printf("%d\n", a - b); if (op == '*') printf("%d\n", a * b); if (op == '/') printf("%d\n", a / b); } return 0; }
#include <cstdio> int main() { int a, b; char op; while (scanf("%d %c %d", &a, &op, &b)) { if (op == '?') break; if (op == '+') printf("%d\n", a + b); if (op == '-') printf("%d\n", a - b); if (op == '*') printf("%d\n", a * b); if (op == '/') printf("%d\n", a / b); } return 0; }
replace
5
6
5
6
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> int main() { int a, b, op, z; while (1) { std::cin >> a >> op >> b; if (op == '?') { break; } if (op == '+') { z = a + b; } else if (op == '-') { z = a - b; } else if (op == '*') { z = a * b; } else if (op == '/') { z = a / b; } std::cout << z << std::endl; } return 0; }
#include <iostream> int main() { int a, b, z; char op; while (1) { std::cin >> a >> op >> b; if (op == '?') { break; } if (op == '+') { z = a + b; } else if (op == '-') { z = a - b; } else if (op == '*') { z = a * b; } else if (op == '/') { z = a / b; } std::cout << z << std::endl; } return 0; }
replace
3
4
3
5
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main(void) { int a, b; char op; while (1) { cin >> a >> op >> b; if (a == 0 and b == 0) break; if (op == '+') cout << a + b << endl; if (op == '-') cout << a - b << endl; if (op == '*') cout << a * b << endl; if (op == '/') cout << a / b << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { int a, b; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') cout << a + b << endl; if (op == '-') cout << a - b << endl; if (op == '*') cout << a * b << endl; if (op == '/') cout << a / b << endl; } return 0; }
replace
8
9
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <stdio.h> int main() { int a, b; char c; while (scanf("%d%c%d", &a, &c, &b) != EOF) { if (c == '?') { break; } if (c == '+') { printf("%d\n", a + b); } if (c == '-') { printf("%d\n", a - b); } if (c == '*') { printf("%d\n", a * b); } if (c == '/') { printf("%d\n", a / b); } } return 0; }
#include <stdio.h> int main() { int a, b; char c; while (scanf("%d %c %d", &a, &c, &b) != EOF) { if (c == '?') { break; } if (c == '+') { printf("%d\n", a + b); } if (c == '-') { printf("%d\n", a - b); } if (c == '*') { printf("%d\n", a * b); } if (c == '/') { printf("%d\n", a / b); } } return 0; }
replace
4
5
4
5
TLE
p02401
C++
Time Limit Exceeded
#include <cstdio> int main() { int a, b; char op; while (true) { scanf("%d %c %d", &a, &op, &b); if (a == 0 && op == '?' && b == 0) break; if (op == '+') { printf("%d\n", a + b); } else if (op == '-') { printf("%d\n", a - b); } else if (op == '*') { printf("%d\n", a * b); } else if (op == '/') { printf("%d\n", a / b); } } return 0; }
#include <cstdio> int main() { int a, b; char op; while (true) { scanf("%d %c %d", &a, &op, &b); if (op == '?') break; if (op == '+') { printf("%d\n", a + b); } else if (op == '-') { printf("%d\n", a - b); } else if (op == '*') { printf("%d\n", a * b); } else if (op == '/') { printf("%d\n", a / b); } } return 0; }
replace
7
8
7
8
TLE
p02401
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> #define PI 3.141592653589 using namespace std; int main() { int a, b, r; char op; while (1) { cin >> a >> op >> b; if (a == 0 && b == 0) { break; } switch (op) { case '+': r = a + b; break; case '-': r = a - b; break; case '*': r = a * b; break; case '/': if (b == 0) { break; } r = a / b; break; default: break; } cout << r << endl; } return 0; }
#include <iomanip> #include <iostream> #define PI 3.141592653589 using namespace std; int main() { int a, b, r; char op; while (1) { cin >> a >> op >> b; if (op == '?') { break; } switch (op) { case '+': r = a + b; break; case '-': r = a - b; break; case '*': r = a * b; break; case '/': if (b == 0) { break; } r = a / b; break; default: break; } cout << r << endl; } return 0; }
replace
14
15
14
15
TLE
p02401
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b, s; char op; while (1) { cin >> a >> b >> op; if (op == '?') break; if (op == '+') { s = a + b; } else if (op == '-') { s = a - b; } else if (op == '*') { s = a * b; } else { s = a / b; } cout << s << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b, s; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') { s = a + b; } else if (op == '-') { s = a - b; } else if (op == '*') { s = a * b; } else { s = a / b; } cout << s << endl; } return 0; }
replace
7
8
7
8
-8
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { char op; int a, b; while (1) { cin >> a >> op >> b; if (a == 0 && b == 0 && op == '?') break; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } else { } } return 0; }
#include <iostream> using namespace std; int main() { char op; int a, b; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } else { } } return 0; }
replace
7
8
7
8
TLE
p02401
C++
Time Limit Exceeded
#include <stdio.h> int main(void) { int a, b; char ch; while (1) { scanf("%d", &a); getchar(); ch = getchar(); scanf("%d", &b); if (a == 0 && ch == '?' && b == 0) { break; } switch (ch) { case '+': printf("%d\n", a + b); break; case '-': printf("%d\n", a - b); break; case '*': printf("%d\n", a * b); break; case '/': printf("%d\n", a / b); break; } } return 0; }
#include <stdio.h> int main(void) { int a, b; char ch; while (1) { scanf("%d", &a); getchar(); ch = getchar(); scanf("%d", &b); if (ch == '?') { break; } switch (ch) { case '+': printf("%d\n", a + b); break; case '-': printf("%d\n", a - b); break; case '*': printf("%d\n", a * b); break; case '/': printf("%d\n", a / b); break; } } return 0; }
replace
10
11
10
11
TLE
p02401
C++
Time Limit Exceeded
#include <stdio.h> int main(void) { int a; int b; char op; int c = 0; while (1) { scanf("%d %c %d", &a, &op, &b); if (op == '+') { c = a + b; printf("%d\n", c); } else if (op == '-') { c = a - b; printf("%d\n", c); } else if (op == '*') { c = a * b; printf("%d\n", c); } else if (op == '/') { c = a / b; printf("%d\n", c); } else { if (op == '?' && a == 0 && b == 0) break; } } return (0); }
#include <stdio.h> int main(void) { int a; int b; char op; int c = 0; while (1) { scanf("%d %c %d", &a, &op, &b); if (op == '+') { c = a + b; printf("%d\n", c); } else if (op == '-') { c = a - b; printf("%d\n", c); } else if (op == '*') { c = a * b; printf("%d\n", c); } else if (op == '/') { c = a / b; printf("%d\n", c); } else { if (op == '?') break; } } return (0); }
replace
22
23
22
23
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b = 0; char op = 0; do { cin >> a >> op >> b; switch (op) { case '+': cout << a + b << endl; break; case '-': cout << a - b << endl; break; case '*': cout << a * b << endl; break; case '/': cout << a / b << endl; break; default: break; } } while (op = '?'); return 0; }
#include <iostream> using namespace std; int main() { int a, b = 0; char op = 0; do { cin >> a >> op >> b; switch (op) { case '+': cout << a + b << endl; break; case '-': cout << a - b << endl; break; case '*': cout << a * b << endl; break; case '/': cout << a / b << endl; break; default: break; } } while (op != '?'); return 0; }
replace
24
25
24
25
TLE
p02401
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; signed main() { int a, c; char b; while (scanf("%d%c%d", &a, &b, &c), b != '?') { switch (b) { case '+': printf("%d\n", a + c); break; case '-': printf("%d\n", a - c); break; case '*': printf("%d\n", a * c); break; default: printf("%d\n", a / c); break; } } }
#include <bits/stdc++.h> using namespace std; signed main() { int a, c; char b; while (cin >> a >> b >> c, b != '?') { switch (b) { case '+': printf("%d\n", a + c); break; case '-': printf("%d\n", a - c); break; case '*': printf("%d\n", a * c); break; default: printf("%d\n", a / c); break; } } }
replace
6
7
6
7
TLE
p02401
C++
Time Limit Exceeded
// itp1_topic4_c #include <bits/stdc++.h> using namespace std; int main() { while (1) { int a, b; string op; cin >> a >> op >> b; if (a == 0 && op == "?" && b == 0) break; int ans; if (op == "+") ans = a + b; if (op == "-") ans = a - b; if (op == "*") ans = a * b; if (op == "/") ans = a / b; cout << ans << endl; } return 0; }
// itp1_topic4_c #include <bits/stdc++.h> using namespace std; int main() { while (1) { int a, b; string op; cin >> a >> op >> b; if (op == "?") break; int ans; if (op == "+") ans = a + b; if (op == "-") ans = a - b; if (op == "*") ans = a * b; if (op == "/") ans = a / b; cout << ans << endl; } return 0; }
replace
10
11
10
11
TLE
p02401
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; char op; int i = 0; string cu; int an[20001]; int bn[20001]; while (true) { cin >> a >> op >> b; an[i] = a; bn[i] = b; cu[i] = op; if (a == 0 && op == '?' && b == 0) { break; } i++; } for (int k = 0; k < i; k++) { if (cu[k] == '+') { cout << an[k] + bn[k] << endl; } if (cu[k] == '-') { cout << an[k] - bn[k] << endl; } if (cu[k] == '*') { cout << an[k] * bn[k] << endl; } if (cu[k] == '/') { cout << an[k] / bn[k] << endl; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; char op; int i = 0; string cu; int an[20001]; int bn[20001]; while (true) { cin >> a >> op >> b; an[i] = a; bn[i] = b; cu[i] = op; if (op == '?') { break; } i++; } for (int k = 0; k < i; k++) { if (cu[k] == '+') { cout << an[k] + bn[k] << endl; } if (cu[k] == '-') { cout << an[k] - bn[k] << endl; } if (cu[k] == '*') { cout << an[k] * bn[k] << endl; } if (cu[k] == '/') { cout << an[k] / bn[k] << endl; } } return 0; }
replace
14
15
14
15
0
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main(void) { int a, b, s; char op; while (1) { cin >> a >> b >> op; if (op == '?') break; switch (op) { case ('+'): s = a + b; break; case ('-'): s = a - b; break; case ('*'): s = a * b; break; case ('/'): s = a / b; break; } cout << s << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { int a, b, s; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; switch (op) { case ('+'): s = a + b; break; case ('-'): s = a - b; break; case ('*'): s = a * b; break; case ('/'): s = a / b; break; } cout << s << endl; } return 0; }
replace
8
9
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b, c, d, h, i; char e, g, f; while (scanf("%d%c%c%c%d", &a, &c, &g, &d, &b)) { if (g == '?' && a == 0 && b == 0) { return 0; } else if (g == '+') { c = a + b; cout << c << endl; } else if (g == '-') { d = a - b; cout << d << endl; } else if (g == '*') { h = a * b; cout << h << endl; } else if (g == '/') { i = a / b; cout << i << endl; } } }
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b, c, d, h, i; char e, g, f; while (scanf("%d%c%c%c%d", &a, &c, &g, &d, &b)) { if (g == '?') { return 0; } else if (g == '+') { c = a + b; cout << c << endl; } else if (g == '-') { d = a - b; cout << d << endl; } else if (g == '*') { h = a * b; cout << h << endl; } else if (g == '/') { i = a / b; cout << i << endl; } } }
replace
8
9
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { char op; int a, b, result = 0; while (1) { cin >> a >> op >> b; if (a == 0 && b == 0 && op == '?') break; else if (op == '+') result = a + b; else if (op == '-') result = a - b; else if (op == '/') result = a / b; else if (op == '*') result = a * b; cout << result << endl; result = 0; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { char op; int a, b, result = 0; while (1) { cin >> a >> op >> b; if (op == '?') break; else if (op == '+') result = a + b; else if (op == '-') result = a - b; else if (op == '/') result = a / b; else if (op == '*') result = a * b; cout << result << endl; result = 0; } return 0; }
replace
10
11
10
11
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char c; while (1) { cin >> a >> c >> b; if (a == b && c == '?') return 0; if (c == '+') { cout << a + b; } else if (c == '-') { cout << a - b; } else if (c == '*') { cout << a * b; } else if (c == '/') { cout << a / b; } cout << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b; char c; while (1) { cin >> a >> c >> b; if (c == '?') return 0; if (c == '+') { cout << a + b; } else if (c == '-') { cout << a - b; } else if (c == '*') { cout << a * b; } else if (c == '/') { cout << a / b; } cout << endl; } return 0; }
replace
7
8
7
8
TLE
p02401
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int a, b, X; string d; while (1) { cin >> a >> d >> b; if (d == " ?") break; if (d == "+") X = a + b; if (d == "-") X = a - b; if (d == "*") X = a * b; if (d == "/") X = a / b; cout << X << endl; } return (0); }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, X; string d; while (1) { cin >> a >> d >> b; if (d == "?") break; if (d == "+") X = a + b; if (d == "-") X = a - b; if (d == "*") X = a * b; if (d == "/") X = a / b; cout << X << endl; } return (0); }
replace
8
9
8
9
TLE
p02401
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <string> using namespace std; #define pi 3.141592653589 int main() { int a, b; char op; while (cin >> a >> op >> b) { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } else { break; } } return 9; }
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <string> using namespace std; #define pi 3.141592653589 int main() { int a, b; char op; while (cin >> a >> op >> b) { if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '/') { cout << a / b << endl; } else { break; } } return 0; }
replace
26
27
26
27
9
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char c; while (1) { cin >> a >> c >> b; if (c == '?') switch (c) { case '+': cout << a + b; break; case '-': cout << a - b; break; case '*': cout << a * b; break; case '/': cout << a / b; break; } cout << endl; } }
#include <iostream> using namespace std; int main() { int a, b; char c; while (1) { cin >> a >> c >> b; if (c == '?') break; switch (c) { case '+': cout << a + b; break; case '-': cout << a - b; break; case '*': cout << a * b; break; case '/': cout << a / b; break; } cout << endl; } }
replace
10
24
10
25
TLE
p02401
C++
Time Limit Exceeded
#ifdef LOCAL #pragma GCC optimize("O0") #else #pragma GCC optimize("O3") #endif #include <bits/stdc++.h> using namespace std; using namespace std::placeholders; using ll = long long; const int INF = 1e9 + 7; const ll INF_LL = 1e18 + 7; #define __overload3(_1, _2, _3, name, ...) name #define rep(...) \ __overload3(__VA_ARGS__, repFromUntil, repUntil, repeat)(__VA_ARGS__) #define repeat(times) repFromUntil(__name, 0, times) #define repUntil(name, times) repFromUntil(name, 0, times) #define repFromUntil(name, from, until) \ for (int name = from, name##__until = (until); name < name##__until; name++) #define repFromTo(name, from, to) repFromUntil(name, from, to + 1) #define repr(...) \ __overload3(__VA_ARGS__, reprFromUntil, reprUntil, repeat)(__VA_ARGS__) #define reprUntil(name, times) reprFromUntil(name, 0, times) #define reprFromUntil(name, from, until) \ for (int name = until - 1, name##__from = (from); name >= name##__from; \ name--) #define reprFromTo(name, from, to) reprFromUntil(name, from, to + 1) #define debugos cout #ifdef LOCAL #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v); \ debugos << (v) << endl; \ } #define debugv(v) \ { \ printf("L%d %s > ", __LINE__, #v); \ for (auto e : (v)) { \ debugos << e << " "; \ } \ debugos << endl; \ } #define debuga(m, w) \ { \ printf("L%d %s > ", __LINE__, #m); \ for (int x = 0; x < (w); x++) { \ debugos << (m)[x] << " "; \ } \ debugos << endl; \ } #define debugaa(m, h, w) \ { \ printf("L%d %s >\n", __LINE__, #m); \ for (int y = 0; y < (h); y++) { \ for (int x = 0; x < (w); x++) { \ debugos << (m)[y][x] << " "; \ } \ debugos << endl; \ } \ } #else #define debug(v) \ {} #define debugv(v) \ {} #define debuga(m, w) \ {} #define debugaa(m, h, w) \ {} #endif #define newl "\n" #define all(iter) begin(iter), end(iter) #if defined(_WIN32) || defined(_WIN64) #define getchar_unlocked _getchar_nolock #define putchar_unlocked _putchar_nolock #elif defined(__GNUC__) #else #define getchar_unlocked getchar #define putchar_unlocked putchar #endif template <class T> inline bool chmin(T &var, T x) { if (var > x) { var = x; return true; } else return false; } template <class T> inline bool chmax(T &var, T x) { if (var < x) { var = x; return true; } else return false; } class MyScanner { public: template <typename T> void input_integer(T &var) { var = 0; T sign = 1; int cc = getchar_unlocked(); for (; cc < '0' || '9' < cc; cc = getchar_unlocked()) if (cc == '-') sign = -1; for (; '0' <= cc && cc <= '9'; cc = getchar_unlocked()) var = (var << 3) + (var << 1) + cc - '0'; var = var * sign; } inline int c() { return getchar_unlocked(); } inline MyScanner &operator>>(char &var) { var = c(); return *this; } inline MyScanner &operator>>(int &var) { input_integer<int>(var); return *this; } inline MyScanner &operator>>(ll &var) { input_integer<ll>(var); return *this; } inline MyScanner &operator>>(string &var) { int cc = getchar_unlocked(); for (; !isvisiblechar(cc); cc = getchar_unlocked()) ; for (; isvisiblechar(cc); cc = getchar_unlocked()) var.push_back(cc); return *this; } inline operator int() { int n; *this >> n; return n; } inline operator ll() { ll n; *this >> n; return n; } private: inline int isvisiblechar(int c) { return 0x21 <= c && c <= 0x7E; } }; class MyPrinter { public: template <typename T> void output_integer(T var) { if (var == 0) { putchar_unlocked('0'); return; } if (var < 0) putchar_unlocked('-'), var = -var; char stack[32]; int stack_p = 0; while (var) stack[stack_p++] = '0' + (var % 10), var /= 10; while (stack_p) putchar_unlocked(stack[--stack_p]); } inline MyPrinter &operator<<(char c) { putchar_unlocked(c); return *this; } inline MyPrinter &operator<<(int var) { output_integer<int>(var); return *this; } inline MyPrinter &operator<<(ll var) { output_integer<ll>(var); return *this; } inline MyPrinter &operator<<(char *str_p) { while (*str_p) putchar_unlocked(*(str_p++)); return *this; } inline MyPrinter &operator<<(const char *str_p) { while (*str_p) putchar_unlocked(*(str_p++)); return *this; } inline MyPrinter &operator<<(const string &str) { const char *p = str.c_str(); const char *l = p + str.size(); while (p < l) putchar_unlocked(*p++); return *this; } }; MyScanner IN; MyPrinter OUT; int main() { int a, b; char op; while (IN >> a >> b >> op, op != '?') OUT << (op == '+' ? a + b : op == '-' ? a - b : op == '*' ? a * b : op == '/' ? a / b : 0) << newl; }
#ifdef LOCAL #pragma GCC optimize("O0") #else #pragma GCC optimize("O3") #endif #include <bits/stdc++.h> using namespace std; using namespace std::placeholders; using ll = long long; const int INF = 1e9 + 7; const ll INF_LL = 1e18 + 7; #define __overload3(_1, _2, _3, name, ...) name #define rep(...) \ __overload3(__VA_ARGS__, repFromUntil, repUntil, repeat)(__VA_ARGS__) #define repeat(times) repFromUntil(__name, 0, times) #define repUntil(name, times) repFromUntil(name, 0, times) #define repFromUntil(name, from, until) \ for (int name = from, name##__until = (until); name < name##__until; name++) #define repFromTo(name, from, to) repFromUntil(name, from, to + 1) #define repr(...) \ __overload3(__VA_ARGS__, reprFromUntil, reprUntil, repeat)(__VA_ARGS__) #define reprUntil(name, times) reprFromUntil(name, 0, times) #define reprFromUntil(name, from, until) \ for (int name = until - 1, name##__from = (from); name >= name##__from; \ name--) #define reprFromTo(name, from, to) reprFromUntil(name, from, to + 1) #define debugos cout #ifdef LOCAL #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v); \ debugos << (v) << endl; \ } #define debugv(v) \ { \ printf("L%d %s > ", __LINE__, #v); \ for (auto e : (v)) { \ debugos << e << " "; \ } \ debugos << endl; \ } #define debuga(m, w) \ { \ printf("L%d %s > ", __LINE__, #m); \ for (int x = 0; x < (w); x++) { \ debugos << (m)[x] << " "; \ } \ debugos << endl; \ } #define debugaa(m, h, w) \ { \ printf("L%d %s >\n", __LINE__, #m); \ for (int y = 0; y < (h); y++) { \ for (int x = 0; x < (w); x++) { \ debugos << (m)[y][x] << " "; \ } \ debugos << endl; \ } \ } #else #define debug(v) \ {} #define debugv(v) \ {} #define debuga(m, w) \ {} #define debugaa(m, h, w) \ {} #endif #define newl "\n" #define all(iter) begin(iter), end(iter) #if defined(_WIN32) || defined(_WIN64) #define getchar_unlocked _getchar_nolock #define putchar_unlocked _putchar_nolock #elif defined(__GNUC__) #else #define getchar_unlocked getchar #define putchar_unlocked putchar #endif template <class T> inline bool chmin(T &var, T x) { if (var > x) { var = x; return true; } else return false; } template <class T> inline bool chmax(T &var, T x) { if (var < x) { var = x; return true; } else return false; } class MyScanner { public: template <typename T> void input_integer(T &var) { var = 0; T sign = 1; int cc = getchar_unlocked(); for (; cc < '0' || '9' < cc; cc = getchar_unlocked()) if (cc == '-') sign = -1; for (; '0' <= cc && cc <= '9'; cc = getchar_unlocked()) var = (var << 3) + (var << 1) + cc - '0'; var = var * sign; } inline int c() { return getchar_unlocked(); } inline MyScanner &operator>>(char &var) { var = c(); return *this; } inline MyScanner &operator>>(int &var) { input_integer<int>(var); return *this; } inline MyScanner &operator>>(ll &var) { input_integer<ll>(var); return *this; } inline MyScanner &operator>>(string &var) { int cc = getchar_unlocked(); for (; !isvisiblechar(cc); cc = getchar_unlocked()) ; for (; isvisiblechar(cc); cc = getchar_unlocked()) var.push_back(cc); return *this; } inline operator int() { int n; *this >> n; return n; } inline operator ll() { ll n; *this >> n; return n; } private: inline int isvisiblechar(int c) { return 0x21 <= c && c <= 0x7E; } }; class MyPrinter { public: template <typename T> void output_integer(T var) { if (var == 0) { putchar_unlocked('0'); return; } if (var < 0) putchar_unlocked('-'), var = -var; char stack[32]; int stack_p = 0; while (var) stack[stack_p++] = '0' + (var % 10), var /= 10; while (stack_p) putchar_unlocked(stack[--stack_p]); } inline MyPrinter &operator<<(char c) { putchar_unlocked(c); return *this; } inline MyPrinter &operator<<(int var) { output_integer<int>(var); return *this; } inline MyPrinter &operator<<(ll var) { output_integer<ll>(var); return *this; } inline MyPrinter &operator<<(char *str_p) { while (*str_p) putchar_unlocked(*(str_p++)); return *this; } inline MyPrinter &operator<<(const char *str_p) { while (*str_p) putchar_unlocked(*(str_p++)); return *this; } inline MyPrinter &operator<<(const string &str) { const char *p = str.c_str(); const char *l = p + str.size(); while (p < l) putchar_unlocked(*p++); return *this; } }; MyScanner IN; MyPrinter OUT; int main() { int a, b; char op; while (IN >> a >> op >> b, op != '?') OUT << (op == '+' ? a + b : op == '-' ? a - b : op == '*' ? a * b : op == '/' ? a / b : 0) << newl; }
replace
202
203
202
203
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> using namespace std; int main() { while (1) { int a, b; char op; cin >> a >> op >> b; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '/') { cout << a / b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '*') { break; } } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { while (1) { int a, b; char op; cin >> a >> op >> b; if (op == '+') { cout << a + b << endl; } else if (op == '-') { cout << a - b << endl; } else if (op == '/') { cout << a / b << endl; } else if (op == '*') { cout << a * b << endl; } else if (op == '?') { break; } } return 0; }
replace
18
19
18
19
TLE
p02401
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b; char op; while (cin >> a >> op >> b) { // '?' puts cin into an error state, to end switch (op) { case '+': a += b; break; case '-': a -= b; break; case '*': a *= b; break; case '/': a /= b; break; default: cout << "error" << endl; return -1; } cout << a << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b; char op; while (cin >> a >> op >> b && op != '?') { switch (op) { case '+': a += b; break; case '-': a -= b; break; case '*': a *= b; break; case '/': a /= b; break; default: cout << "error" << endl; return -1; } cout << a << endl; } return 0; }
replace
7
8
7
8
255
p02401
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define mod 1000000007 using namespace std; int main() { int a, b; char c; vector<int> ans; while (true) { cin >> a >> c >> b; if (a == 0 && b == 0 && c == '?') break; if (c == '+') ans.push_back(a + b); if (c == '-') ans.push_back(a - b); if (c == '*') ans.push_back(a * b); if (c == '/') ans.push_back(a / b); } rep(i, ans.size()) { cout << ans[i] << endl; } }
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define mod 1000000007 using namespace std; int main() { int a, b; char c; vector<int> ans; while (true) { cin >> a >> c >> b; if (c == '?') break; if (c == '+') ans.push_back(a + b); if (c == '-') ans.push_back(a - b); if (c == '*') ans.push_back(a * b); if (c == '/') ans.push_back(a / b); } rep(i, ans.size()) { cout << ans[i] << endl; } }
replace
16
17
16
17
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char op; while (1) { cin >> a >> b >> op; if (op == '?') break; if (op == '+') cout << a + b << endl; else if (op == '-') cout << a - b << endl; else if (op == '*') cout << a * b << endl; else if (op == '/') cout << a / b << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') cout << a + b << endl; else if (op == '-') cout << a - b << endl; else if (op == '*') cout << a * b << endl; else if (op == '/') cout << a / b << endl; } return 0; }
replace
8
9
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, i; char op; while (1) { cin >> a >> b >> op; if (op == '+') { i = a + b; cout << i << endl; } else if (op == '-') { i = a - b; cout << i << endl; } else if (op == '*') { i = a * b; cout << i << endl; } else if (op == '/') { i = a / b; cout << i << endl; } if (op == '?') { break; } } return 0; }
#include <iostream> using namespace std; int main() { int a, b, i; char op; while (1) { cin >> a >> op >> b; if (op == '+') { i = a + b; cout << i << endl; } else if (op == '-') { i = a - b; cout << i << endl; } else if (op == '*') { i = a * b; cout << i << endl; } else if (op == '/') { i = a / b; cout << i << endl; } if (op == '?') { break; } } return 0; }
replace
8
10
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op = '?') { int c; if (op == '+') c = a + b; if (op == '-') c = a - b; if (op == '*') c = a * b; if (op == '/') c = a / b; cout << c << endl; cin >> a >> op >> b; } }
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op != '?') { int c; if (op == '+') c = a + b; if (op == '-') c = a - b; if (op == '*') c = a * b; if (op == '/') c = a / b; cout << c << endl; cin >> a >> op >> b; } }
replace
6
7
6
7
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op != '?') { int c; if (op == '+') c = a + b; if (op == '-') c = a - b; if (op == '*') c = a * b; if (op == '/') c = a / b; cout << c << endl; } }
#include <iostream> using namespace std; int main() { int a, b; char op; cin >> a >> op >> b; while (op != '?') { int c; if (op == '+') c = a + b; if (op == '-') c = a - b; if (op == '*') c = a * b; if (op == '/') c = a / b; cout << c << endl; cin >> a >> op >> b; } }
insert
17
17
17
18
TLE
p02401
C++
Time Limit Exceeded
#include <cstdio> int main() { for (int i = 0;; i++) { int a, b, c; char op; scanf("%d%c%d", &a, &op, &b); if (op == '?') { break; } if (op == '+') { c = a + b; } if (op == '-') { c = a - b; } if (op == '*') { c = a * b; } if (op == '/') { c = a / b; } printf("%d\n", c); } return 0; }
#include <cstdio> int main() { for (int i = 0;; i++) { int a, b, c; char op; scanf("%d %c %d", &a, &op, &b); if (op == '?') { break; } if (op == '+') { c = a + b; } if (op == '-') { c = a - b; } if (op == '*') { c = a * b; } if (op == '/') { c = a / b; } printf("%d\n", c); } return 0; }
replace
7
8
7
8
TLE
p02401
C++
Time Limit Exceeded
#include <cstdio> using namespace std; int main(void) { int a, b; char op; while (1) { scanf("%d%c%d", &a, &op, &b); switch (op) { case '+': printf("%d\n", a + b); break; case '*': printf("%d\n", a * b); break; case '-': printf("%d\n", a - b); break; case '/': printf("%d\n", (int)((float)a / b)); break; } if (op == '?') { break; } } return 0; }
#include <cstdio> using namespace std; int main(void) { int a, b; char op; while (1) { scanf("%d %c %d", &a, &op, &b); switch (op) { case '+': printf("%d\n", a + b); break; case '*': printf("%d\n", a * b); break; case '-': printf("%d\n", a - b); break; case '/': printf("%d\n", (int)((float)a / b)); break; } if (op == '?') { break; } } return 0; }
replace
9
10
9
10
TLE
p02401
C++
Runtime Error
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> using namespace std; int main() { int x, y; char op; while (cin >> x >> op >> y) { if (op == '?') return -1; if (op == '+') cout << x + y << endl; if (op == '-') cout << x - y << endl; if (op == '*') cout << x * y << endl; if (op == '/' && y != 0) cout << x / y << endl; } }
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> using namespace std; int main() { int x, y; char op; while (cin >> x >> op >> y) { if (op == '?') break; if (op == '+') cout << x + y << endl; if (op == '-') cout << x - y << endl; if (op == '*') cout << x * y << endl; if (op == '/' && y != 0) cout << x / y << endl; } }
replace
12
14
12
13
255
p02401
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; char op; while (1) { cin >> a >> b >> op; if (op == '?') break; if (op == '+') cout << a + b << endl; else if (op == '-') cout << a - b << endl; else if (op == '*') cout << a * b << endl; else if (op == '/') cout << a / b << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a, b; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; if (op == '+') cout << a + b << endl; else if (op == '-') cout << a - b << endl; else if (op == '*') cout << a * b << endl; else if (op == '/') cout << a / b << endl; } return 0; }
replace
8
9
8
9
TLE
p02401
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { int a, b, p, m, k, w; char op; while (1) { cin >> a >> b >> op; if (op == '?') break; else if (op == '+') { p = a + b; cout << p << endl; } else if (op == '-') { m = a - b; cout << m << endl; } else if (op == '*') { k = a * b; cout << k << endl; } else if (op == '/') { w = a / b; cout << w << endl; } } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int a, b, p, m, k, w; char op; while (1) { cin >> a >> op >> b; if (op == '?') break; else if (op == '+') { p = a + b; cout << p << endl; } else if (op == '-') { m = a - b; cout << m << endl; } else if (op == '*') { k = a * b; cout << k << endl; } else if (op == '/') { w = a / b; cout << w << endl; } } return 0; }
replace
7
8
7
8
TLE
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[i]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; }
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[100000]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; }
replace
5
6
5
6
0
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[i]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[100000]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; return 0; }
replace
5
6
5
6
0
p02402
Python
Runtime Error
input() li = map(int, input().split()) print(min(li), max(li), sum(li))
input() li = list(map(int, input().split())) print(min(li), max(li), sum(li))
replace
1
2
1
2
ValueError: max() arg is an empty sequence
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s227796707.py", line 3, in <module> print(min(li), max(li), sum(li)) ValueError: max() arg is an empty sequence
p02402
Python
Runtime Error
n = int(input()) a = map(int, input().split()) print(min(a), max(a), sum(a))
n = int(input()) a = list(map(int, input().split())) print(min(a), max(a), sum(a))
replace
1
2
1
2
ValueError: max() arg is an empty sequence
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s610106422.py", line 3, in <module> print(min(a), max(a), sum(a)) ValueError: max() arg is an empty sequence
p02402
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { long long a, n, max; long long goukei = 0; long long min = 999999999; long long array[9999999]; cin >> n; for (;;) { for (a = 0; a < n; a++) cin >> array[a]; int max = array[0]; for (a = 0; a < n; a++) if (array[a] > max) max = array[a]; for (a = 0; a < n; a++) if (array[a] < min) min = array[a]; for (a = 0; a < n; a++) goukei += array[a]; cout << min << " " << max << " " << goukei << endl; break; } return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { long long a, n, max; long long goukei = 0; long long min = 999999999; long long array[1000000]; cin >> n; for (;;) { for (a = 0; a < n; a++) cin >> array[a]; int max = array[0]; for (a = 0; a < n; a++) if (array[a] > max) max = array[a]; for (a = 0; a < n; a++) if (array[a] < min) min = array[a]; for (a = 0; a < n; a++) goukei += array[a]; cout << min << " " << max << " " << goukei << endl; break; } return 0; }
replace
10
11
10
11
-11
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[100]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, i, max, min; long long sum = 0; int a[10000]; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; return 0; }
replace
5
6
5
6
0
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, i, a[1000], b, c, d, min = 1000000, max = -1000000, sum = 0; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; if (a[i] < min) { min = a[i]; } if (a[i] > max) { max = a[i]; } sum += a[i]; } cout << min << " " << max << " " << sum << endl; }
#include <iostream> using namespace std; int main() { long long n, i, a[10000], min = 1000000, max = -1000000, sum = 0; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; if (a[i] < min) { min = a[i]; } if (a[i] > max) { max = a[i]; } sum += a[i]; } cout << min << " " << max << " " << sum << endl; }
replace
3
4
3
4
0
p02402
C++
Runtime Error
#include <cstdio> #include <iostream> #include <stdio.h> using namespace std; int main() { long a, b[100000000]; long max, min, sum = 0; cin >> a; for (int i = 0; i < a; i++) { cin >> b[i]; if (i == 0) { min = b[i]; max = b[i]; } if (b[i] < min) { min = b[i]; } else if (max < b[i]) { max = b[i]; } sum += b[i]; } cout << min << " " << max << " " << sum << endl; return 0; }
#include <cstdio> #include <iostream> #include <stdio.h> using namespace std; int main() { int a, b[10001]; long long int max, min, sum = 0; cin >> a; for (int i = 0; i < a; i++) { cin >> b[i]; if (i == 0) { min = b[i]; max = b[i]; } if (b[i] < min) { min = b[i]; } else if (max < b[i]) { max = b[i]; } sum += b[i]; } cout << min << " " << max << " " << sum << endl; return 0; }
replace
6
8
6
8
-11
p02402
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main() { long sum = 0; long fra[10000]; int n; // 上限'n'の入力 cin >> n; // 配列fra[]に値を代入、合計値sumに加算 for (int i = 0; i < n; i++) { cin >> fra[i]; sum = sum + fra[i]; } while (1) { int flag = 0; // ソート本体 for (int i = 0; i < n; i++) { if (fra[i - 1] > fra[i] && i > 0 && i < n) { swap(fra[i - 1], fra[i]); } } // ソート判定 int count = 0; for (int i = 0; i < n; i++) { if (fra[i - 1] < fra[i] && i > 0) { count++; } if (count == n - 1) { flag = 1; } } if (flag == 1) break; } cout << fra[0] << " " << fra[n - 1] << " " << sum << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { long sum = 0; long fra[10000]; int n; // 上限'n'の入力 cin >> n; // 配列fra[]に値を代入、合計値sumに加算 for (int i = 0; i < n; i++) { cin >> fra[i]; sum = sum + fra[i]; } while (1) { int flag = 0; // ソート本体 for (int i = 0; i < n; i++) { if (fra[i - 1] > fra[i] && i > 0 && i < n) { swap(fra[i - 1], fra[i]); } } // ソート判定 int count = 0; for (int i = 0; i < n; i++) { if (fra[i - 1] <= fra[i] && i > 0) { count++; } if (count == n - 1) { flag = 1; } } if (flag == 1) break; } cout << fra[0] << " " << fra[n - 1] << " " << sum << endl; return 0; }
replace
29
30
29
30
TLE
p02402
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[10000]; for (int i = 0; 1 < n; i++) cin >> a[i]; int mn = a[0], mx = a[0]; long long sum = 0; for (int i = 0; i < n; i++) { mn = min(mn, a[i]); mx = max(mx, a[i]); sum += a[i]; } cout << mn << " " << mx << " " << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[10000]; for (int i = 0; i < n; i++) cin >> a[i]; int mn = a[0], mx = a[0]; long long sum = 0; for (int i = 0; i < n; i++) { mn = min(mn, a[i]); mx = max(mx, a[i]); sum += a[i]; } cout << mn << " " << mx << " " << sum << endl; return 0; }
replace
9
10
9
10
TLE
p02402
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> using namespace std; long long a, n, smallest, biggest, sum; char op; int main() { cin >> n; smallest = 0; biggest = 0; sum = 0; for (int i = 0; i + 1 <= n; i++) { cin >> a; if (i == 0 || a < smallest) { smallest = a; } if (i = 0 || a > biggest) { biggest = a; } sum += a; } cout << smallest << " " << biggest << " " << sum << endl; return 0; }
#include <iomanip> #include <iostream> using namespace std; long long a, n, smallest, biggest, sum; char op; int main() { cin >> n; smallest = 0; biggest = 0; sum = 0; for (int i = 0; i + 1 <= n; i++) { cin >> a; if (i == 0 || a < smallest) { smallest = a; } if (i == 0 || a > biggest) { biggest = a; } sum += a; } cout << smallest << " " << biggest << " " << sum << endl; return 0; }
replace
24
25
24
25
TLE
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, a[100], i, x, sum = 0, max = 0, min = 10000; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; if (a[i] > max) { max = a[i]; } if (a[i] < min) { min = a[i]; } } cout << min << " " << max << " " << sum << endl; // What Japanese people!? return 0; }
#include <iostream> using namespace std; int main() { int n, a[10000], i, x; long long sum = 0, max = -1000000, min = 1000000; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; if (a[i] > max) { max = a[i]; } if (a[i] < min) { min = a[i]; } } cout << min << " " << max << " " << sum << endl; // What Japanese people!? return 0; }
replace
3
4
3
5
0
p02402
Python
Runtime Error
input() a = list(map(int, input().split())) s = 0 for i in len(a): s = s + i print(min(a), max(a), s)
input() a = list(map(int, input().split())) s = 0 for i in a: s = s + i print(min(a), max(a), s)
replace
6
7
6
7
TypeError: 'int' object is not iterable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02402/Python/s130438338.py", line 7, in <module> for i in len(a): TypeError: 'int' object is not iterable
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { long long a[1000] = {0}; int n; long long min; long long max; int i; long long sum = 0; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } min = a[0]; for (i = 0; i < n; i++) { if (min > a[i]) min = a[i]; } for (i = 0; i < n; i++) { cin >> a[i]; } max = a[0]; for (i = 0; i < n; i++) { if (max < a[i]) max = a[i]; } for (i = 0; i < n; i++) sum = sum + a[i]; cout << min; cout << " "; cout << max; cout << " "; cout << sum; cout << endl; }
#include <iostream> using namespace std; int main(void) { long long a[10001] = {0}; int n; long long min; long long max; int i; long long sum = 0; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } min = a[0]; for (i = 0; i < n; i++) { if (min > a[i]) min = a[i]; } for (i = 0; i < n; i++) { cin >> a[i]; } max = a[0]; for (i = 0; i < n; i++) { if (max < a[i]) max = a[i]; } for (i = 0; i < n; i++) sum = sum + a[i]; cout << min; cout << " "; cout << max; cout << " "; cout << sum; cout << endl; }
replace
3
4
3
4
0
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n, i, a[1000], max, min, sum; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; } sum = a[1]; min = a[1]; max = a[1]; for (i = 2; i <= n; i++) { sum = sum + a[i]; if (a[i] < min) min = a[i]; if (a[i] > max) max = a[i]; }; cout << min << " " << max << " " << sum << endl; return 0; }
#include <iostream> using namespace std; int main(void) { long n, i, a[10001], max, min, sum; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; } sum = a[1]; min = a[1]; max = a[1]; for (i = 2; i <= n; i++) { sum = sum + a[i]; if (a[i] < min) min = a[i]; if (a[i] > max) max = a[i]; }; cout << min << " " << max << " " << sum << endl; return 0; }
replace
4
5
4
5
0
p02402
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define shosu(n) setprecision(n) using namespace std; int main() { int n, sum = 0, a[100000000]; cin >> n; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n); cout << a[0] << ' ' << a[n - 1] << ' ' << sum << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define shosu(n) setprecision(n) using namespace std; int main() { long long n, sum = 0, a[10000]; cin >> n; rep(i, n) { cin >> a[i]; sum += a[i]; } sort(a, a + n); cout << a[0] << ' ' << a[n - 1] << ' ' << sum << endl; return 0; }
replace
5
6
5
6
-11
p02402
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[1000]; for (int i = 0; i < n; i++) cin >> a[i]; int mn = a[0]; int mx = a[0]; long long sum = 0; for (int i = 0; i < n; i++) { mn = min(mn, a[i]); mx = max(mx, a[i]); sum += a[i]; } cout << mn << " " << mx << " " << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[10000]; for (int i = 0; i < n; i++) cin >> a[i]; int mn = a[0]; int mx = a[0]; long long sum = 0; for (int i = 0; i < n; i++) { mn = min(mn, a[i]); mx = max(mx, a[i]); sum += a[i]; } cout << mn << " " << mx << " " << sum << endl; return 0; }
replace
6
7
6
7
0
p02402
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n, max, min; long long sum = 0; int a[1000]; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; }
#include <iostream> using namespace std; int main() { int n, max, min; long long sum = 0; int a[10001]; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; sum = sum + a[i]; if (i == 1) { max = a[i]; min = a[i]; } else { if (max < a[i]) { max = a[i]; } if (min > a[i]) { min = a[i]; } } } cout << min << " " << max << " " << sum << endl; }
replace
5
6
5
6
0
p02403
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int h; int w; int a; while (true) { h = 3; w = 4; if (h == 0 && w == 0) break; while (h > 0) { a = w; while (a > 0) { cout << "#"; a--; } cout << endl; h--; } cout << endl; } return 0; }
#include <iostream> using namespace std; int main() { int h; int w; int a; while (true) { cin >> h >> w; if (h == 0 && w == 0) break; while (h > 0) { a = w; while (a > 0) { cout << "#"; a--; } cout << endl; h--; } cout << endl; } return 0; }
replace
8
10
8
9
TLE
p02403
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, j; while (cin >> a >> b, a || b) { for (; a; a--) { for (j = b; j; j++) cout << "#"; cout << endl; } cout << endl; } }
#include <iostream> using namespace std; int main() { int a, b, j; while (cin >> a >> b, a || b) { for (; a; a--) { for (j = b; j; j--) cout << "#"; cout << endl; } cout << endl; } }
replace
6
7
6
7
TLE
p02403
C++
Time Limit Exceeded
#include <iostream> int main(int argc, char const *argv[]) { int h, w; std::cin >> h >> w; while (!(h == 0 && h == w)) { for (int i = 0; i < h; i++) { for (int i = 0; i < w; i++) { std::cout << "#"; } std::cout << std::endl; } } return 0; }
#include <iostream> int main(int argc, char const *argv[]) { int h, w; std::cin >> h >> w; while (!(h == 0 && h == w)) { for (int i = 0; i < h; i++) { for (int i = 0; i < w; i++) { std::cout << "#"; } std::cout << std::endl; } std::cout << std::endl; std::cin >> h >> w; } return 0; }
insert
12
12
12
14
TLE