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
p02817
Python
Runtime Error
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(500000) s, t = map(str, input().split()) print(f"{t}{s}")
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(500000) s, t = map(str, input().split()) print("{}{}".format(t, s))
replace
9
10
9
10
0
p02817
Python
Runtime Error
S, T = map(str, input().split()) print(T + S).split("")
S, T = input().split() print(T + S)
replace
0
2
0
2
AttributeError: 'NoneType' object has no attribute 'split'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02817/Python/s359614518.py", line 2, in <module> print(T + S).split('') AttributeError: 'NoneType' object has no attribute 'split'
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define For(i, n, k) for (ll i = (n); i < (k); i++) #define ALL(a) (a).begin(), (a).end() string n, m, ans = 0; void Main() { cin >> n >> m; cout << m << n << endl; } int main() { Main(); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define For(i, n, k) for (ll i = (n); i < (k); i++) #define ALL(a) (a).begin(), (a).end() string n, m; void Main() { cin >> n >> m; cout << m << n << endl; } int main() { Main(); return 0; }
replace
5
6
5
6
-6
terminate called after throwing an instance of 'std::logic_error' what(): basic_string: construction from null is not valid
p02817
Python
Runtime Error
s, t = map(int, input().split()) print(s + t)
s, t = input().split() print(t + s)
replace
0
2
0
2
ValueError: invalid literal for int() with base 10: 'oder'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02817/Python/s795282831.py", line 1, in <module> s, t = map(int, input().split()) ValueError: invalid literal for int() with base 10: 'oder'
p02817
C++
Runtime Error
#include <stdio.h> int main() { char nama1[9]; char nama2[13]; scanf("%s", &nama1); scanf("%s", &nama2); printf("%s%s", nama2, nama1); return 0; }
#include <stdio.h> int main() { char S[100], T[100]; scanf("%s %s", &S, &T); printf("%s%s\n", T, S); return 0; }
replace
3
11
3
6
0
p02817
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #include <string.h> void delete_space(char *x) { while (*x != '\0') { if (*x == '\n') { *x = '\0'; } x++; } } int main() { char s[100], t[200]; scanf("%s %s", &s, &t); delete_space(s); delete_space(t); strcat(t, s); printf("%s", t); return...
#include <stdio.h> #include <stdlib.h> #include <string.h> void delete_space(char *x) { while (*x != '\0') { if (*x == '\n') { *x = '\0'; } x++; } } int main() { char s[256], t[256]; scanf("%s %s", &s, &t); delete_space(s); delete_space(t); strcat(t, s); printf("%s", t); return...
replace
14
15
14
15
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define for1(i, n) for (int i = 1; i <= (int)n; ++i) #define forr(i, n) for (int i = (int)n - 1;...
#include <bits/stdc++.h> using namespace std; #define FIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define forn(i, n) for (int i = 0; i < (int)n; ++i) #define for1(i, n) for (int i = 1; i <= (int)n; ++i) #define forr(i, n) for (int i = (int)n - 1;...
replace
66
67
66
67
0
p02817
C++
Runtime Error
#include <iostream> #include <string.h> using namespace std; void function(char *s, char *t) { strcat(t, s); cout << t << endl; } int main() { char s[50]; char t[50]; cin >> s; cin >> t; function(s, t); return 0; }
#include <iostream> #include <string.h> using namespace std; void function(char *s, char *t) { strcat(t, s); cout << t << endl; } int main() { char s[500]; char t[500]; cin >> s; cin >> t; function(s, t); return 0; }
replace
10
12
10
12
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <string> #define UB upper_bound #define LB lower_bound #define BS binary_search #define IN insert #define PB push_back #define EB emplace_back #define MP make_pair #define NL cout << endl #define ll long long int #define ld long double #define vl vector<ll> #define ...
#include <bits/stdc++.h> #include <iostream> #include <string> #define UB upper_bound #define LB lower_bound #define BS binary_search #define IN insert #define PB push_back #define EB emplace_back #define MP make_pair #define NL cout << endl #define ll long long int #define ld long double #define vl vector<ll> #define ...
replace
38
42
38
39
0
p02817
C++
Runtime Error
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //* vamsicool007 You are never wrong to do the right thing vamsicool007 * //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #include <bits/stdc++.h> using namespace std; #define flash ...
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //* vamsicool007 You are never wrong to do the right thing vamsicool007 * //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #include <bits/stdc++.h> using namespace std; #define flash ...
delete
68
73
68
68
0
p02817
C++
Runtime Error
#include <stdio.h> #include <string.h> int main(void) { char S[110]; char T[110]; scanf("%s", S); scanf("%s", T); printf("%s\n", strcat(T, S)); return 0; }
#include <stdio.h> #include <string.h> int main(void) { char S[110]; char T[110]; scanf("%s", S); scanf("%s", T); printf("%s%s\n", T, S); return 0; }
replace
8
9
8
9
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; for (int i = 0; i < S.size(); i++) { cout << T.at(i) << S.at(i); } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; cout << T << S << endl; }
replace
6
10
6
7
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { /*ll t; cin>>t; while(t--)*/ char s[101], t[101]; cin >> s >> t; strcat(t, s); cout << t; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { /*ll t; cin>>t; while(t--)*/ char s[101], t[203]; cin >> s >> t; strcat(t, s); cout << t; return 0; }
replace
7
8
7
8
0
p02817
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { char s[100], t[100]; scanf("%s%s", s, t); strcat(t, s); printf("%s", t); return 0; }
#include <stdio.h> #include <string.h> int main() { char s[100], t[100]; scanf("%s%s", s, t); // strcat(t, s); printf("%s%s", t, s); return 0; }
replace
6
8
6
8
0
p02817
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <vector> using namespace std; int main() { char s[200], t[200]; cin >> s >> t; cout << strcat(t, s) << endl; }
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <vector> using namespace std; int main() { char s[205], t[205]; cin >> s >> t; cout << strcat(t, s) << endl; }
replace
12
13
12
13
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { char s[200], t[200]; scanf("%s%s", &s, &t); strcat(t, s); printf("%s", t); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s[200], t[200]; scanf("%s%s", &s, &t); printf("%s%s", t, s); return 0; }
replace
6
8
6
7
0
p02817
C++
Runtime Error
#include <stdio.h> int main() { char stringa[20]; char stringb[15]; scanf("%s %s", &stringa, &stringb); printf("%s%s", stringb, stringa); return 0; }
#include <stdio.h> int main() { char stringa[120]; char stringb[120]; scanf("%s %s", &stringa, &stringb); printf("%s%s", stringb, stringa); return 0; }
replace
3
5
3
5
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); char s[105], t[105]; cin >> s >> t; strcat(t, s); cout << t << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); char s[105], t[210]; cin >> s >> t; strcat(t, s); cout << t << endl; return 0; }
replace
7
8
7
8
0
p02817
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { char S[100], T[100]; scanf("%s%s", &S, &T); strcat(T, S); printf("%s", T); return 0; }
#include <stdio.h> #include <string.h> int main() { char S[255], T[255]; scanf("%s%s", S, T); strcat(T, S); printf("%s", T); return 0; }
replace
4
6
4
6
0
p02817
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using llint = long long; using vint = vector<int>; using vvint = vector<vector<int>>; const int INF = 1e9; const llint llINF = 1e18; int main() { char s[120...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using llint = long long; using vint = vector<int>; using vvint = vector<vector<int>>; const int INF = 1e9; const llint llINF = 1e18; int main() { char s[400...
replace
14
15
14
15
0
p02817
C++
Runtime Error
// AnkitCode99 #include <bits/stdc++.h> #define endl "\n" #define ll long long int #define MOD 1000000007 #define mp make_pair #define pb push_back #define all(v) (v.begin(), v.end()) #define fast \ ios_base::sync_with_stdio(0); ...
// AnkitCode99 #include <bits/stdc++.h> #define endl "\n" #define ll long long int #define MOD 1000000007 #define mp make_pair #define pb push_back #define all(v) (v.begin(), v.end()) #define fast \ ios_base::sync_with_stdio(0); ...
delete
17
21
17
17
0
p02817
C++
Runtime Error
#include <cstring> #include <iostream> using namespace std; int main() { char a[100], b[100]; cin >> a >> b; printf(strcat(b, a)); }
#include <cstring> #include <iostream> using namespace std; int main() { char a[10000], b[10000]; cin >> a >> b; printf(strcat(b, a)); }
replace
4
5
4
5
0
p02817
C++
Runtime Error
#include <stdio.h> #include <string.h> #define N 105 int main() { char S[N], T[N]; while (scanf("%s%s", S, T) != EOF) { strcat(T, S); printf("%s\n", T); } return 0; }
#include <stdio.h> #include <string.h> #define N 105 int main() { char S[N], T[210]; while (scanf("%s%s", S, T) != EOF) { strcat(T, S); printf("%s\n", T); } return 0; }
replace
4
5
4
5
0
p02817
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { char S[200], T[200]; scanf("%s %s", S, T); // strcat(T, S); printf("%s", strcat(T, S)); return 0; }
#include <stdio.h> #include <string.h> int main() { char S[205], T[205]; scanf("%s %s", S, T); // strcat(T, S); printf("%s", strcat(T, S)); return 0; }
replace
3
4
3
4
0
p02817
C++
Runtime Error
#include <stdio.h> int main() { char name[20]; char list[20]; scanf("%s %s", &name, &list); printf("%s%s", list, name); return 0; }
#include <stdio.h> int main() { char S[101]; char T[101]; scanf("%s %s", &S, &T); printf("%s%s", T, S); return 0; }
replace
2
6
2
6
0
p02817
C++
Runtime Error
#include <stdio.h> int main() { char s[10]; char t[10]; scanf("%s %s", s, t); printf("%s%s\n", t, s); return 0; }
#include <stdio.h> int main() { char s[105]; char t[105]; scanf("%s %s", &s, &t); printf("%s%s\n", t, s); return 0; }
replace
2
5
2
6
0
p02817
C++
Runtime Error
#include <stdio.h> int main() { char S[88], T[88]; scanf("%s %s", S, T); printf("%s %S\n", S, T); return 0; }
#include <stdio.h> int main() { char S[150]; char T[150]; scanf("%s", &S); scanf("%s", &T); printf("%s", T); printf("%s", S); return 0; }
replace
2
6
2
8
0
p02817
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <stack> using namespace std; typedef long long ll; int main() { char s[101], t[101]; scanf("%s", s); scanf("%s", t); printf("%s", strcat(t, s)); }
#include <algorithm> #include <cstring> #include <iostream> #include <stack> using namespace std; typedef long long ll; int main() { char s[101], t[101]; scanf("%s", s); scanf("%s", t); printf("%s%s", t, s); }
replace
12
13
12
13
0
p02817
C++
Runtime Error
/* * * Bismillah Hir Rahman Nir Raheem * Name: Jaied Al Sabid * */ #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { string s, t, r; cin >> s >> t; r += t[0]; r += t[1]; r += t.substr(2); r += s; cout << r << endl; return 0; }
/* * * Bismillah Hir Rahman Nir Raheem * Name: Jaied Al Sabid * */ #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int main() { string s, t, r; cin >> s >> t; cout << t << s << endl; return 0; }
replace
18
24
18
19
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif string s, t; cin >> s >> t; cout << t + s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; cout << t + s << endl; }
delete
5
12
5
5
0
p02817
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string strN, strM; cin >> strN >> strM; for (int i = 0; i < 100; i++) { cout << strM.at(i) << strN.at(i); } }
#include <bits/stdc++.h> using namespace std; int main() { string strN, strM; cin >> strN >> strM; cout << strM << strN; }
replace
6
9
6
7
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02817
Python
Runtime Error
s, t = list(input().split().rstrip()) print(t + s)
s, t = input().rstrip().split() print(t + s)
replace
0
1
0
1
AttributeError: 'list' object has no attribute 'rstrip'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02817/Python/s248204703.py", line 1, in <module> s, t = list(input().split().rstrip()) AttributeError: 'list' object has no attribute 'rstrip'
p02817
Python
Runtime Error
In = list(map(int, input().split())) sin = set(In) print("Yes" if len(sin) == 2 else "No")
S, T = input().split() print(T + S)
replace
0
3
0
2
ValueError: invalid literal for int() with base 10: 'oder'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02817/Python/s961214447.py", line 1, in <module> In = list(map(int, input().split())) ValueError: invalid literal for int() with base 10: 'oder'
p02817
Python
Runtime Error
S = input() T = input() print(T + S)
s, t = input().split() ans = t + s print(ans)
replace
0
3
0
3
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02817/Python/s790047642.py", line 2, in <module> T = input() EOFError: EOF when reading a line
p02818
C++
Time Limit Exceeded
#include <bits/extc++.h> #include <bits/stdc++.h> using namespace std; #define endl '\n' #define FAST \ ios::sync_with_stdio(0); \ cin.tie(0); #define _ << ' ' << using ll = long long int; signed m...
#include <bits/extc++.h> #include <bits/stdc++.h> using namespace std; #define endl '\n' #define FAST \ ios::sync_with_stdio(0); \ cin.tie(0); #define _ << ' ' << using ll = long long int; signed m...
replace
13
21
13
23
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long A, B, K; cin >> A >> B >> K; for (long i = 0; i < K; i++) { if (A >= 1) { A -= 1; } else if (B >= 1) { B -= 1; } } cout << A << " " << B << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long A, B, K; cin >> A >> B >> K; long temp = A; if (K >= A) { A = 0; } else if (K < A) { A -= K; } if (A == 0) { B -= (K - temp); } if (B < 0) { B = 0; } cout << A << " " << B << "\n"; return 0; }
replace
6
12
6
17
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, K; cin >> A >> B >> K; for (int i = 0; i < K; i++) { if (A > 0) { --A; } else if (A == 0 && B > 0) { --B; } else if (A == 0 && B == 0) { break; } } cout << A << " " << B << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, K; cin >> A >> B >> K; if (A > K) { A = A - K; } else if (A + B <= K) { A = 0; B = 0; } else { B -= K - A; A = 0; } cout << A << " " << B << endl; }
replace
6
14
6
14
TLE
p02818
Python
Time Limit Exceeded
A, B, K = [int(_) for _ in input().split()] for i in range(K): if A >= 1: A -= 1 elif B >= 1: B -= 1 print(A, B)
A, B, K = [int(_) for _ in input().split()] if A >= K: print(A - K, B) else: print(0, max(0, B - (K - A)))
replace
1
7
1
5
TLE
p02818
Python
Runtime Error
a, b, k = list(map(int, input().split())) a_ans = a - min(a, k) if a_ans == 0: b_ans = b - min(b, k - a) print("{} {}".format(a_ans, b_ans))
a, b, k = list(map(int, input().split())) a_ans = a - min(a, k) if a_ans == 0: b_ans = b - min(b, k - a) else: b_ans = b print("{} {}".format(a_ans, b_ans))
insert
4
4
4
6
0
p02818
Python
Runtime Error
a, b, k = input().split() print(max(a - k, 0), b - max(k - a, 0))
a, b, k = map(int, input().split()) print(max(a - k, 0), max(b - max(k - a, 0), 0))
replace
0
2
0
2
TypeError: unsupported operand type(s) for -: 'str' and 'str'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02818/Python/s417489568.py", line 2, in <module> print(max(a - k, 0), b - max(k - a, 0)) TypeError: unsupported operand type(s) for -: 'str' and 'str'
p02818
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #define...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #define...
replace
89
93
89
93
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define chinko long long using namespace std; int main() { chinko a, b, k; cin >> a >> b >> k; for (chinko i = 0; i < k; i++) { if (a > 0) a--; else if (b > 0) b--; else ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define chinko long long using namespace std; int main() { chinko a, b, k; cin >> a >> b >> k; if (k < a) cout << a - k << " " << b << endl; else if (k <= a + b) cout << 0 << " " << b...
replace
12
21
12
20
TLE
p02818
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll a, b, k; cin >> a >> b >> k; if (k >= a) { k -= a; a = 0; if (k >= b...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); /*#ifndef ONLINE_JUDGE freopen ("input.txt", "r", stdin); freopen ("output.txt", "w", stdout); #endif */ ll a, b, k; cin >> a >> b >> k; if (k >= a) { k -= a; a = 0; ...
replace
8
13
8
13
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; while (K > 0) { if (A > 0) { A--; } else if (B > 0) { B--; } K--; } cout << A << " " << B << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; if (A >= K) { A = A - K; } else if (B >= K - A) { B = B - (K - A); A = 0; } else { A = 0; B = 0; } cout << A << " " << B << endl; }
replace
8
15
8
16
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; while (K--) { if (A) A--; else if (B) B--; } cout << A << " " << B; }
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; cout << max(0LL, A - K) << " " << (K - A < 0 ? B : max(0LL, B - (K - A))); }
replace
6
15
6
7
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; for (long long i = 0; i < k; i++) { if (a >= 1) a--; else if (b >= 1) b--; } cout << a << " " << b; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; if (a >= k) cout << a - k << " " << b << endl; else if (a + b >= k) cout << 0 << " " << b - k + a << endl; else cout << 0 << " " << 0 << endl; }
replace
7
14
7
13
TLE
p02818
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long a, b, k; long long ans; int main() { cin >> a >> b >> k; if (a / k == 0) { if ((b - (k - a)) > 0) { cout << 0 << " " << b - (k - a) << endl; } else { cout << 0 << " " << 0 << endl; } } else { cout << a - k << " " << b << endl;...
#include <bits/stdc++.h> using namespace std; long long a, b, k; long long ans; int main() { cin >> a >> b >> k; if ((a - k) <= 0) { if ((b - (k - a)) > 0) { cout << 0 << " " << b - (k - a) << endl; } else { cout << 0 << " " << 0 << endl; } } else { cout << a - k << " " << b << end...
replace
10
11
10
11
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int taka, ao, k; cin >> taka >> ao >> k; if (k >= ao + taka) cout << 0 << " " << 0; else { while (k > 0) { if (taka > 0) taka--; else { if (ao > 0) ao--; } k--; if (taka == 0) { ...
#include <bits/stdc++.h> using namespace std; int main() { long long int taka, ao, k; cin >> taka >> ao >> k; if (k >= ao + taka) cout << 0 << " " << 0; else { if (k <= taka) { taka = taka - k; } else { k = k - taka; taka = 0; if (k >= ao) { ao = 0; } else ...
replace
8
21
8
17
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { long long int A, B, K; cin >> A >> B >> K; for (long long int i = 0; i < K; i++) { if (A > 0) { A--; } else if (B > 0) { B--; } ...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { long long int A, B, K; cin >> A >> B >> K; // 2 3 3 if (A >= K) { A -= K; } else if (A + B >= K) { B -= K - A; A = 0; } else { A = 0;...
replace
11
18
11
20
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
replace
49
55
49
52
TLE
p02818
Python
Time Limit Exceeded
import sys input = sys.stdin.readline INF = float("inf") def main(): A, B, K = map(int, input().split()) for _ in range(K): if A > 0: A -= 1 elif B > 0: B -= 1 print(A, B) if __name__ == "__main__": main()
import sys input = sys.stdin.readline INF = float("inf") def main(): A, B, K = map(int, input().split()) if A <= K: print(0, max(0, B - K + A)) else: print(A - K, B) if __name__ == "__main__": main()
replace
10
16
10
14
TLE
p02818
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> using namespace std; int syc(long i, long Min, long Max) { if (Min <= i && i <= Max) { return 1; } else { exit(1); // return 0; } } int main() { long long a, b, k; long long x, y; ...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> using namespace std; int syc(long i, long Min, long Max) { if (Min <= i && i <= Max) { return 1; } else { exit(1); // return 0; } } int main() { long long a, b, k; long long x, y; ...
replace
21
24
21
24
0
p02818
C++
Time Limit Exceeded
#include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <string> #include <vector> using ll = long long; int main() { ll a, b, k; cin >> a >> b >> k; rep(i, k) { if (a >= 1) a -= 1; el...
#include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <string> #include <vector> using ll = long long; int main() { ll a, b, k; cin >> a >> b >> k; if (a >= k) cout << a - k << " " << b; els...
replace
14
23
14
22
TLE
p02818
C++
Runtime Error
// Nihal Mittal - nihal_47 // Strike First , Strike Hard , No Mercy !! /**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀ ⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀ ⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀ ⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀ ⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀ ⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀ ⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀ ⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀...
// Nihal Mittal - nihal_47 // Strike First , Strike Hard , No Mercy !! /**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀ ⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀ ⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀ ⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀ ⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀ ⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀ ⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀ ⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀...
replace
46
50
46
47
0
p02818
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long a, b, k; cin >> a >> b >> k; for (long i = 0; i < k; i++) { if (a > 0) { a--; } else if (b > 0) { b--; } } cout << a << " " << b; return 0; }
#include <iostream> using namespace std; int main() { long a, b, k; cin >> a >> b >> k; if (a < k) { k -= a; a = 0; b = (b < k) ? 0 : b - k; } else { a -= k; } cout << a << " " << b; return 0; }
replace
8
14
8
14
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long A, B, K; cin >> A >> B >> K; while (K > 0) { if (A > 0) { A--; K--; continue; } else if (B > 0) { B--; K--; continue; } else { break; } } cout << A << " " << B << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long A, B, K; cin >> A >> B >> K; if (A >= K) { A -= K; } else if (B >= K - A) { B -= K - A; A = 0; } else { A = 0; B = 0; } cout << A << " " << B << endl; }
replace
5
17
5
13
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long int #define fi first #define se second #define pb push_back #define soo(v) sort(v.rbegin(), v.rend()) #define so(v) sort(v.begin(), v.end()) #define lb(v, x) lower_bound(v.begin(), v.end(), x) #define ub(v, x) upper_bound(v.begin(), v.end(), x) #define...
#include <bits/stdc++.h> using namespace std; #define int long long int #define fi first #define se second #define pb push_back #define soo(v) sort(v.rbegin(), v.rend()) #define so(v) sort(v.begin(), v.end()) #define lb(v, x) lower_bound(v.begin(), v.end(), x) #define ub(v, x) upper_bound(v.begin(), v.end(), x) #define...
replace
62
70
62
66
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP2(i, n) for (int i = 1; i <= (int)(n); i++) #define FOR(i, m, n) for (int i = m; i n; i++) #define SORT(x) sort(x.begin(), x.end()) #define REVE(x) reverse(x.begin(), x.end()) #define ALL(...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP2(i, n) for (int i = 1; i <= (int)(n); i++) #define FOR(i, m, n) for (int i = m; i n; i++) #define SORT(x) sort(x.begin(), x.end()) #define REVE(x) reverse(x.begin(), x.end()) #define ALL(...
replace
21
31
21
27
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define rep(i, start, end) for (int i = start; i < (int)(end); ++i) int main() { long long a, b, k; cin >> a >> b >> k; for (long i = 0; i < k; i++) { if (0 < a) { ...
#include <bits/stdc++.h> using namespace std; typedef long long unsigned int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define rep(i, start, end) for (int i = start; i < (int)(end); ++i) int main() { long long a, b, k; cin >> a >> b >> k; if (a <= k) { k -= a; a = 0; b = max(0ll,...
replace
11
17
11
17
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; for (long long count = 0; count < k; count++) { if (a > 0) { a--; } else if (b > 0) { b--; } else { break; } } cout << a << " " << b << endl; return 0; }
#include <iostream> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; if (k <= a) { a -= k; } else if (k <= a + b) { b -= k - a; a = 0; } else { a = 0; b = 0; } cout << a << " " << b << endl; return 0; }
replace
8
16
8
16
TLE
p02818
Python
Time Limit Exceeded
a, b, k = map(int, input().split()) for _ in range(k): if a >= 1: a -= 1 elif b >= 1: b -= 1 print(a, b)
a, b, k = map(int, input().split()) if k >= a: b -= k - a a = 0 else: a -= k print(max(a, 0), max(b, 0))
replace
1
7
1
7
TLE
p02818
Python
Runtime Error
a, b, k = (int(i) for i in input().split()) takahashi = a - k aoki = b + takahashi if takahashi < 0 else b print(f"{max(takahashi, 0)} {max(aoki, 0)}")
a, b, k = (int(i) for i in input().split()) takahashi = a - k aoki = b + takahashi if takahashi < 0 else b print("{} {}".format(max(takahashi, 0), max(aoki, 0)))
replace
3
4
3
4
0
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <vector> using namespace std; #define LOCAL 1 #define UPLOAD 2 #define ll long long ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } template <class T = long long> T input() { T x; cin >> x; ...
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <vector> using namespace std; #define LOCAL 1 #define UPLOAD 2 #define ll long long ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } template <class T = long long> T input() { T x; cin >> x; ...
replace
31
39
31
38
TLE
p02818
Python
Time Limit Exceeded
def main(): A, B, K = map(int, input().split()) for i in range(K): if A >= 1: A -= 1 elif B >= 1: B -= 1 print(str(A) + " " + str(B)) if __name__ == "__main__": main()
def main(): A, B, K = map(int, input().split()) if A > K: A -= K else: K -= A A = 0 B -= K if B <= 0: print("0 0") exit(0) print(str(A) + " " + str(B)) if __name__ == "__main__": main()
replace
3
8
3
12
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; for (ll i = 0; i < k; i++) { if (a >= 1) { a--; } else if (b >= 1) { b--; } } cout << a << " " << b << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; ll copy = a; a = a - min(a, k); b = b - min(b, k - min(copy, k)); cout << a << " " << b << endl; }
replace
8
15
8
12
TLE
p02818
Python
Runtime Error
A, B, K = map(int, input().split()) a = max(0, A - K) if K - A > 0: b = max(0, B - K + A) print(a, b)
A, B, K = map(int, input().split()) a = max(0, A - K) b = B if K - A > 0: b = max(0, B - K + A) print(a, b)
insert
2
2
2
3
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define PB push_back #define PII pair<int, int> #define MP make_pair #define all(x) x.begin(), x.end() #define REP(x, y, z) for (int x = (y); x <= (z); x++) #define REPP(x, y, z) for (int x = (y); x >= (z); x--) #define F first #define S second #define...
#include <bits/stdc++.h> using namespace std; #define ll long long #define PB push_back #define PII pair<int, int> #define MP make_pair #define all(x) x.begin(), x.end() #define REP(x, y, z) for (int x = (y); x <= (z); x++) #define REPP(x, y, z) for (int x = (y); x >= (z); x--) #define F first #define S second #define...
replace
32
37
32
42
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; ll bla = k & 1; ll temp = 0; while (a || b || k) { temp = min(a, k / 2); temp = min(b, temp); a -= temp; b -= temp; k -= temp; } if (a) a -= k, k = 0; else if (b) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; ll bla = k & 1; ll temp = 0; temp = min(a, k); a -= temp; k -= temp; temp = min(b, k); b -= temp; cout << max(a, 0ll) << ' ' << max(b, 0ll) << endl; }
replace
10
22
10
15
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) int main() { long long a, b, k; cin >> a >> b >> k; while (k > 0) { if (a > 0) { a-...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) int main() { long long a, b, k; cin >> a >> b >> k; if (k < a) { a -= k; } else if (k >...
replace
12
21
12
19
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { long a, b, k; cin >> a >> b >> k; while (k != 0) { if (a > 0) a--; else if (b > 0) b--; k--; } cout << a << " " << b << endl; }
#include <iostream> #include <string> using namespace std; int main() { long a, b, k; cin >> a >> b >> k; if (a > k) cout << a - k << " " << b << endl; else if (a <= k && b > k - a) cout << 0 << " " << b + a - k << endl; else cout << "0 0" << endl; return 0; }
replace
7
16
7
14
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll a, b, k; cin >> a >> b >> k; /* vector<int> a(n); rep(i, n) cin >> a.at(i); */ rep(i, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll a, b, k; cin >> a >> b >> k; /* vector<int> a(n); rep(i, n) cin >> a.at(i); */ if (k <...
replace
17
27
17
23
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; for (int i = 0; i < k; i++) { if (1 <= a) { a--; } else if (1 <= b) { b--; } else { break; } } cout << a << " " << b << endl...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; int main() { ll a, b, k; cin >> a >> b >> k; cout << max(a - k, 0ll) << " " << flush; cout << max(b - max(k - a, 0ll), 0ll) << endl; return 0; }
replace
8
18
8
10
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b, c; cin >> a >> b >> c; while (c != 0) { if (a > 0) { a--; } else if (b > 0) { b--; } else { break; } c--; } cout << a << ' ' << b << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b, c; cin >> a >> b >> c; if (a > c) cout << a - c << ' ' << b << endl; else if (b > (c - a)) cout << 0 << ' ' << b - (c - a) << endl; else cout << 0 << ' ' << 0 << endl; }
replace
5
16
5
11
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> using namespace std; int main() { long long A, B, K; cin >> A; cin >> B; cin >> K; for (int i = 0; i < K; i++) { if (A > 0) { A--; } else if (B > 0) { B--; } else { break; } } cout << A << " " << B << endl; return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { long long A, B, K; cin >> A; cin >> B; cin >> K; /*for(int i = 0; i<K; i++){ if(A>0){ A--; }else if(B>0){ B--; }else{ break; } }*/ if (A <= K) { B -= K - A; A = 0; if...
replace
9
17
9
25
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> VI; ...
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> VI; ...
replace
47
52
47
59
TLE
p02818
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define ROOP(i, N) for (int i = 0; i < N; i++) #define RVROOP(i, N) for (int i = N; i >= 0; i--) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { ll A, B, K; cin >> A >> B >> K; while (K > 0) { if (A >= 1)...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define ROOP(i, N) for (int i = 0; i < N; i++) #define RVROOP(i, N) for (int i = N; i >= 0; i--) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { ll A, B, K; cin >> A >> B >> K; if (A > K) { A = A - K; }...
replace
11
19
11
16
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long long int a, b, k; cin >> a >> b >> k; for (long long int i = 0; i < k; i++) { if (a >= 1) a--; else if (b >= 1) b--; } cout << a << " " << b << endl; return 0; }
#include <iostream> using namespace std; int main() { long long int a, b, k; cin >> a >> b >> k; if (a - k >= 0) cout << a - k << " " << b << endl; else if (b - (k - a) >= 0) cout << 0 << " " << b - (k - a) << endl; else cout << 0 << " " << 0 << endl; return 0; }
replace
6
13
6
12
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> // #include <bits/stdc++.h> #include <algorithm> #include <map> #include <math.h> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define INF 10000000; #define rep(i, n) for (int i = 0; (i) < (int)(n); i++) #define REP(i, a, b) for (int i...
#include <iostream> #include <stdio.h> // #include <bits/stdc++.h> #include <algorithm> #include <map> #include <math.h> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define INF 10000000; #define rep(i, n) for (int i = 0; (i) < (int)(n); i++) #define REP(i, a, b) for (int i...
replace
24
33
24
32
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; using ll = long long; int main() { ll A, B, K; cin >> A >> B >> K; for (int i = 0; i < K; ++i) { if (A > 0) { A--; } else if (B > 0) { B--; } if (A == 0 && B == 0) { break; }...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; using ll = long long; int main() { ll A, B, K; cin >> A >> B >> K; A -= K; if (A < 0) { B += A; A = 0; } if (B < 0) { B = 0; } cout << A << ' ' << B << endl; return 0; }
replace
13
22
13
20
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b, k; cin >> a >> b >> k; int64_t i; for (i = 0; i < k; i++) { if (a > 0) { a--; } else if (b > 0) { b--; } else { break; } } cout << a << " " << b << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b, k; cin >> a >> b >> k; if (a + b <= k) { a = 0; b = 0; } else if (a >= k) { a -= k; } else { b = b - (k - a); a = 0; } cout << a << " " << b << endl; }
replace
5
14
5
13
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> using namespace std; int main() { long A, B; long K; cin >> A >> B >> K; for (long i = 0; i < K; i++) { if (A > 0) { A--; } else if (B > 0) { B--; } } cout << A << " " << B << endl; }
#include <algorithm> #include <iostream> #include <queue> using namespace std; int main() { long A, B; long K; cin >> A >> B >> K; if (K >= A + B) { A = 0; B = 0; } else if (K >= A) { B -= K - A; A = 0; } else { A -= K; } cout << A << " " << B << endl; }
replace
11
17
11
19
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define PI 3.141592653589 #define ll long long using namespace std; int main() { ll a, b, k; cin >> a >> b >> k; if (a + b <= k) { a = 0; b = 0; } else if (a + b > k) { for (ll i = 0; i < k; ++i) { if (a > 0) a--; else if (a == 0 && b > 0) b-...
#include <bits/stdc++.h> #define PI 3.141592653589 #define ll long long using namespace std; int main() { ll a, b, k; cin >> a >> b >> k; if (a + b <= k) { a = 0; b = 0; } else if (a + b > k) { if (a - k >= 0) a -= k; else if (a - k < 0) { b = b - k + a; a = 0; } } ...
replace
15
20
15
20
TLE
p02818
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; const int MOD = 1e9 + 7; const int INF = 1 << 29; const int N = 1e6 + 10; struct IOsetup { IOsetup() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout << fixed << setprecision(...
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; const int MOD = 1e9 + 7; const int INF = 1 << 29; const int N = 1e6 + 10; struct IOsetup { IOsetup() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout << fixed << setprecision(...
replace
21
26
21
26
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int64_t i = 0; i < n; i++) #define REPR(i, n) for (int64_t i = n; i >= 0; i--) #define FOR(i, m, n) for (int64_t i = m; i < n; i++) #define FORR(i, m, n) for (int64_t i = m; i >= n; i--) #define ALL(v) v.begin(), v.end() typedef long long ll; templat...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int64_t i = 0; i < n; i++) #define REPR(i, n) for (int64_t i = n; i >= 0; i--) #define FOR(i, m, n) for (int64_t i = m; i < n; i++) #define FORR(i, m, n) for (int64_t i = m; i >= n; i--) #define ALL(v) v.begin(), v.end() typedef long long ll; templat...
replace
36
43
36
46
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main(void) { int64_t a, b, k; cin >> a >> b >> k; if (a + b > k) { for (int64_t i = 0; i <= a + b; i++) { if (a > 0) a--; else if (a == 0 && b > 0) b--; else if (a == 0 && b == 0) break; } cout << a << " " << ...
#include <bits/stdc++.h> using namespace std; int main(void) { int64_t a, b, k; cin >> a >> b >> k; if (a >= k) { a = a - k; cout << a << " " << b << endl; } else if (a + b >= k) { b = b - (k - a); a = 0; cout << a << " " << b << endl; } else { cout << 0 << " " << 0 << endl; } }
replace
6
15
6
12
TLE
p02818
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); #endif ll a, b, k; cin >> a >> b >> k; cout << max(0LL, a - k) << " " << max(0LL, b...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, k; cin >> a >> b >> k; cout << max(0LL, a - k) << " " << max(0LL, b - max(0LL, k - a)) << endl; return 0; }
delete
6
10
6
6
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define NREP() for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 0; i < n; i++) #define ALL(x) (x).begin(), (x).end() #define MSG(x) cout << x << endl; #define IPT(x) \ ll t; ...
#include <bits/stdc++.h> #define NREP() for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 0; i < n; i++) #define ALL(x) (x).begin(), (x).end() #define MSG(x) cout << x << endl; #define IPT(x) \ ll t; ...
replace
26
33
26
34
TLE
p02818
C++
Runtime Error
#include <iostream> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long times = N / (A + B); long long rest = N % (A + B); long long opai; if (rest >= A) opai = A; if (rest < A) opai = rest; cout << times * A + opai << endl; }
#include <iostream> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; long long t = A - K; long long u = 0; if (t >= 0) u = B; else { u = B + t; t = 0; } if (u <= 0) u = 0; cout << t << " " << u << endl; }
replace
3
13
3
16
0
p02818
Python
Time Limit Exceeded
a, b, k = map(int, input().split()) for i in range(k): if a > 0: a = a - 1 elif b > 0: b = b - 1 print(a, b)
a, b, k = map(int, input().split()) a_ans = max(a - k, 0) b_ans = max(b - max(k - a, 0), 0) print(a_ans, b_ans)
replace
2
9
2
5
TLE
p02818
Python
Time Limit Exceeded
a, b, k = map(int, input().split()) for i in range(k): if a > 0: a -= 1 elif b > 0: b -= 1 print(a, b)
a, b, k = map(int, input().split()) if a > k: print(a - k, b) elif a + b > k: print(0, a + b - k) else: print(0, 0)
replace
2
9
2
8
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <functional> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main(void) { unsigned long int A = 0, B = 0, K = 0; cin >> A >> B >> K; while (A > 0 && K > 0) { A--; K--; } while (B > 0 && K > 0) { B--; K--...
#include <algorithm> #include <bits/stdc++.h> #include <functional> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main(void) { unsigned long int A = 0, B = 0, K = 0; cin >> A >> B >> K; if (A > K) { A -= K; } else { K -= A; A = 0; if (B > K) { B -= K; ...
replace
13
20
13
23
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, k; cin >> a >> b >> k; if (a + b <= k) { cout << 0 << ' ' << 0; return 0; } while (k--) { if (a >= 1) a--; else if (b >= 1) b--; else break; } cout << a << ' ' << b; return...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, k; cin >> a >> b >> k; if (k <= a) cout << a - k << ' ' << b << endl; else if (k <= a + b) cout << 0 << ' ' << b - (k - a) << endl; else cout << 0 << ' ' << 0 << endl; return 0; }
replace
9
24
9
15
TLE
p02818
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; while (K > 0) { if (A > 0) { A--; } else if (B > 0) { B--; } K--; } cout << A << " " << B << endl; }
#include <iostream> #include <string> using namespace std; int main() { long long A, B, K; cin >> A >> B >> K; if (A > K) { A -= K; K = 0; } else { K -= A; A = 0; } if (B > K) { B -= K; K = 0; } else { K -= B; B = 0; } cout << A << " " << B << endl; }
replace
7
14
7
20
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef vector<int> iv; typedef vector<bool> bv; typedef vector<string> sv; typedef vector<long long int> llv; typedef vector<double> dv; #define debug_ printf("OK\n") #define sor_(vec) sort(vec.begin(), vec.end()) #define rev_(vec) reverse(vec....
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef vector<int> iv; typedef vector<bool> bv; typedef vector<string> sv; typedef vector<long long int> llv; typedef vector<double> dv; #define debug_ printf("OK\n") #define sor_(vec) sort(vec.begin(), vec.end()) #define rev_(vec) reverse(vec....
replace
21
28
21
25
TLE
p02818
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using na...
#include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using na...
replace
379
380
379
380
0
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
replace
545
550
545
553
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int a, b, k; cin >> a >> b >> k; while (k--) { if (a > 0) a--; else if (b > 0) b--; } cout << a << " " << b << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int a, b, k; cin >> a >> b >> k; if (k <= a) a -= k; else if (k <= a + b) { b -= k - a; a = 0; } else { a = 0; b = 0; } cout << a << " " << b << "\n"; retur...
replace
11
16
11
19
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, K; cin >> A >> B >> K; for (int64_t i = 0; i < K; i++) { if (A > 0) { A--; } else if (B > 0) { B--; } } cout << A << " " << B << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, K; cin >> A >> B >> K; if (A >= K) { A -= K; } else { K -= A; A = 0; if (B >= K) { B -= K; } else { B = 0; } } cout << A << " " << B << endl; }
replace
6
11
6
15
TLE
p02818
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; const int mod = 1000000007; #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) #define ll long long ...
#include <algorithm> #include <cctype> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; const int mod = 1000000007; #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) #define ll long long ...
replace
21
28
21
24
TLE
p02818
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; while (k > 0) { if (a > 0) a--; else if (b > 0) b--; k--; } cout << a << " " << b << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, k; cin >> a >> b >> k; if (a >= k) cout << a - k << " " << b; else if (a < k && a + b > k) cout << 0 << " " << b - (k - a) << endl; else cout << 0 << " " << 0 << endl; }
replace
6
14
6
12
TLE