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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02749 | C++ | Runtime Error | #include <algorithm> //sort,reverse
#include <deque> //double_ended queue
#include <iostream>
#include <queue> //queue,priority_queue
#include <string>
#include <utility> //pair
#include <vector>
using namespace std;
typedef pair<int, int> P; // Pでpair<-,->を表す。
typedef long long LL;
LL MOD = 1000000007;
/*ここから*/
i... | #include <algorithm> //sort,reverse
#include <deque> //double_ended queue
#include <iostream>
#include <queue> //queue,priority_queue
#include <string>
#include <utility> //pair
#include <vector>
using namespace std;
typedef pair<int, int> P; // Pでpair<-,->を表す。
typedef long long LL;
LL MOD = 1000000007;
/*ここから*/
i... | replace | 48 | 49 | 48 | 49 | 0 | |
p02749 | Python | Runtime Error | from collections import deque
N = int(input())
G = [[] for _ in range(N + 1)]
dist = [-1 for _ in range(N + 1)]
for _ in range(N - 1):
a, b = map(int, input().split())
G[a].append(b)
G[b].append(a)
zero = []
one = []
two = []
for i in range(1, N + 1):
if i % 3 == 1:
one.append(i)
elif i % 3... | from collections import deque
N = int(input())
G = [[] for _ in range(N + 1)]
dist = [-1 for _ in range(N + 1)]
for _ in range(N - 1):
a, b = map(int, input().split())
G[a].append(b)
G[b].append(a)
zero = []
one = []
two = []
for i in range(1, N + 1):
if i % 3 == 1:
one.append(i)
elif i % 3... | replace | 23 | 24 | 23 | 24 | TypeError: deque.pop() takes no arguments (1 given) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02749/Python/s008733613.py", line 23, in <module>
s = q.pop(0)
TypeError: deque.pop() takes no arguments (1 given)
|
p02749 | Python | Runtime Error | N = int(input())
T = [[] for _ in range(N)]
for _ in range(N - 1):
a, b = map(int, input().split())
a, b = a - 1, b - 1
T[a].append(b)
T[b].append(a)
colors = [-1] * N
stack = [(0, 0)]
while stack:
n, color = stack.pop()
colors[n] = color
for to in T[n]:
if colors[to] != -1:
... | N = int(input())
T = [[] for _ in range(N)]
for _ in range(N - 1):
a, b = map(int, input().split())
a, b = a - 1, b - 1
T[a].append(b)
T[b].append(a)
colors = [-1] * N
stack = [(0, 0)]
while stack:
n, color = stack.pop()
colors[n] = color
for to in T[n]:
if colors[to] != -1:
... | replace | 51 | 52 | 51 | 52 | IndexError: pop from empty list | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02749/Python/s592613558.py", line 54, in <module>
ans.append(X[2].pop())
IndexError: pop from empty list
|
p02749 | Python | Runtime Error | n = int(input())
ab = [list(map(int, input().split())) for _ in range(n - 1)]
adj = [[] for _ in range(n)]
for a, b in ab:
a -= 1
b -= 1
adj[a].append(b)
adj[b].append(a)
class Tree:
WHITE = 0
GRAY = -1
BLACK = 1
def __init__(self, adj):
n = len(adj)
self.adj = adj
... | import sys
sys.setrecursionlimit(10**6)
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n - 1)]
adj = [[] for _ in range(n)]
for a, b in ab:
a -= 1
b -= 1
adj[a].append(b)
adj[b].append(a)
class Tree:
WHITE = 0
GRAY = -1
BLACK = 1
def __init__(self, adj):
... | insert | 0 | 0 | 0 | 4 | 0 | |
p02749 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... | delete | 111 | 113 | 111 | 111 | 0 | |
p02749 | C++ | Runtime Error | /*
二部グラフになるように色を付ける。
不可能ならば空のvectorを返す
0 or 1で色を付ける
-1は頂点0とつながってない部分
vector<int>();
GはGraphを想定
WeightGraphの場合は//+++++の部分を変える必要がある
verify:
https://atcoder.jp/contests/hitachi2020/tasks/hitachi2020_c
*/
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using Graph = vector<vector<int>>;
te... | /*
二部グラフになるように色を付ける。
不可能ならば空のvectorを返す
0 or 1で色を付ける
-1は頂点0とつながってない部分
vector<int>();
GはGraphを想定
WeightGraphの場合は//+++++の部分を変える必要がある
verify:
https://atcoder.jp/contests/hitachi2020/tasks/hitachi2020_c
*/
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using Graph = vector<vector<int>>;
te... | replace | 33 | 34 | 33 | 34 | -11 | |
p02749 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> P;
struct Graph {
int n;
vector<vector<int>> g;
Graph(int n) : n(n) { g.resize(n); }
void init(int n_) {
n = n_;
g.resize(n_);
}
void add_edge(int from, int to) { g[from].push_back(to); }
};
vecto... | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> P;
struct Graph {
int n;
vector<vector<int>> g;
Graph(int n) : n(n) { g.resize(n); }
void init(int n_) {
n = n_;
g.resize(n_);
}
void add_edge(int from, int to) { g[from].push_back(to); }
};
vecto... | replace | 66 | 67 | 66 | 67 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int _ = 1e5 + 7;
struct Edge {
int end, upEd;
} Ed[_ << 1];
int head[_], cntEd, col[2], N;
void addEd(int a, int b) {
Ed[++cntEd] = (Edge){b, head[a]};
head[a] = cntEd;
}
void dfs(int x, int p, int c) {
++col[c];
for (int i = head[x]; i; i = Ed[i].upEd)
... | #include <bits/stdc++.h>
using namespace std;
const int _ = 2e5 + 7;
struct Edge {
int end, upEd;
} Ed[_ << 1];
int head[_], cntEd, col[2], N;
void addEd(int a, int b) {
Ed[++cntEd] = (Edge){b, head[a]};
head[a] = cntEd;
}
void dfs(int x, int p, int c) {
++col[c];
for (int i = head[x]; i; i = Ed[i].upEd)
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef int LL;
#define pb push_back
const LL maxn = 1e6 + 9;
struct node {
LL to, nxt;
} dis[maxn];
LL n, num;
LL head[maxn], p[maxn], dep[maxn];
std::vector<LL> V[3], a[3];
void Add(LL u, LL v) {
dis[++num] = (node){v, head[u]};
head[u] = num;
}
void Dfs(LL u, LL f) {
V[dep[u]].pb(u);... | #include <bits/stdc++.h>
typedef int LL;
#define pb push_back
const LL maxn = 1e6 + 9;
struct node {
LL to, nxt;
} dis[maxn];
LL n, num;
LL head[maxn], p[maxn], dep[maxn];
std::vector<LL> V[3], a[3];
void Add(LL u, LL v) {
dis[++num] = (node){v, head[u]};
head[u] = num;
}
void Dfs(LL u, LL f) {
V[dep[u]].pb(u);... | replace | 46 | 47 | 46 | 47 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ll = long long int;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using P = pair<int... | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ll = long long int;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using P = pair<int... | replace | 537 | 540 | 537 | 542 | 0 | |
p02749 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <queue>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
struct Edge {
int next, to;
} e[MAXN << 1];
int head[MAXN], etot = 0;
inline void add(int u, int v) {
e[++etot] = (Edge){head[u], v};
head[u] = etot;
}
int clr[MAXN], ccnt[3];
void dfs(in... | #include <algorithm>
#include <cstdio>
#include <queue>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
struct Edge {
int next, to;
} e[MAXN << 1];
int head[MAXN], etot = 0;
inline void add(int u, int v) {
e[++etot] = (Edge){head[u], v};
head[u] = etot;
}
int clr[MAXN], ccnt[3];
void dfs(in... | replace | 55 | 56 | 55 | 56 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 200002
using namespace std;
vector<int> v[N], vv[2], nr[3];
int c[N], l[N];
void dfs(int i) {
vv[l[i] % 2].push_back(i);
for (auto it : v[i])
if (!l[it])
l[it] = l[i] + 1, dfs(it);
}
void ad(int i, int j) {
c[vv[i].back()] = nr[j].back();
vv[i].pop_back();
nr[j].po... | #include <bits/stdc++.h>
#define N 200002
using namespace std;
vector<int> v[N], vv[2], nr[3];
int c[N], l[N];
void dfs(int i) {
vv[l[i] % 2].push_back(i);
for (auto it : v[i])
if (!l[it])
l[it] = l[i] + 1, dfs(it);
}
void ad(int i, int j) {
c[vv[i].back()] = nr[j].back();
vv[i].pop_back();
nr[j].po... | replace | 33 | 34 | 33 | 34 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (long long i = o; i < n; i++)
#define FORR(x, arr) for (auto &x : arr)
#define oneforall \
ios::sync_with_stdio(false); \
cin.tie(0);
#d... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (long long i = o; i < n; i++)
#define FORR(x, arr) for (auto &x : arr)
#define oneforall \
ios::sync_with_stdio(false); \
cin.tie(0);
#d... | replace | 50 | 51 | 50 | 51 | 0 | |
p02749 | C++ | Runtime Error | //
// main.cpp
//
#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#inclu... | //
// main.cpp
//
#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#inclu... | replace | 124 | 126 | 124 | 131 | 0 | |
p02749 | C++ | Runtime Error | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include... | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include... | replace | 91 | 93 | 91 | 93 | 0 | |
p02749 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
struct edge {
int to;
int cost;
edge(int t, int w) : to(t), cost(w) {}
};
in... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
struct edge {
int to;
int cost;
edge(int t, int w) : to(t), cost(w) {}
};
in... | replace | 25 | 26 | 25 | 26 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
template <typename ty1, typename ty2> inline int add(ty1 x, ty2 y) {
if (y >= MOD)
y %= MOD;
if (x >= MOD)
x %= MOD;
x += y;
return x < MOD ? x : x - MOD;
}
template <typename ty1, typename ty2> inline void addto(ty1 &x, ty2 y) {
if... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
template <typename ty1, typename ty2> inline int add(ty1 x, ty2 y) {
if (y >= MOD)
y %= MOD;
if (x >= MOD)
x %= MOD;
x += y;
return x < MOD ? x : x - MOD;
}
template <typename ty1, typename ty2> inline void addto(ty1 &x, ty2 y) {
if... | replace | 52 | 53 | 52 | 53 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define F(i, a, b) for (long long i = a; i < b; i++)
#define rF(i, a, b) for (long long i = a - 1; i >= b; i--)
#define endl "\n"
#define min1(x, y, z) min(x, min(y, z))
#define max1(x, y, z) max(x, max(y, z))
#define input_vector(v, n, type) ... | #include <bits/stdc++.h>
using namespace std;
#define F(i, a, b) for (long long i = a; i < b; i++)
#define rF(i, a, b) for (long long i = a - 1; i >= b; i--)
#define endl "\n"
#define min1(x, y, z) min(x, min(y, z))
#define max1(x, y, z) max(x, max(y, z))
#define input_vector(v, n, type) ... | replace | 25 | 26 | 25 | 26 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | replace | 15 | 17 | 15 | 17 | 0 | |
p02749 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
typedef long long... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <vector>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
typedef long long... | replace | 52 | 53 | 52 | 53 | 0 | 0 1 1 2 2
2 3
|
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> v[3], g[2], l[200003];
int n, ans[200003];
bool used[200003];
void dfs(int x, bool a, int p) {
g[a].push_back(x);
for (int i = 0; i < l[x].size(); i++)
if (l[x][i] != p)
dfs(l[x][i], a ^ 1, x);
}
int main() {
scanf("%d", &n);
for (int i = 1; i ... | #include <bits/stdc++.h>
using namespace std;
vector<int> v[3], g[2], l[200003];
int n, ans[200003];
bool used[200003];
void dfs(int x, bool a, int p) {
g[a].push_back(x);
for (int i = 0; i < l[x].size(); i++)
if (l[x][i] != p)
dfs(l[x][i], a ^ 1, x);
}
int main() {
scanf("%d", &n);
for (int i = 1; i ... | replace | 24 | 25 | 24 | 25 | 0 | |
p02749 | C++ | Runtime Error | #include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<do... | #include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<do... | replace | 45 | 46 | 45 | 46 | 0 | |
p02750 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
static const int64_t INF = 100000000000;
int64_t N, T;
int64_t dp[100005][31];
int main() {
cin >> N >> T;
vector<int64_t> A(N);
vector<int64_t> B(N);
for (int i = 0; i < N; i++) {
int64_t a;
cin >> a;
A.at(i) = a + 1;
cin >> B.at(i);
}
vector<pa... | #include <bits/stdc++.h>
using namespace std;
static const int64_t INF = 100000000000;
int64_t N, T;
int64_t dp[200005][31];
int main() {
cin >> N >> T;
vector<int64_t> A(N);
vector<int64_t> B(N);
for (int i = 0; i < N; i++) {
int64_t a;
cin >> a;
A.at(i) = a + 1;
cin >> B.at(i);
}
vector<pa... | replace | 4 | 5 | 4 | 5 | 0 | |
p02750 | C++ | Time Limit Exceeded | /*
This code has been written by MinakoKojima, feel free to ask me question.
Blog: http://www.shuizilong.com/house Template Date: 2015.10.12 Note: ...
*/
#pragma comment(linker, "/STACK:36777216")
// #pragma GCC optimize ("O2")
#define LOCAL
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cl... | /*
This code has been written by MinakoKojima, feel free to ask me question.
Blog: http://www.shuizilong.com/house Template Date: 2015.10.12 Note: ...
*/
#pragma comment(linker, "/STACK:36777216")
// #pragma GCC optimize ("O2")
#define LOCAL
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cl... | delete | 794 | 799 | 794 | 794 | TLE | |
p02750 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
const int N = 35;
pii a[200010];
long long dp[200010][40];
long long sum[200010];
bool cmp(pii a, pii b) {
return (long double)a.fi / (a.se + 1) > (long double)b.fi / (b.se + 1);
}
in... | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
const int N = 35;
pii a[200010];
long long dp[200010][40];
long long sum[200010];
bool cmp(pii a, pii b) {
return (long double)a.fi / (a.se + 1) > (long double)b.fi / (b.se + 1);
}
in... | delete | 23 | 35 | 23 | 23 | TLE | |
p02750 | C++ | Runtime Error | // Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;
template <typename T> bool chmin(T &x, T y) {
if (x > y) {
x = y;
return true;
}
return false;
}
template ... | // Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;
template <typename T> bool chmin(T &x, T y) {
if (x > y) {
x = y;
return true;
}
return false;
}
template ... | insert | 76 | 76 | 76 | 77 | 0 | |
p02750 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
struct Data {
ll a, b;
bool operator<(const Data &other) const {
if (a == other.a)
return (b < other.b);
return ((a * (other.b + 1)) > (other.a * (b + 1)));
}
};
int main() {
// freopen("a.in", "r... | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
struct Data {
ll a, b;
bool operator<(const Data &other) const {
if (a == other.a)
return (b < other.b);
return ((a * (other.b + 1)) > (other.a * (b + 1)));
}
};
int main() {
// freopen("a.in", "r... | replace | 36 | 37 | 36 | 39 | 0 | |
p02750 | C++ | Runtime Error | // Zory-2020
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(), (x).end()
#define sz... | // Zory-2020
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(), (x).end()
#define sz... | replace | 121 | 122 | 121 | 122 | 0 | |
p02750 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxi = 1e6 + 10;
const long long inf = 1e9 + 10;
int n;
long long t;
pair<long long, long long> a[maxi];
long long dp[41][maxi];
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
// if (x.first == 0 && y.first == 0) return x.second < y... | #include <bits/stdc++.h>
using namespace std;
const int maxi = 1e6 + 10;
const long long inf = 1e9 + 10;
int n;
long long t;
pair<long long, long long> a[maxi];
long long dp[41][maxi];
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
if (!x.first && !y.first)
return x.second < y.second;
... | replace | 12 | 16 | 12 | 13 | -11 | |
p02750 | C++ | Time Limit Exceeded | /*
This code has been written by MinakoKojima, feel free to ask me question.
Blog: http://www.shuizilong.com/house Template Date: 2015.10.12 Note: ...
*/
#pragma comment(linker, "/STACK:36777216")
// #pragma GCC optimize ("O2")
#define LOCAL
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cl... | /*
This code has been written by MinakoKojima, feel free to ask me question.
Blog: http://www.shuizilong.com/house Template Date: 2015.10.12 Note: ...
*/
#pragma comment(linker, "/STACK:36777216")
// #pragma GCC optimize ("O2")
#define LOCAL
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cl... | replace | 794 | 795 | 794 | 795 | TLE | |
p02750 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define F first
#define S second
typedef pair<int, int> P;
const int N = 30 + 5, INF = 0x3f3f3f3f;
inline int read() {
int x = 0, f = 0;
char ch = 0;
while (!isdigit(ch))
f |= ch == '-', ch = getchar();
while (isdigit(c... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define F first
#define S second
typedef pair<int, int> P;
const int N = 30 + 5, INF = 0x3f3f3f3f;
inline int read() {
int x = 0, f = 0;
char ch = 0;
while (!isdigit(ch))
f |= ch == '-', ch = getchar();
while (isdigit(c... | replace | 42 | 47 | 42 | 46 | 0 | |
p02750 | Python | Time Limit Exceeded | def main():
# input
N, T = map(int, input().split())
a, b = [], []
a0_b = []
for i in range(N):
a_in, b_in = map(int, input().split())
if a_in == 0:
a0_b.append(b_in)
else:
a.append(a_in)
b.append(b_in)
L = len(a)
# sort
ab_rat... | import sys
input = sys.stdin.readline
def main():
# input
N, T = map(int, input().split())
a, b = [], []
a0_b = []
for i in range(N):
a_in, b_in = map(int, input().split())
if a_in == 0:
a0_b.append(b_in)
else:
a.append(a_in)
b.append(b_... | insert | 0 | 0 | 0 | 5 | TLE | |
p02750 | C++ | Runtime Error | // #include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// #include "boost/multiprecision/cpp_int.hpp"
// typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9 + 7)
// #define i_7 998244353
#define i_5 i_7 - 2
ll mod(ll a) {
ll c = a % i_7;
i... | // #include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// #include "boost/multiprecision/cpp_int.hpp"
// typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9 + 7)
// #define i_7 998244353
#define i_5 i_7 - 2
ll mod(ll a) {
ll c = a % i_7;
i... | replace | 85 | 86 | 85 | 86 | 0 | |
p02750 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for (int i = (x); i < (y); ++i)
#define REP(i, x, y) for (int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double d... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for (int i = (x); i < (y); ++i)
#define REP(i, x, y) for (int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double d... | replace | 25 | 26 | 25 | 28 | 0 | |
p02751 | C++ | Runtime Error | // #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <t... | // #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <t... | replace | 79 | 81 | 79 | 80 | 0 | |
p02751 | C++ | Runtime Error | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragm... | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragm... | replace | 78 | 79 | 78 | 79 | 0 | |
p02751 | C++ | Runtime Error | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template <class t> inline t read(t &x) {
char c = getchar();
bool f = 0;
x = 0;
while (!isdigit(c))
f |= c == '-', c = getchar();
while (isdigit(c))
x = (x << 1) + (x << 3) + (c ^ 48),... | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template <class t> inline t read(t &x) {
char c = getchar();
bool f = 0;
x = 0;
while (!isdigit(c))
f |= c == '-', c = getchar();
while (isdigit(c))
x = (x << 1) + (x << 3) + (c ^ 48),... | replace | 35 | 36 | 35 | 36 | 0 | |
p02751 | 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 | 128 | 129 | 128 | 129 | 0 | |
p02752 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define MOD 998244353
template <typename ty1, typename ty2> inline int add(ty1 x, ty2 y) {
if (y >= MOD)
y %= MOD;
if (x >= MOD)
x %= MOD;
x += y;
return x < MOD ? x : x - MOD;
}
template <typename ty1, typename ty2> inline void addto(ty1 &x, ty2 y) {
if ... | #include <bits/stdc++.h>
using namespace std;
#define MOD 998244353
template <typename ty1, typename ty2> inline int add(ty1 x, ty2 y) {
if (y >= MOD)
y %= MOD;
if (x >= MOD)
x %= MOD;
x += y;
return x < MOD ? x : x - MOD;
}
template <typename ty1, typename ty2> inline void addto(ty1 &x, ty2 y) {
if ... | replace | 280 | 296 | 280 | 287 | TLE | |
p02752 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _ed = (b); i <= _ed; ++i)
#define DREP(i, a, b) for (int i = (a), _ed = (b); i >= _ed; --i)
#define mp(x, y) make_pair((x), (y))
#define sz(x) (int)(x).size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
inlin... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), _ed = (b); i <= _ed; ++i)
#define DREP(i, a, b) for (int i = (a), _ed = (b); i >= _ed; --i)
#define mp(x, y) make_pair((x), (y))
#define sz(x) (int)(x).size()
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
inlin... | replace | 83 | 85 | 83 | 85 | TLE | |
p02753 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#include <float.h>
#include ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#include <float.h>
#include ... | insert | 65 | 65 | 65 | 66 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | #include <bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for (int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair
typedef unsigned long long ... | replace | 22 | 23 | 22 | 23 | 0 | |
p02753 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
if (s.at(0) == s.at(1) && s.at(1) == s.at(2))
cout << "No" << endl;
else
cout << "Yes" << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) && s.at(1) == s.at(2))
cout << "No" << endl;
else
cout << "Yes" << endl;
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
char a = S.at(0);
char b = S.at(1);
char c = S.at(2);
if (a == b && b == c) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
char a = S.at(0);
char b = S.at(1);
char c = S.at(2);
if (a == b && b == c) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(1) == 'A' && s.at(2) == 'A' && s.at(3) == 'A') {
cout << "No" << endl;
} else if (s.at(1) == 'B' && s.at(2) == 'B' && s.at(3) == 'B') {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool k = true;
for (int i = 0; i < 3; i++) {
if (s.at(i) == 'A') {
continue;
} else if (s.at(1) == 'B') {
break;
} else if (s.at(i) == 'B') {
k = false;
break;
} else {
}
}
for (int i ... | replace | 6 | 9 | 6 | 30 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define mod 1000000007
int main() {
#ifndef ONLINE_JUDGE
freopen("in... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define mod 1000000007
int main() {
// #ifndef ONLINE_JUDGE
// ... | replace | 8 | 12 | 8 | 12 | 0 |
Time elapsed: 0.02945 s.
|
p02753 | C++ | Runtime Error | /*--------------------------"SABUJ-JANA"------"JADAVPUR UNIVERSITY"--------*/
/*-------------------------------@greenindia-----------------------------------*/
//
// _____ _ _ _
// / ____| | | (_) | |
// | (___ __ _| |__ _ _ _ | | __ _ _ __ __ _
// \___ \ / _... | /*--------------------------"SABUJ-JANA"------"JADAVPUR UNIVERSITY"--------*/
/*-------------------------------@greenindia-----------------------------------*/
//
// _____ _ _ _
// / ____| | | (_) | |
// | (___ __ _| |__ _ _ _ | | __ _ _ __ __ _
// \___ \ / _... | replace | 42 | 45 | 42 | 45 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(1) == 'B' && S.at(2) == 'B' && S.at(3) == 'B')
cout << "No" << endl;
else
cout << "Yes" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if ((S.at(0) == 'B' && S.at(1) == 'B' && S.at(2) == 'B') ||
S.at(0) == 'A' && S.at(1) == 'A' && S.at(2) == 'A')
cout << "No" << endl;
else
cout << "Yes" << endl;
} | replace | 5 | 6 | 5 | 7 | 0 | |
p02753 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
if (S == "AAA" || S == "BBB") {
cout << "No" << endl;
return -1;
}
cout << "Yes" << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
if (S == "AAA" || S == "BBB") {
cout << "No" << endl;
exit(0);
}
cout << "Yes" << endl;
} | replace | 11 | 12 | 11 | 12 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> s;
for (int i = 0; i < 3; i++)
cin >> s[i];
if (s[0] == s[1] && s[1] == s[2] && s[2] == s[0])
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
for (int i = 0; i < 3; i++)
cin >> s[i];
if (s[0] == s[1] && s[1] == s[2] && s[2] == s[0])
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
} | replace | 4 | 5 | 4 | 5 | -11 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mod 1000000007
#define db(a) cout << a << endl
#define db2(a, b) cout << a << " " << b << endl
#define dbp(a) cout << a.first << " " << a.second << endl
#define adb(a) \
for (auto i : a) ... | #include <bits/stdc++.h>
#define mod 1000000007
#define db(a) cout << a << endl
#define db2(a, b) cout << a << " " << b << endl
#define dbp(a) cout << a.first << " " << a.second << endl
#define adb(a) \
for (auto i : a) ... | delete | 20 | 25 | 20 | 20 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, ans;
string s;
cin >> s;
if (s.at(1) == s.at(2) && s.at(2) == s.at(3))
cout << "No";
else
cout << "Yes";
// cout << ans << "\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, ans;
string s;
cin >> s;
if (s.at(1) == s.at(2) && s.at(0) == s.at(1))
cout << "No";
else
cout << "Yes";
// cout << ans << "\n";
return 0;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(1) == S.at(2) && S.at(2) == S.at(3))
cout << "No" << endl;
else
cout << "Yes" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(0) == S.at(1) && S.at(1) == S.at(2))
cout << "No" << endl;
else
cout << "Yes" << endl;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(1) == s.at(2) && s.at(2) == s.at(3) && s.at(1) == s.at(3)) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s == "AAA" || s == "BBB") {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl "\n"
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
#define... | #include <bits/stdc++.h>
#define endl "\n"
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(0);
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
#define... | replace | 32 | 36 | 32 | 36 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main() {
string s;
if (s.at(0) == s.at(1) && s.at(1) == s.at(2))
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main() {
string s;
cin >> s;
if (s.at(0) == s.at(1) && s.at(1) == s.at(2))
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
}
| insert | 7 | 7 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02753 | C++ | Runtime Error | /*Author : Kartik Bansal
*Date : 07/09/19
*Time : 16:14 */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define tc \
int t; \
cin >> t; ... | /*Author : Kartik Bansal
*Date : 07/09/19
*Time : 16:14 */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define tc \
int t; \
cin >> t; ... | replace | 29 | 33 | 29 | 33 | 0 | |
p02753 | C++ | Runtime Error | #include <iostream>
#include <string>
int main() {
std::string str;
std::cin >> str;
for (int i = 0; i < 3; i++)
for (int j = j + 1; j < 3; j++)
if (str[i] != str[j]) {
std::cout << "Yes" << std::endl;
return 0;
}
std::cout << "No" << std::endl;
} | #include <iostream>
#include <string>
int main() {
std::string str;
std::cin >> str;
int ca = 0;
int cb = 0;
for (int i = 0; i < 3; ++i)
if (str[i] == 'A')
ca += 1;
else
cb += 1;
if (ca == 3 || cb == 3)
std::cout << "No" << std::endl;
else
std::cout << "Yes" << std::endl;
} | replace | 6 | 13 | 6 | 17 | 0 | |
p02753 | C++ | Runtime Error | // Nguyen Anh Tu
#include <bits/stdc++.h>
#define FOR(x, a, b) for (int x = a; x <= b; x++)
#define FORD(x, a, b) for (int x = a; x >= b; x--)
#define maxn 100005
#define maxc 1000000007
#define MOD 1000000007
#define reset(x, y) memset(x, y, sizeof(x))
#define task ""
#define mp make_pair
#define pb push_back
#define ... | // Nguyen Anh Tu
#include <bits/stdc++.h>
#define FOR(x, a, b) for (int x = a; x <= b; x++)
#define FORD(x, a, b) for (int x = a; x >= b; x--)
#define maxn 100005
#define maxc 1000000007
#define MOD 1000000007
#define reset(x, y) memset(x, y, sizeof(x))
#define task ""
#define mp make_pair
#define pb push_back
#define ... | delete | 25 | 29 | 25 | 25 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
int main() {
lli n, i, j, flag = 0;
cin >> n;
string s;
cin >> s;
for (i = 0; i < s.size() - 1; i++) {
if (s[i] != s[i + 1]) {
flag = 1;
break;
}
}
if (flag == 0)
cout << "No" << '\n';
else
cout << "Yes" ... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
int main() {
lli n, i, j, flag = 0;
string s;
cin >> s;
for (i = 0; i < s.size() - 1; i++) {
if (s[i] != s[i + 1]) {
flag = 1;
break;
}
}
if (flag == 0)
cout << "No" << '\n';
else
cout << "Yes" << '\n';
... | delete | 5 | 6 | 5 | 5 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vii> vvii;
#define fastIO ios:... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vii> vvii;
#define fastIO ios:... | replace | 35 | 37 | 35 | 37 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fup(i, a, b) for (int i = a; i <= b; ++i)
#define fdw(i, a, b) for (int i = a; i >= b; --i)
#define sync \
ios::sync_with_stdio(false); \
cin.tie(0)
#define cl(a) memset... | #include <bits/stdc++.h>
#define fup(i, a, b) for (int i = a; i <= b; ++i)
#define fdw(i, a, b) for (int i = a; i >= b; --i)
#define sync \
ios::sync_with_stdio(false); \
cin.tie(0)
#define cl(a) memset... | replace | 27 | 31 | 27 | 28 | 0 | |
p02753 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | replace | 13 | 14 | 13 | 14 | TLE | |
p02753 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | replace | 13 | 14 | 13 | 14 | TLE | |
p02753 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
using lint = long long;
int main() {
string N;
cin >> N;
cou((N == "AAA" || N == "BBB" ? "No" : "Yes"));
rep(i, 1000) {
... | replace | 12 | 13 | 12 | 13 | TLE | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(1) == s.at(2) && s.at(2) == s.at(3)) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(1) == s.at(2) && s.at(2) == s.at(0)) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pi 3.14159265359
#define int long long
#define pii pair<int, int>
const int mod = 1e9 + 7;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt",... | #include <bits/stdc++.h>
using namespace std;
#define pi 3.14159265359
#define int long long
#define pii pair<int, int>
const int mod = 1e9 + 7;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
if (s[0] == s[1]... | delete | 15 | 20 | 15 | 15 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
// freopen("out.out", "w", stdout);
#endif // ONLINE_JUDGE
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin >> s;
if (s[0] == s[1] && s[1] == s[2])
cout << "No";
else
cout <... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin >> s;
if (s[0] == s[1] && s[1] == s[2])
cout << "No";
else
cout << "Yes";
return 0;
} | delete | 4 | 8 | 4 | 4 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
// #define trav(a, x) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
// #define trav(a, x) ... | replace | 65 | 69 | 65 | 69 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<ll> vi;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<ll> vi;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | replace | 48 | 53 | 48 | 49 | 0 | |
p02753 | C++ | Runtime Error | // R<3S
#include <bits/stdc++.h>
#define FAST \
std::ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define DECIMAL(n) ... | // R<3S
#include <bits/stdc++.h>
#define FAST \
std::ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define DECIMAL(n) ... | replace | 91 | 96 | 91 | 93 | 0 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define MOD 1000000007
#define inf 3e18
#define ld long double
// #define mp make_pair
#define vpll vector<pair<ll, ll>>
#define sll set<ll>
#define vll vector<ll>
#define vld vector<ld>
#define vvll vector<... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define MOD 1000000007
#define inf 3e18
#define ld long double
// #define mp make_pair
#define vpll vector<pair<ll, ll>>
#define sll set<ll>
#define vll vector<ll>
#define vld vector<ld>
#define vvll vector<... | replace | 54 | 56 | 54 | 57 | 0 | |
p02753 | C++ | Runtime Error | /*
क्षमाशील हो रिपु-समक्ष
तुम हुये विनत जितना ही
दुष्ट कौरवों ने तुमको
कायर समझा उतना ही।
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ull unsigned int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define S(arr) sort(arr.begin(), arr.end());
#defi... | /*
क्षमाशील हो रिपु-समक्ष
तुम हुये विनत जितना ही
दुष्ट कौरवों ने तुमको
कायर समझा उतना ही।
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ull unsigned int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define S(arr) sort(arr.begin(), arr.end());
#defi... | replace | 81 | 85 | 81 | 85 | 0 | |
p02753 | Python | Runtime Error | s = input()
Q = int(input())
flag = True # flagがTrueのとき、偶数回数の反転が行われている
cnt = 0
for _ in range(Q):
query = list(map(str, input().split()))
# tmp.append(query)
if len(query) == 1: # 1のqueryのとき
cnt += 1
if flag:
flag = False
else:
flag = True
else:
... | S = input()
if "A" in S and "B" in S:
print("Yes")
else:
print("No")
| replace | 0 | 29 | 0 | 5 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02753/Python/s625684460.py", line 2, in <module>
Q = int(input())
EOFError: EOF when reading a line
|
p02753 | Python | Runtime Error | S = list(input())
Q = int(input())
for i in range(Q):
query = input().split()
if int(query[0]) == 1:
S.reverse()
else:
if int(query[1]) == 1:
S.insert(0, query[2])
else:
S.append(query[2])
print("".join(S))
| S = input()
if len(set(S)) == 2:
print("Yes")
else:
print("No")
| replace | 0 | 12 | 0 | 5 | EOFError: EOF when reading a line | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02753/Python/s642674593.py", line 2, in <module>
Q = int(input())
EOFError: EOF when reading a line
|
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s[3];
cin >> s[3];
if (s[0] == s[1] && s[1] == s[2]) {
cout << "No";
} else {
cout << "Yes";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
for (int i = 0; i < 3; i++) {
cin >> s[i];
}
if ((s[0] == s[1]) && (s[1] == s[2])) {
cout << "No";
} else {
cout << "Yes";
}
return 0;
}
| replace | 3 | 6 | 3 | 8 | -6 | *** stack smashing detected ***: terminated
|
p02753 | Python | Runtime Error | s = int(input())
if s in "AAA-BBB":
print("No")
else:
print("Yes")
| s = input()
if s in "AAA-BBB":
print("No")
else:
print("Yes")
| replace | 0 | 1 | 0 | 1 | ValueError: invalid literal for int() with base 10: 'ABA' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02753/Python/s787865958.py", line 1, in <module>
s = int(input())
ValueError: invalid literal for int() with base 10: 'ABA'
|
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S = 0;
cin >> S;
if (S[0] == S[1] && S[1] == S[2]) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S[0] == S[1] && S[1] == S[2]) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
| replace | 4 | 5 | 4 | 5 | -6 | terminate called after throwing an instance of 'std::logic_error'
what(): basic_string: construction from null is not valid
|
p02753 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
char AB[3] = "AB";
cin >> s;
int n_a = 0;
int n_b = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == AB[0]) {
n_a++;
} else {
n_b++;
}
}
if (n_a == 0 || n_b == 0) {
cout << "No" << endl;
... | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
char AB[3] = "AB";
cin >> s;
int n_a = 0;
int n_b = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == AB[0]) {
n_a++;
} else {
n_b++;
}
}
if (n_a == 0 || n_b == 0) {
cout << "No" << endl;
... | replace | 26 | 27 | 26 | 27 | 1 | |
p02753 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(1) == S.at(2) && S.at(2) == S.at(3)) {
cout << "No" << endl;
}
else {
cout << "Yes" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S == "AAA") {
cout << "No" << endl;
} else if (S == "BBB") {
cout << "No" << endl;
}
else {
cout << "Yes" << endl;
}
}
| replace | 7 | 8 | 7 | 10 | 0 | |
p02753 | Python | Runtime Error | s = input()
if s[0] == s[1] and s[2] == s[3] and s[3] == s[1]:
print("No")
else:
print("Yes")
| s = input()
if s[0] == s[1] and s[1] == s[2] and s[2] == s[0]:
print("No")
else:
print("Yes")
| replace | 2 | 3 | 2 | 3 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, ans = 0;
cin >> N >> A >> B;
ans += A * (N / (A + B));
ans += min(A, N % (A + B));
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, A, B, ans = 0;
cin >> N >> A >> B;
ans += A * (N / (A + B));
ans += min(A, N % (A + B));
cout << ans << endl;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
lli i, n, a, b, c = 0;
cin >> n >> a >> b;
for (i = 0; n > 0; ++i) {
if (i % 2 == 0) {
if (n - a > 0) {
n -= a;
c += a;
} e... | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
lli i, n, a, b, c = 0;
cin >> n >> a >> b;
c += (n / (a + b)) * a;
n %= (a + b);
if (n > a)
c += a;
else
c += n;
cout << c;
return 0;
}
| replace | 9 | 26 | 9 | 15 | TLE | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<ll>;
#define _GLIBCXX_DEBUG
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ALL(v) v.begin(), v.end()
int main() {
ll n, a, b;
cin >> n >> a >> b;
string s = {};
ll ans = 0;
while (1) {
rep(i, 0, a) {
s.pu... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<ll>;
#define _GLIBCXX_DEBUG
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ALL(v) v.begin(), v.end()
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll ans = 0, rem;
ans += a * (n / (a + b));
rem = n % (a + b);
ans ... | replace | 11 | 26 | 11 | 15 | TLE | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, blue, red, num, blue_red, nokori;
cin >> N >> blue >> red;
blue_red = blue + red;
nokori = (N % (blue_red));
num = N / (blue_red)*blue + min(blue, nokori);
cout << num << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, blue, red, num, blue_red, nokori;
cin >> N >> blue >> red;
blue_red = blue + red;
nokori = (N % (blue_red));
num = N / (blue_red)*blue + min(blue, nokori);
cout << num << endl;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02754 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int n, a, b, loop = 0, rem = 0;
cin >> n >> a >> b;
loop = n / (a + b);
rem = n % (a + b);
if (rem > a)
rem = a;
cout << loop * a + rem << endl;
} | #include <iostream>
using namespace std;
int main() {
unsigned long long n, a, b, loop = 0, rem = 0;
cin >> n >> a >> b;
loop = n / (a + b);
rem = n % (a + b);
if (rem > a)
rem = a;
cout << loop * a + rem << endl;
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, loop;
cin >> N >> A >> B;
loop = N / (A + B);
cout << (loop * A + min(N % (A + B), A));
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long int N, A, B, loop;
cin >> N >> A >> B;
loop = N / (A + B);
cout << (loop * A + min(N % (A + B), A));
return 0;
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, a, b, c, res;
int main() {
cin >> n >> a >> b;
res = res + n / (a + b) * a;
c = n % (a + b);
if (c > a) {
cout << res + a << endl;
} else {
cout << res + c << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
long long n, a, b, c, res;
int main() {
cin >> n >> a >> b;
res = res + n / (a + b) * a;
c = n % (a + b);
if (c > a) {
cout << res + a << endl;
} else {
cout << res + c << endl;
}
} | replace | 2 | 4 | 2 | 3 | 0 | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll ans = 0;
while (1) {
if (n >= a) {
ans += a;
} else {
ans += n;
}
if (a + b >= n) {
break;
}
n -= a + b;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll amari = (n % (a + b));
ll ans = (n / (a + b)) * a;
if (amari > a) {
ans += a;
} else {
ans += amari;
}
cout << ans << endl;
} | replace | 7 | 19 | 7 | 13 | TLE | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
int n, a, b;
cin >> n >> a >> b;
int ans = 0;
int A = n / (a + b);
ans += A * a;
int B = n % (a + b);
ans += B;
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll ans = 0;
if (N > A + B) {
ans += (N / (A + B)) * A;
if (N % (A + B) <= A)
ans += N % (A + B);
else
ans += A;
} else ... | replace | 6 | 13 | 6 | 20 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B;
cin >> N >> A >> B;
if (N % (A + B) >= A) {
cout << (N / (A + B)) * A + A << endl;
} else {
cout << (N / (A + B)) * A + N % (A + B) << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
if (N % (A + B) >= A) {
cout << (N / (A + B)) * A + A << endl;
} else {
cout << (N / (A + B)) * A + N % (A + B) << endl;
}
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <numeric>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pr pair<int, int>
using namespace std;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
// #define DEBUG
#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ":" << (A) ... | #include <bits/stdc++.h>
#include <numeric>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pr pair<int, int>
using namespace std;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
// #define DEBUG
#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ":" << (A) ... | replace | 50 | 51 | 50 | 51 | 0 | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B;
cin >> N >> A >> B;
cout << N / (A + B) * A + min(N - N / (A + B) * (A + B), A) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, A, B;
cin >> N >> A >> B;
cout << N / (A + B) * A + min(N - N / (A + B) * (A + B), A) << endl;
} | replace | 5 | 6 | 5 | 6 | 0 | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll cnt = 0;
do {
if (N < A) {
cnt += N;
break;
} else {
N -= A;
cnt += A;
}
N -= B;
} while (N >= 0);
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll cnt = 0;
ll cntr = (ll)(N / (A + B));
ll amari = N - cntr * (A + B);
if (amari < A) {
cnt = cntr * A + amari;
} else {
cnt = (cn... | replace | 9 | 19 | 9 | 16 | TLE | |
p02754 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int n, a, b;
int main() {
cin >> n >> a >> b;
cout << n / (a + b) * a + min(a, n % (a + b));
return 0;
} | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
long long n, a, b;
int main() {
cin >> n >> a >> b;
cout << n / (a + b) * a + min(a, n % (a + b));
return 0;
} | replace | 5 | 6 | 5 | 6 | 0 | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c, d, ans, j, p, i;
cin >> a >> b >> c;
ans = 0;
p = 0;
i = 1;
while (a != 0) {
if (i % 2 != 0) {
if (a > b) {
ans += b;
a -= b;
} else {
ans += a;
a -= a;
}
} else {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c, d, ans, j, p, i;
cin >> a >> b >> c;
i = a / (b + c);
j = a % (b + c);
ans = b * i + min(j, b);
cout << ans << endl;
}
| replace | 5 | 26 | 5 | 8 | TLE | |
p02754 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B;
cin >> N >> A >> B;
if (N % (A + B) > A) {
cout << (N / (A + B)) * A + A << endl;
} else if (N % (A + B) <= A) {
cout << ((N / A + B)) * A + (N % (A + B)) << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
if (n % (a + b) >= a) {
cout << (n / (a + b)) * a + a << endl;
} else {
cout << (n / (a + b)) * a + n % (a + b) << endl;
}
}
| replace | 4 | 10 | 4 | 10 | 0 | |
p02754 | C++ | Runtime Error | // #include<bits/stdc++.h>
#include <algorithm>
#include <assert.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
#define de_x(x) cout << #x << "->debug_val: " << x << endl;
#define de_ve(x) ... | // #include<bits/stdc++.h>
#include <algorithm>
#include <assert.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
#define de_x(x) cout << #x << "->debug_val: " << x << endl;
#define de_ve(x) ... | replace | 47 | 53 | 47 | 50 | 0 | |
p02754 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define mem0(x) memset(x, 0, sizeof(x))
#define asort(x) sort(x.begin(), x.end());
#define... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define mem0(x) memset(x, 0, sizeof(x))
#define asort(x) sort(x.begin(), x.end());
#define... | replace | 26 | 35 | 26 | 27 | TLE | |
p02754 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll i = 0, k = 0, ans = 0;
while (i < n) {
if ((k % 2) == 0) {
if (i + a < n) {
i += a;
ans += a;
} else {
ans += (n - i);
... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll i = 0, k = 0, ans = 0;
ll q = n / (a + b);
ll r = n % (a + b);
ans = q * a;
if (r > a)
r = a;
ans += r;
cout << ans;
} | replace | 9 | 30 | 9 | 15 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.