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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if (!(p))
#define until(p) while (!(p))
using ll = std::int64_t;
using P = std::tuple<int, int>;
constexpr int INF = 1000000000;
int N, M;
int A[1100], B[1100], C[1100];
int D[1100], E... | #include <bits/stdc++.h>
#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if (!(p))
#define until(p) while (!(p))
using ll = std::int64_t;
using P = std::tuple<int, int>;
constexpr int INF = 1000000000;
int N, M;
int A[1100], B[1100], C[1100];
int D[1100], E... | replace | 16 | 17 | 16 | 17 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
#define DEBUG if (0)
#define lli long long int
#define ull unsigned long long int
#define ldouble long double
using namespace std;
/*
compress the coordinates
floodfill
*/
const int maxN = 1e3 + 10;
int n, m, limitx, limity;
lli horizontal[3][maxN], vertical[3][maxN];
map<int, lli> revx,... | #include <bits/stdc++.h>
#define DEBUG if (0)
#define lli long long int
#define ull unsigned long long int
#define ldouble long double
using namespace std;
/*
compress the coordinates
floodfill
*/
const int maxN = 1e3 + 10;
int n, m, limitx, limity;
lli horizontal[3][maxN], vertical[3][maxN];
map<int, lli> revx,... | replace | 35 | 37 | 35 | 37 | -11 | |
p02680 | C++ | Runtime Error | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#inc... | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#inc... | replace | 66 | 68 | 66 | 68 | 0 | |
p02680 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout << fixed << setprecision(10)
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#de... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout << fixed << setprecision(10)
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#de... | replace | 187 | 188 | 187 | 188 | 0 | |
p02680 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define REP(i, s, e) for (int i = (s); i < (int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for (int i = (int)(s - 1); i >= (int)(e); i--)
#define pb push_back
#define all(r) r.begin(), r.end()
#define rall(r) r.rbegin(), ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) REP(i, 0, n)
#define REP(i, s, e) for (int i = (s); i < (int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for (int i = (int)(s - 1); i >= (int)(e); i--)
#define pb push_back
#define all(r) r.begin(), r.end()
#define rall(r) r.rbegin(), ... | insert | 170 | 170 | 170 | 172 | TLE | |
p02680 | Python | Runtime Error | def main():
import sys
readline = sys.stdin.readline
# readlines = sys.stdin.readlines
from collections import deque
from bisect import bisect_left
N, M = map(int, input().split())
tate = []
yoko = []
X = set()
Y = set()
for _ in range(N):
A, B, C = map(int, readlin... | def main():
import sys
readline = sys.stdin.readline
# readlines = sys.stdin.readlines
from collections import deque
from bisect import bisect_left
N, M = map(int, input().split())
tate = []
yoko = []
X = set()
Y = set()
for _ in range(N):
A, B, C = map(int, readlin... | replace | 56 | 58 | 56 | 62 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define CLR(t, v) memset(t, (v), sizeof(t))
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << "(" ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define CLR(t, v) memset(t, (v), sizeof(t))
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << "(" ... | replace | 58 | 60 | 58 | 61 | 0 | |
p02680 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | replace | 59 | 60 | 59 | 60 | TLE | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int INF = 0x3f3f3f3f;
const int N = 2e3 + 10;
int n, m;
int A[N], B[N], C[N], D[N], E[N], F[N];
ll ans;
vector<int> xx, yy;
int id(vector<int> &vc, int x) {
return lower_bound(vc.begin(), vc.end(), x) - vc.begin();
}
int dx[]{0, 0, -1, 1};
int d... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int INF = 0x3f3f3f3f;
const int N = 3e3 + 10;
int n, m;
int A[N], B[N], C[N], D[N], E[N], F[N];
ll ans;
vector<int> xx, yy;
int id(vector<int> &vc, int x) {
return lower_bound(vc.begin(), vc.end(), x) - vc.begin();
}
int dx[]{0, 0, -1, 1};
int d... | replace | 4 | 5 | 4 | 5 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i, a, b) for (ll i = ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i, a, b) for (ll i = ... | replace | 31 | 32 | 31 | 32 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
// #define MOD 998244353
#define INF 1145141919810893364
// #define INF 810114514
#define PI 3.141592653589
typedef long long ll;
typedef pair<ll, ll> PP;
#define int ll
#define setdouble setprecision
#define REP(i, n) for (int i = 0; i < (n); ++i)
#d... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
// #define MOD 998244353
#define INF 1145141919810893364
// #define INF 810114514
#define PI 3.141592653589
typedef long long ll;
typedef pair<ll, ll> PP;
#define int ll
#define setdouble setprecision
#define REP(i, n) for (int i = 0; i < (n); ++i)
#d... | replace | 95 | 96 | 95 | 96 | 0 | |
p02680 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <stdio.h>
#include <vector>
using ll = long long int;
using P = std::pair<int, int>;
const int INF = (1 << 30);
const ll INFLL = (1ll << 60);
const ll MOD = (ll)(1e9 + 7);
#define l_ength size
void mul_mod(ll &a, ll b) {
a *= b;
a ... | #include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <stdio.h>
#include <vector>
using ll = long long int;
using P = std::pair<int, int>;
const int INF = (1 << 30);
const ll INFLL = (1ll << 60);
const ll MOD = (ll)(1e9 + 7);
#define l_ength size
void mul_mod(ll &a, ll b) {
a *= b;
a ... | replace | 27 | 29 | 27 | 29 | -11 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
map<int, int> mpx, mpy;
int invx[14000], invy[14000], bias = 7000;
int a[1111], b[1111], c[1111], d[1111], e[1111], f[1111];
bool vis[14000][14000], l[14000][14000];
ll ans... | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
map<int, int> mpx, mpy;
int invx[14000], invy[14000], bias = 7000;
int a[1111], b[1111], c[1111], d[1111], e[1111], f[1111];
bool vis[14000][14000], l[14000][14000];
ll ans... | replace | 16 | 45 | 16 | 50 | -11 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// one-based numbering
struct UnionFind {
vector<int> data;
// i: (data[i] < 0) -> group size, (data[i] > 0) -> parent;
UnionFind(int n) { data.resize(n + 1, -1); }
int find(int x) {
if (data[x] < 0)
return x;
else
return data[x] = find(data[x])... | #include <bits/stdc++.h>
using namespace std;
// one-based numbering
struct UnionFind {
vector<int> data;
// i: (data[i] < 0) -> group size, (data[i] > 0) -> parent;
UnionFind(int n) { data.resize(n + 1, -1); }
int find(int x) {
if (data[x] < 0)
return x;
else
return data[x] = find(data[x])... | replace | 86 | 88 | 86 | 88 | -11 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using uint = unsigned int;
struct L {
int a, b, c;
L(int a = 0, int b = 0, int c = 0) : a(a), b(b), c(c) {}
};
int main() {
int n, m;
cin >> n >> m;
vector<L> lh(n), lv(m);
map<int, int> mpx... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using uint = unsigned int;
struct L {
int a, b, c;
L(int a = 0, int b = 0, int c = 0) : a(a), b(b), c(c) {}
};
int main() {
int n, m;
cin >> n >> m;
vector<L> lh(n), lv(m);
map<int, int> mpx... | replace | 47 | 48 | 47 | 48 | 0 | |
p02680 | C++ | Runtime Error | // includes
#include <bits/stdc++.h>
using namespace std;
// macros
#define pb emplace_back
#define mk make_pair
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st)... | // includes
#include <bits/stdc++.h>
using namespace std;
// macros
#define pb emplace_back
#define mk make_pair
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st)... | replace | 130 | 132 | 130 | 132 | -11 | |
p02680 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <func... | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <func... | replace | 177 | 178 | 177 | 178 | -11 | |
p02680 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <func... | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <func... | replace | 159 | 160 | 159 | 160 | -11 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 5000;
struct NS {
int a, b, c;
} ns[N + 5];
struct EW {
int d, e, f;
} ew[N + 5];
int t_ns[N + 5], t_ew[N + 5], r_ns[N + 5], r_ew[N + 5];
template <int N> struct Disjoint_Set_Union {
int p[N + 5], sz[N + 5];
void init(int n) {
for (int i = 0; i... | #include <bits/stdc++.h>
using namespace std;
const int N = 5000;
struct NS {
int a, b, c;
} ns[N + 5];
struct EW {
int d, e, f;
} ew[N + 5];
int t_ns[N + 5], t_ew[N + 5], r_ns[N + 5], r_ew[N + 5];
template <int N> struct Disjoint_Set_Union {
int p[N + 5], sz[N + 5];
void init(int n) {
for (int i = 0; i... | replace | 34 | 35 | 34 | 35 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> vector<T> compress(vector<T> A) {
sort(A.begin(), A.end());
A.erase(unique(A.begin(), A.end()), A.end());
return A;
}
struct UnionFind {
vector<int> par;
vector<int> sz;
UnionFind(int n = 0) {
if (n > 0)
initialize(n);
}
vo... | #include <bits/stdc++.h>
using namespace std;
template <typename T> vector<T> compress(vector<T> A) {
sort(A.begin(), A.end());
A.erase(unique(A.begin(), A.end()), A.end());
return A;
}
struct UnionFind {
vector<int> par;
vector<int> sz;
UnionFind(int n = 0) {
if (n > 0)
initialize(n);
}
vo... | replace | 81 | 82 | 81 | 82 | 0 | |
p02680 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
template <typename T> void fin(T const &t) {
std::cout << t << std::endl;
exit(0);
}
struct line {
int64_t p, q, r;
line() {}
};
void su(std::vector<int> &v) {
std::sort(v.begin()... | #include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
template <typename T> void fin(T const &t) {
std::cout << t << std::endl;
exit(0);
}
struct line {
int64_t p, q, r;
line() {}
};
void su(std::vector<int> &v) {
std::sort(v.begin()... | replace | 43 | 44 | 43 | 44 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define forall(it, c) \
for (__typeof(c.begin()... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define forall(it, c) \
for (__typeof(c.begin()... | replace | 25 | 26 | 25 | 26 | 0 | |
p02680 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define llint long ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define llint long ... | replace | 47 | 54 | 47 | 62 | 0 | |
p02680 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#def... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#def... | replace | 22 | 27 | 22 | 27 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | replace | 34 | 35 | 34 | 35 | 0 | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | replace | 183 | 184 | 183 | 184 | 0 | |
p02680 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | insert | 76 | 76 | 76 | 77 | TLE | |
p02680 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define all(v) v.begin(), v.end()
#define P pair<int, int>
#define len(s) (int)s.size()
#define pb push_back
template <class T> inline bool chmin(T &a, T b) {
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define all(v) v.begin(), v.end()
#define P pair<int, int>
#define len(s) (int)s.size()
#define pb push_back
template <class T> inline bool chmin(T &a, T b) {
... | replace | 31 | 32 | 31 | 32 | 0 | |
p02680 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); i++... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); i++... | replace | 34 | 36 | 34 | 36 | 0 | |
p02681 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int main(void) {
char s[10], t[10];
int len;
scanf("%s %s", s, t);
len = strlen(s);
for (int i = 0; i < len; i++) {
if (s[i] != t[i]) {
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char s[20], t[20];
int len;
scanf("%s %s", s, t);
len = strlen(s);
for (int i = 0; i < len; i++) {
if (s[i] != t[i]) {
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02681 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
return S == T.substr(0, S.length());
}
| #include <iostream>
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
if (S == T.substr(0, S.length())) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
}
| replace | 7 | 8 | 7 | 13 | 1 | |
p02681 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(void) {
char s[10], t[10];
scanf("%s%s", s, t);
if (strlen(s) + 1 == strlen(t)) {
for (int i = 0; i < strlen(s); i++) {
if (s[i] == t[i]) {
if (i == (strlen(s) - 1)) {
printf("Yes\n");
}
} else {... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(void) {
char s[11], t[11];
scanf("%s%s", s, t);
if (strlen(s) + 1 == strlen(t)) {
for (int i = 0; i < strlen(s); i++) {
if (s[i] == t[i]) {
if (i == (strlen(s) - 1)) {
printf("Yes\n");
}
} else {... | replace | 5 | 6 | 5 | 6 | 0 | |
p02681 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string x;
string n;
cin >> x >> n;
n.pop_back();
if (n == x) {
cout << "Yes"
<< "\n";
return true;
} else {
cout << "No"
<< "\n";
}
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string x;
string n;
cin >> x >> n;
n.pop_back();
if (n == x) {
cout << "Yes"
<< "\n";
} else {
cout << "No"
<< "\n";
}
}
| delete | 11 | 12 | 11 | 11 | 1 | |
p02681 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
string n;
cin >> n;
string t;
cin >> t;
int cnt = 0;
int N = n.length();
for (int i = 0; i <= N; i++) {
if (n.at(i) == t.at(i)) {
cnt++;
} else {
}
}
if (cnt == N) {
cout << "Yes" << endl;
} else ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
string n;
cin >> n;
string t;
cin >> t;
int cnt = 0;
int N = n.length();
for (int i = 0; i < N; i++) {
if (n.at(i) == t.at(i)) {
cnt++;
} else {
}
}
if (cnt == N) {
cout << "Yes" << endl;
} else {... | replace | 11 | 12 | 11 | 12 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 8) >= this->size() (which is 8)
|
p02681 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
unsigned int i = 1;
while (S.at(i) == T.at(i)) {
i = i + 1;
if (i == S.size()) {
break;
}
}
if (i == S.size()) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
unsigned int i = 0;
while (S.at(i) == T.at(i)) {
i = i + 1;
if (i == S.size()) {
break;
}
}
if (i == S.size()) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02681 | Python | Runtime Error | s, t = input().split()
print("Yes" if s == t[:-1] else "No")
| s = input()
t = input()
print("Yes" if s == t[:-1] else "No")
| replace | 0 | 1 | 0 | 2 | ValueError: not enough values to unpack (expected 2, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s074309875.py", line 1, in <module>
s, t = input().split()
ValueError: not enough values to unpack (expected 2, got 1)
|
p02681 | Python | Runtime Error | # A - Registration
def main():
S, T = map(int, open(0).read().split())
print("Yes" if T[:-1] == S else "No")
if __name__ == "__main__":
main()
| # A - Registration
def main():
S, T = open(0).read().split()
print("Yes" if T[:-1] == S else "No")
if __name__ == "__main__":
main()
| replace | 2 | 3 | 2 | 3 | ValueError: invalid literal for int() with base 10: 'chokudai' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s408863353.py", line 8, in <module>
main()
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s408863353.py", line 3, in main
S, T = map(int, open(0).read().spl... |
p02681 | Python | Runtime Error | #!/usr/bin/env python3
S = list(input())
T = list(input())
if len(T) == len(S) + 1:
flag = True
for i in len(S):
if S[i] != T[i]:
flag = False
if flag:
print("Yes")
else:
print("No")
else:
print("No")
| #!/usr/bin/env python3
S = list(input())
T = list(input())
if len(T) == len(S) + 1:
flag = True
for i in range(len(S)):
if S[i] != T[i]:
flag = False
if flag:
print("Yes")
else:
print("No")
else:
print("No")
| replace | 7 | 8 | 7 | 8 | TypeError: 'int' object is not iterable | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s140016351.py", line 8, in <module>
for i in len(S):
TypeError: 'int' object is not iterable
|
p02681 | Python | Runtime Error | S = input()
T = input()
if T.startwith("S"):
print("Yes")
else:
print("No")
| S = input()
T = input()
if T.startswith(S):
print("Yes")
else:
print("No")
| replace | 3 | 4 | 3 | 4 | AttributeError: 'str' object has no attribute 'startwith'. Did you mean: 'startswith'? | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s740360740.py", line 4, in <module>
if T.startwith('S'):
AttributeError: 'str' object has no attribute 'startwith'. Did you mean: 'startswith'?
|
p02681 | Python | Runtime Error | S, T = list(map(str, input().split()))
if (abs(len(T) - len(S)) == 1) and (T[:-1] == S):
print("Yes")
else:
print("No")
| S = list(map(str, input().split()))[0]
T = list(map(str, input().split()))[0]
if (abs(len(T) - len(S)) == 1) and (T[:-1] == S):
print("Yes")
else:
print("No")
| replace | 0 | 1 | 0 | 2 | ValueError: not enough values to unpack (expected 2, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s417304047.py", line 1, in <module>
S, T = list(map(str, input().split()))
ValueError: not enough values to unpack (expected 2, got 1)
|
p02681 | Python | Runtime Error | s, t = map(str, input().split())
if s[: len(s)] == t[: len(s)]:
print("Yes")
else:
print("No")
| s = input()
t = input()
if s[: len(s)] == t[: len(s)]:
print("Yes")
else:
print("No")
| replace | 0 | 1 | 0 | 2 | ValueError: not enough values to unpack (expected 2, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02681/Python/s756758064.py", line 1, in <module>
s, t = map(str, input().split())
ValueError: not enough values to unpack (expected 2, got 1)
|
p02681 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < n; i++) // 普通のループ
#define REPTO(i, n) for (int i = 0; i <= n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--) // 逆ループ
#define FOR(i, m, n) for (int i = m; i < n; i++) ... | #include <iostream>
#include <string>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < n; i++) // 普通のループ
#define REPTO(i, n) for (int i = 0; i <= n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--) // 逆ループ
#define FOR(i, m, n) for (int i = m; i < n; i++) ... | replace | 21 | 23 | 21 | 23 | 0 | |
p02681 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int a = S.size();
char b = T.at(a + 1);
if (T == S + b) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int a = S.size();
char b = T.at(a);
if (T == S + b) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 7 | 8 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 9) >= this->size() (which is 9)
|
p02681 | C++ | Runtime Error | #include <iostream>
using namespace std;
#include <string>
int main() {
string S, T;
cin >> S >> T;
for (int i = 0; i < S.length(); i++) {
if (S[i] != T[i]) {
cout << "No";
exit(1);
}
}
cout << "Yes";
}
| #include <iostream>
using namespace std;
#include <string>
int main() {
string S, T;
cin >> S >> T;
T.pop_back();
if (S == T)
cout << "Yes";
else
cout << "No";
} | replace | 7 | 14 | 7 | 12 | 0 | |
p02681 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
using namespace std;
int main(void) {
int i, flg, n;
flg = 0;
char s[10], t[10];
scanf("%s", s);
scanf("%s", t);
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[i] != t[i])
flg = 1;
}
if (flg == 1)
printf("No\n");
else
printf("Yes\n");
return 0... | #include <cstdio>
#include <cstring>
using namespace std;
int main(void) {
int i, flg, n;
flg = 0;
char s[11], t[12];
scanf("%s", s);
scanf("%s", t);
n = strlen(s);
for (i = 0; i < n; i++) {
if (s[i] != t[i])
flg = 1;
}
if (flg == 1)
printf("No\n");
else
printf("Yes\n");
return 0... | replace | 6 | 7 | 6 | 7 | 0 | |
p02681 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
s2.erase(s2.end());
if (s1 == s2) {
cout << "Yes";
} else {
cout << "No";
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
s2.pop_back();
if (s1 == s2) {
cout << "Yes";
} else {
cout << "No";
}
} | replace | 6 | 7 | 6 | 7 | -11 | |
p02681 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
t = t.erase(t[t.size() - 1]);
if (s == t) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
t = t.erase(t.size() - 1);
if (s == t) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | replace | 7 | 8 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::erase: __pos (which is 122) > this->size() (which is 9)
|
p02681 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int len = t.length();
if (len != s.length() + 1) {
cout << "No" << endl;
return -1;
}
string u = t.substr(0, len - 1);
if (s != u) {
cout << "No" << endl;
return -1;
}
for (char c =... | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int len = t.length();
if (len != s.length() + 1) {
cout << "No" << endl;
return -1;
}
string u = t.substr(0, len - 1);
if (s != u) {
cout << "No" << endl;
return 0;
}
for (char c = ... | replace | 18 | 19 | 18 | 19 | 0 | |
p02682 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;
typedef long double LD;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
LL a, b, c, k;
cin >> a >> b >> c >>... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long LL;
typedef long double LD;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
LL a, b, c, k;
cin >> a >> b >> c >>... | replace | 18 | 29 | 18 | 24 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long one, zero, minus_one;
int k, amount = 0;
cin >> one >> zero >> minus_one >> k;
for (int i = 0; i < k; i++) {
if (one > 0) {
one -= 1;
amount += 1;
} else if (zero > 0) {
zero -= 1;
} else {
minus_one -=... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long one, zero, minus_one;
int k, amount = 0;
cin >> one >> zero >> minus_one >> k;
if (one >= k) {
amount = k;
} else if (one + zero >= k) {
amount = one;
} else {
amount = one - (k - (one + zero));
}
cout << amount << endl... | replace | 6 | 17 | 6 | 12 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int A, B, C, K, ans = 0;
cin >> A >> B >> C >> K;
for (int i = 0; i < K; i++) {
if (A > 0) {
ans++;
A--;
} else if (B > 0) {
B--;
} else if (C > 0) {
an... | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int A, B, C, K, ans = 0;
cin >> A >> B >> C >> K;
if (A > K)
cout << K << endl;
else if (A + B > K)
cout << A << endl;
else
cout << A - (K - A - B) << endl;
return 0;
} | replace | 12 | 24 | 12 | 19 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int a, b, c, n, s;
int main() {
cin >> a >> b >> c >> n;
for (int i = 1; i <= n; i++) {
if (a != 0)
a--, s++;
else if (b != 0)
b--;
else if (c != 0)
c--, s--;
}
cout << s;
}
| #include <bits/stdc++.h>
using namespace std;
int a, b, c, n, s;
int main() {
cin >> a >> b >> c >> n;
if (n <= a)
cout << n;
else if (n <= a + b)
cout << a;
else
cout << a - (n - a - b);
}
| replace | 5 | 14 | 5 | 11 | TLE | |
p02682 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int64_t a, b, c, k;
cin >> a >> b >> c >> k;
if ((a + b) >= k) {
cout << a << endl;
return -1;
}
int64_t d = k - (a + b);
if (c < d)
cout << a - c << endl;
else
cout << a - d << endl;
return 0;
}
| #include <iostream>
#include <vector>
using namespace std;
int main() {
int64_t a, b, c, k;
cin >> a >> b >> c >> k;
if ((a + b) >= k) {
if (a < k)
cout << a << endl;
else {
cout << k << endl;
}
return 0;
}
int64_t d = k - (a + b);
if (c < d)
cout << a - c << endl;
else... | replace | 10 | 12 | 10 | 16 | 255 | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k, sum = 0;
cin >> a >> b >> c >> k;
while (k > 0) {
if (k >= a && a > 0) {
sum = sum + a;
k = k - a;
a = 0;
} else if (k < a && a > 0) {
sum = sum + k;
k = 0;
a = a - k;
} else if (k < b &&... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k, sum = 0;
cin >> a >> b >> c >> k;
while (k > 0) {
if (k >= a && a > 0) {
sum = sum + a;
k = k - a;
a = 0;
} else if (k < a && a > 0) {
sum = sum + k;
k = 0;
a = a - k;
} else if (k < b &&... | replace | 27 | 28 | 27 | 28 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
int A, B, C, K;
std::cin >> A >> B >> C >> K;
int count = 0;
for (int i = 0; i < K; i++) {
if (A > 0) {
++count;
--A;
} else if (B > 0)
--B;
else
--count;
}
std::cout << count << std::endl;
} | #include <iostream>
int main() {
int A, B, C, K;
std::cin >> A >> B >> C >> K;
int count = 0;
if (K > A) {
count = A;
for (int i = 0; i < K - A - B; i++)
count--;
} else
count = K;
std::cout << count << std::endl;
} | replace | 7 | 16 | 7 | 14 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int a, b, c, d;
cin >> a >> b >> c >> d;
int ans = 0;
for (int i = 0; i < d; i++) {
if (a) {
a--;
ans++;
} else if (b) {
b--;
} else {
c--;
ans--;
}
}
c... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int a, b, c, d;
cin >> a >> b >> c >> d;
int ans = 0;
int x = min(a, d);
ans += x;
a -= x;
d -= x;
if (d) {
int y = min(b, d);
b -= y;
d -= y;
}
if (d) {
ans -= d;
}
cout... | replace | 10 | 20 | 10 | 21 | TLE | |
p02682 | C++ | Time Limit Exceeded | // @prefix atcoder
// @description atcoder template
#include <bits/stdc++.h>
using namespace std;
#define int long long
// typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;
// rep
//-----... | // @prefix atcoder
// @description atcoder template
#include <bits/stdc++.h>
using namespace std;
#define int long long
// typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;
// rep
//-----... | replace | 34 | 42 | 34 | 40 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
int ans = 0;
cin >> a >> b >> c >> k;
for (int i = 0; i < k; ++i) {
if (a > 0) {
ans += 1;
--a;
} else if (b > 0) {
--b;
} else {
ans -= 1;
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
int ans = 0;
cin >> a >> b >> c >> k;
ans += min(a, k);
k = k - (a + b);
if (k > 0)
ans -= k;
cout << ans << endl;
}
| replace | 7 | 17 | 7 | 11 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K;
int sum = 0;
cin >> A >> B >> C >> K;
for (int i = K; i > 0; i--) {
if (A > 0) {
sum++;
A--;
} else if (A == 0 && B > 0)
B--;
else
sum--;
}
cout << sum << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K;
int sum = 0;
cin >> A >> B >> C >> K;
if (A > K)
cout << K << endl;
else if (A + B > K)
cout << A << endl;
else
cout << 2 * A + B - K << endl;
} | replace | 7 | 17 | 7 | 14 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int ans = 0;
for (int i = 0; ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int ans = 0;
if (k <= a) {
... | replace | 18 | 28 | 18 | 24 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K, ans;
cin >> A >> B >> C >> K;
ans = 0;
for (int i = 0; i < K; i++) {
if (A > 0) {
ans++;
A--;
} else if (B > 0) {
B--;
} else {
ans--;
}
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K, ans;
cin >> A >> B >> C >> K;
ans = 0;
if (A > K) {
ans = K;
} else if (A + B >= K) {
ans = A;
} else {
ans = A - (K - A - B);
}
cout << ans << endl;
return 0;
} | replace | 8 | 17 | 8 | 14 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
lli a = 0, b = 0, c = 0, k = 0, count... | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
lli a = 0, b = 0, c = 0, k = 0, count... | insert | 19 | 19 | 19 | 23 | TLE | |
p02682 | C++ | Time Limit Exceeded |
#include <iostream>
using namespace std;
int main() {
int a, b, c, k, ans = 0;
cin >> a >> b >> c >> k;
while (1) {
if (k == 0) {
break;
}
if (a > 0) {
ans++;
a--;
k--;
continue;
}
if (b > 0) {
b--;
k--;
continue;
}
if (c > 0) {
... |
#include <iostream>
using namespace std;
int main() {
int a, b, c, k, ans = 0;
cin >> a >> b >> c >> k;
if (a >= k && b == 0 && c == 0) {
cout << k << endl;
return 0;
}
while (1) {
if (k == 0) {
break;
}
if (a > 0) {
ans++;
a--;
k--;
continue;
}
... | insert | 8 | 8 | 8 | 13 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int A, B, C, K;
cin >> A >> B >> C >> K;
ll sum = 0;
ll card = 0;
while (true) {
if (card == K)
break;
if (A > 0) {
sum += 1;
card++;
A--;
} else if (A == 0 && B > 0) {
card++;
B--;... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int A, B, C, K;
cin >> A >> B >> C >> K;
ll sum = 0;
if (K >= A) {
sum += A;
K = K - A;
} else {
sum += K;
cout << sum << endl;
return 0;
}
if (K >= B) {
K = K - B;
} else {
cout << sum << endl;
... | replace | 7 | 23 | 7 | 29 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int d = 0;
while (k) {
if (a) {
d++;
k--;
a--;
} else if (b) {
k--;
b--;
} else if (c) {
d--;
k--;
c--;
}
}
cout << d;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
if (k <= a)
cout << k << endl;
else if (k <= a + b)
cout << a << endl;
else
cout << a - (k - a - b) << endl;
return 0;
}
| replace | 5 | 21 | 5 | 12 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char const *argv[]) {
ll a, b, c, k;
scanf("%lld%lld%lld%lld", &a, &b, &c, &k);
vector<ll> v;
while (a--)
v.push_back(1);
while (b--)
v.push_back(0);
while (c--)
v.push_back(-1);
ll ans = 0;
for (int i = ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char const *argv[]) {
int a, b, c, k;
scanf("%d%d%d%d", &a, &b, &c, &k);
printf("%d\n", min(a, k) - max(0, k - a - b));
return 0;
}
| replace | 5 | 19 | 5 | 8 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
using namespace std;
int main() {
int A, B, C, K, sum = 0;
cin >> A >> B >> C >> K;
while (1) {
if (A == 0 || K == 0) {
break;
}
sum++;
A--;
K--;
}
while (1) {
if (B == 0 || K == 0) {
break;
}
B--;
K--;
}
while (1) {
... | #include <iostream>
#include <string>
using namespace std;
int main() {
int A, B, C, K, sum = 0;
cin >> A >> B >> C >> K;
while (1) {
if (A == 0 || K == 0) {
break;
}
sum++;
A--;
K--;
}
while (1) {
if (B == 0 || K == 0) {
break;
}
B--;
K--;
}
while (1) {
... | insert | 28 | 28 | 28 | 29 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Your code here!
long long int a, b, c, k, point = 0;
scanf("%lld %lld %lld %lld", &a, &b, &c, &k);
for (int i = 0; i < k; i++) {
if (a > 0) {
point++;
a--;
} else if (b > 0) {
b--;
} else {
point-... | #include <iostream>
#include <stdio.h>
using namespace std;
int main(void) {
// Your code here!
long long int a, b, c, k, point = 0;
scanf("%lld %lld %lld %lld", &a, &b, &c, &k);
for (int i = 0; i < k; i++) {
if (a > 0) {
point++;
a--;
} else if (b > 0) {
b--;
} else {
point-... | delete | 15 | 16 | 15 | 15 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b, c, k;
int sum = 0;
cin >> a >> b >> c >> k;
for (int i = 0; i < k; i++) {
if (a != 0) {
sum += 1;
a -= 1;
} else if (b != 0) {
b -= 1;
} else {
sum -= 1;
}
}
cout << sum << endl;
retu... | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b, c, k;
int sum = 0;
cin >> a >> b >> c >> k;
if (k <= a)
sum = k;
else if (k <= b)
sum = a;
else
sum = a - (k - a - b);
cout << sum << endl;
return 0;
} | replace | 8 | 18 | 8 | 14 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, k;
cin >> a >> b >> c >> k;
long long ans = 0;
for (int i = 0; i < k; i++) {
if (a > 0) {
a--;
ans++;
} else if (b > 0) {
b--;
} else {
c--;
ans--;
}
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, k;
cin >> a >> b >> c >> k;
long long ans = 0;
if (k <= a)
cout << k << endl;
else if (k <= a + b)
cout << a << endl;
else
cout << a - (k - a - b) << endl;
} | replace | 7 | 19 | 7 | 13 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K, sum = 0;
cin >> A >> B >> C >> K;
for (int i = 0; i < K; i++) {
if (A > 0) {
sum++;
A--;
} else if (B > 0) {
B--;
} else {
sum--;
}
}
cout << sum << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, K, sum = 0;
cin >> A >> B >> C >> K;
if (A >= K) {
sum = K;
} else if (A + B >= K) {
sum = A;
} else {
sum = A - (K - A - B);
}
cout << sum << endl;
return 0;
} | replace | 6 | 15 | 6 | 12 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, c, k;
cin >> a >> b >> c >> k;
long sum = 0;
while (k > 0) {
if (a > 0) {
a--;
k--;
sum++;
} else if (b > 0) {
b--;
k--;
} else {
c--;
k--;
sum--;
}
}
cout << sum << e... | #include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, c, k;
cin >> a >> b >> c >> k;
long sum = 0;
if (k > 0 && a > 0) {
int x = min(a, k);
sum += x;
k -= x;
}
if (k > 0 && b > 0) {
int x = min(b, k);
k -= x;
}
if (k > 0 && c > 0) {
int x = min(c, k);
... | replace | 12 | 25 | 12 | 29 | TLE | |
p02682 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int r1 = k % a;
int r2 = r1 % b;
int r3 = r2 % b;
cout << r1 - r3 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
if (a >= k) {
cout << k << endl;
} else {
if (b >= k - a) {
cout << a << endl;
} else {
cout << a - (k - a - b) << endl;
}
}
}
| replace | 6 | 10 | 6 | 16 | 0 | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int d = 0;
int ans = -2000000001;
for (int i = 0; i <= a; i++) {
for (int j = 0; j <= b; j++) {
int l = k - (i + j);
d = 1 * i + -1 * l;
if (ans < d) {
ans = d;
}
}
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int ans = k < a ? k : a;
int l = k - a - b;
if (l > 0) {
ans -= l;
}
cout << ans << endl;
} | replace | 6 | 16 | 6 | 10 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, k;
int sum = 0;
cin >> a >> b >> c >> k;
for (int i = 0; i < k; i++) {
if (a != 0) {
a--;
sum++;
} else if (b != 0) {
b--;
} else {
sum--;
}
}
cout << sum << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a, b, c, k;
int64_t sum = 0;
cin >> a >> b >> c >> k;
for (int i = 0; i < k; i++) {
if (a != 0) {
a--;
sum++;
} else if (b != 0) {
b--;
} else {
sum--;
}
}
cout << sum << endl;
}
| replace | 4 | 6 | 4 | 6 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll A, B, C, K;
cin >> A >> B >> C >> K;
ll result = 0;
for (ll i = 0; i < K; i++) {
// cout << result << "\n";
if (0 < A) {
result++;
A--;
continue;
}
if (0 < B) {
B--;
continue;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll A, B, C, K;
cin >> A >> B >> C >> K;
ll result = 0;
if (K <= A) {
result = K;
} else if (K <= A + B) {
result = A;
} else {
result = A - (K - A - B);
}
cout << result;
return 0;
}
| replace | 10 | 26 | 10 | 16 | TLE | |
p02682 | Python | Runtime Error | A, B, C, K = map(int, input.split(" "))
if K <= A:
print(K)
else:
K = K - A
if K <= B:
print(A)
else:
K = K - B
print(A - K)
| A, B, C, K = map(int, input().split(" "))
if K <= A:
print(K)
else:
K = K - A
if K <= B:
print(A)
else:
K = K - B
print(A - K)
| replace | 0 | 1 | 0 | 1 | AttributeError: 'builtin_function_or_method' object has no attribute 'split' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02682/Python/s825415458.py", line 1, in <module>
A, B, C, K = map(int, input.split(" "))
AttributeError: 'builtin_function_or_method' object has no attribute 'split'
|
p02682 | Python | Time Limit Exceeded | A, B, C, K = map(int, input().split())
a = []
b = []
c = []
for x in range(A):
a.append(1)
for y in range(B):
b.append(0)
for z in range(C):
c.append(-1)
sum = 0
arr = a + b + c
for i in range(K):
sum += arr[i]
print(sum)
| A, B, C, K = map(int, input().split())
k = K
a = min(A, k)
k -= a
b = min(B, k)
k -= b
c = min(C, k)
print(a - c)
| replace | 1 | 15 | 1 | 8 | TLE | |
p02682 | Python | Time Limit Exceeded | a, b, c, k = map(int, input().split(" "))
cnt_a = 0
cnt_b = 0
cnt_c = 0
while k != 0:
if a > 0:
cnt_a += 1
a -= 1
k -= 1
elif b > 0:
cnt_b += 1
b -= 1
k -= 1
else:
cnt_c += 1
c -= 1
k -= 1
result = cnt_a * 1 + cnt_b * 0 + cnt_c * (-1... | a, b, c, k = map(int, input().split(" "))
cnt_a = 0
cnt_b = 0
cnt_c = 0
if (a > 0) & (a > k):
cnt_a = k
k = 0
else:
cnt_a = a
k = k - cnt_a
if (b > 0) & (b > k):
cnt_b = k
k = 0
else:
cnt_b = b
k = k - cnt_b
if c > 0:
cnt_c = k
result = cnt_a * 1 + cnt_b * 0 + cnt_c * (-1)
print... | replace | 6 | 19 | 6 | 22 | TLE | |
p02682 | Python | Time Limit Exceeded | a, b, c, k = map(int, input().split())
ans = 0
for i in range(k):
if a != 0:
ans += 1
a += -1
continue
if b != 0:
ans += 0
b += -1
continue
if c != 0:
ans += -1
c += -1
continue
print(ans)
| a, b, c, k = map(int, input().split())
ans = 0
if a > k:
ans += 1 * k
k = 0
else:
ans += 1 * a
k -= a
if b > k:
ans += 0 * k
k = 0
else:
ans += 0 * b
k -= b
if c > k:
ans += -1 * k
k = 0
else:
ans += -1 * c
k -= c
print(ans)
| replace | 3 | 16 | 3 | 26 | TLE | |
p02682 | Python | Time Limit Exceeded | a, b, c, k = map(int, input().split())
ans = 0
while True:
flg = True
for i in range(a):
ans += 1
k -= 1
if k == 0:
flg = False
break
if not flg:
break
for i in range(b):
k -= 1
if k == 0:
flg = False
br... | a, b, c, k = map(int, input().split())
if k <= a:
print(k)
elif k <= a + b:
print(a)
else:
print(a - (k - a - b))
| replace | 2 | 37 | 2 | 8 | TLE | |
p02682 | Python | Time Limit Exceeded | a, b, c, k = map(int, input().split())
ans = 0
for i in range(k):
if a >= 1:
ans += 1
a -= 1
elif b >= 1:
b -= 1
pass
else:
ans -= 1
print(ans)
| a, b, c, k = map(int, input().split())
if k <= a:
print(k)
elif k - a > b:
print(-1 * ((k - a) - b) + a)
else:
print(a)
| replace | 2 | 14 | 2 | 8 | TLE | |
p02682 | Python | Runtime Error | A, B, C, K = map(int, input().spliit())
if K <= A:
print(K)
elif K <= A + B:
print(A)
else:
print(A - (K - (A + B)))
| A, B, C, K = map(int, input().split())
if K <= A:
print(K)
elif K <= A + B:
print(A)
else:
print(A - (K - (A + B)))
| replace | 0 | 1 | 0 | 1 | AttributeError: 'str' object has no attribute 'spliit'. Did you mean: 'split'? | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02682/Python/s025305163.py", line 1, in <module>
A, B, C, K = map(int, input().spliit())
AttributeError: 'str' object has no attribute 'spliit'. Did you mean: 'split'?
|
p02682 | Python | Runtime Error | def main():
A, B, C, K = map(int, input().split())
li = [1] * A
li += [0] * B
li += [-1] * C
print(sum(li[:K]))
if __name__ == "__main__":
main()
| def main():
A, B, _, K = map(int, input().split())
if A > K:
print(K)
quit()
print(A - max([0, K - A - B]))
if __name__ == "__main__":
main()
| replace | 1 | 6 | 1 | 6 | 0 | |
p02682 | Python | Runtime Error | A, B, C, K = (int(x) for x in input().split())
a = [1] * A
b = [0] * B
c = [-1] * C
X = a + b + c
print(sum(X[:K]))
| A, B, C, K = map(int, input().split())
if K <= A:
print(K)
elif K <= A + B:
print(A)
else:
print(2 * A + B - K)
| replace | 0 | 8 | 0 | 7 | 0 | |
p02682 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int k, a, b, c, sum = 0;
cin >> a >> b >> c >> k;
for (int i = 0; i < k; i++) {
if (a > 0) {
sum++;
a--;
} else if (a == ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int k, a, b, c, sum = 0;
cin >> a >> b >> c >> k;
if (k >= a) {
k -= a;
sum += a;
} else {
sum = k;
k = 0;
}
if (k >= ... | replace | 12 | 22 | 12 | 29 | TLE | |
p02682 | C++ | Time Limit Exceeded |
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rrep(i, a, b) for (int i = a; i >= b; --i)
#define fore(i, a) for (auto &i :... |
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rrep(i, a, b) for (int i = a; i >= b; --i)
#define fore(i, a) for (auto &i :... | replace | 95 | 105 | 95 | 103 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, k, ans = 0;
cin >> a >> b >> c >> k;
long long total = a + b + c;
if (k >= total)
cout << a - c << endl;
else {
for (long long i = 0; i < k; i++) {
if (a != 0) {
ans++;
a--;
} else if (a == 0 && ... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, k, ans = 0;
cin >> a >> b >> c >> k;
long long total = a + b + c;
if (k >= total)
cout << a - c << endl;
else {
int some = 0;
some = k - a;
if (some > 0) {
ans = a;
for (long long i = 0; i < some; i++) {... | replace | 10 | 22 | 10 | 24 | TLE | |
p02682 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
int main() {
ll a, b, c, k;
cin >> a >> b >> c >> k;
vector<ll> p(a + b + c);
for (ll i = 0; i < a; i++)
... | #include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
int main() {
ll a, b, c, k;
cin >> a >> b >> c >> k;
if (k <= a)
cout << k << "\n";
else {
if (k <= ... | replace | 13 | 23 | 13 | 21 | 0 | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) \
{ \
for (auto i : x) { ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) \
{ \
for (auto i : x) { ... | replace | 17 | 23 | 17 | 25 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | replace | 24 | 36 | 24 | 30 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
int main() {
long long a, b, c, k;
long long ans = 0;
cin >> a >> b >> c >> k;
Rep(i, k) {
if (a > 0) {
ans++;
a--;
continu... | #include <bits/stdc++.h>
using namespace std;
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define For(i, n1, n2) for (int i = (int)(n1); i < (int)(n2); i++)
int main() {
int a, b, c, k;
int ans = 0;
cin >> a >> b >> c >> k;
Rep(i, k) {
if (a > 0) {
ans++;
a--;
continue;
}
... | replace | 6 | 8 | 6 | 8 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;
int main() {
ll a, b, c, k;
cin >> a >> b >> c >> k;
ll s = 0;
rep(i, k) {
if (a > 0) {
s += 1;
a--;
} else if (b > 0) {
b--;
} else {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;
int main() {
ll a, b, c, k;
cin >> a >> b >> c >> k;
ll s = 0;
if (a >= k) {
s = k;
} else if (a + b >= k) {
s = a;
} else {
s = a - (k - a - b);
}
... | replace | 11 | 21 | 11 | 17 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
int main(void) {
ll a, b, c, k;
cin >> a >> b >> c >> k;
ll ans = 0;
rep(i, k) {
if (a > 0) {
ans++;
a--;
} else if (b > 0) {
b--;
} else {
ans--;
c--;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
int main(void) {
ll a, b, c, k;
cin >> a >> b >> c >> k;
ll ans = 0;
if (a >= k)
ans = k;
else if (a + b >= k)
ans = a;
else
ans = a - (k - a - b);
cout << ans << endl;
return... | replace | 10 | 21 | 10 | 16 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int sum = 0, i = 0;
while (i < k) {
if (a-- > 0)
sum += 1;
else if (b-- > 0)
sum += 0;
else if (c-- > 0)
sum -= 1;
else
break;
i++;
}
cout << sum;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
int sum = 0, i = k;
if (a <= i) {
sum += a;
i -= a;
} else {
sum += i;
i -= i;
}
if (b <= i) {
i -= b;
} else {
i -= i;
}
if (c <= i) {
sum -= c;
i -= c;
} else {
... | replace | 7 | 18 | 7 | 29 | TLE | |
p02682 | C++ | Runtime Error | #include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
vector<long long> num(a + b + c);
rep(i, a) num.at(i) = 1;
rep(i, b) num.at(a + i) = 0;
rep(i, c) num.at(a + b + i) = -1;
lon... | #include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int a, b, c, k;
cin >> a >> b >> c >> k;
if (k <= a)
cout << k << endl;
else if (k <= a + b)
cout << a << endl;
else
cout << a - (k - a - b) << endl;
}
| replace | 7 | 14 | 7 | 13 | 0 | |
p02682 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
long long A, B, C, K;
cin >> A >> B >> C >> K;
long long ans = 0;
while (K > 0) {
if (A > 0) {
--K;
--A;
++ans;
} else if (A == 0 && B > 0... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
long long A, B, C, K;
cin >> A >> B >> C >> K;
long long ans = 0;
if (A > K) {
ans += K;
K = 0;
} else {
ans += A;
K -= A;
}
if (K > 0) {
... | replace | 12 | 24 | 12 | 33 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long A, B, C, K, Ans = 0, count = 1;
cin >> A >> B >> C >> K;
for (int i = 1; i <= A; i++) {
if (count > K)
break;
Ans++;
count++;
}
for (int i = 1; i <= B; i++) {
if (count > K)
break;
count++;
}
for (int i = 1... | #include <bits/stdc++.h>
using namespace std;
int main() {
long A, B, C, K, Ans = 0, count = 1;
cin >> A >> B >> C >> K;
for (int i = 1; i <= A; i++) {
if (count > K)
break;
Ans++;
count++;
}
count += B;
for (int i = 1; i <= C; i++) {
if (count > K)
break;
Ans--;
coun... | replace | 14 | 19 | 14 | 15 | TLE | |
p02682 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll A, B, C, K;
cin >> A >> B >> C >> K;
ll ans = 0;
for (size_t i = 1; i <= K; i++) {
if (A > 0) {
ans += 1;
A--;
} else if (B > 0) {
ans += 0;
B--;
} else if (C > 0) {
ans += -1;
C... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll A, B, C, K;
cin >> A >> B >> C >> K;
ll ans = 0;
for (size_t i = 1; i <= K; i++) {
if (A <= 0 && B <= 0 && C <= 0) {
break;
}
if (A > 0) {
ans += 1;
A--;
} else if (B > 0) {
ans += 0;
... | insert | 10 | 10 | 10 | 14 | TLE | |
p02682 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define l(i, a, b) for (auto i = a; i < b; i++)
#define lr(i, a, b) for (auto i = a; i >= b; i--)
#define ll long long
#define lli long long int
#define ld long double
#define vec vector<int>
#define mii map<ll, ll>
#define vl vector<long long>
#define se set<long ... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define l(i, a, b) for (auto i = a; i < b; i++)
#define lr(i, a, b) for (auto i = a; i >= b; i--)
#define ll long long
#define lli long long int
#define ld long double
#define vec vector<int>
#define mii map<ll, ll>
#define vl vector<long long>
#define se set<long ... | replace | 27 | 36 | 27 | 37 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.