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
p02827
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef vector<int> VI; typedef pair<int, int> ii; typedef long long LL; #define pb push_back const int INF = 2147483647; const int N = 50005; const int M = 100005; int n, m, t, i, x[M], y[M], mapa[N], co[N]; bitset<N> b[N], bb; string s; bool cc[N]; void solve() { if (...
#include <bits/stdc++.h> using namespace std; typedef vector<int> VI; typedef pair<int, int> ii; typedef long long LL; #define pb push_back const int INF = 2147483647; const int N = 50005; const int M = 100005; int n, m, t, i, x[M], y[M], mapa[N], co[N]; bitset<N> b[N], bb; string s; bool cc[N]; void solve() { if (...
replace
37
60
37
38
TLE
p02827
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #ifndef print #define print(...) #define trace(...) #define endl '\n' #endif #define pb push_back #define fi first #define se second #defi...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #ifndef print #define print(...) #define trace(...) #define endl '\n' #endif #define pb push_back #define fi first #define se second #defi...
replace
80
81
80
89
TLE
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; void ch(int &x, int &y) { if (y < x) { int tmp = y; y = x; x = tmp; } } int N, M, T; vector<int> x, y; void solve1() { using bs = bitset<50001>; vector<bs> dp(N + 1); // dp[i][j] は i から j にゴールできるかどうか for (int i = 1; i <= N; ++i...
#include <bits/stdc++.h> using namespace std; using ll = long long; void ch(int &x, int &y) { if (y < x) { int tmp = y; y = x; x = tmp; } } int N, M, T; vector<int> x, y; void solve1() { using bs = bitset<50001>; vector<bs> dp(N + 1); // dp[i][j] は i から j にゴールできるかどうか for (int i = 1; i <= N; ++i...
replace
28
29
28
29
0
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = int(5e4) + 2; const int MAXM = int(1.1e5); int N, M; int T; pair<int, int> X[MAXM]; bool ansUp[MAXM]; using bs = bitset<MAXN>; namespace uniforming { bs canReach[MAXN]; bool vis[MAXN]; bool findUniforming() { for (int t = 0; t < N; t++) canReach[t...
#include <bits/stdc++.h> using namespace std; const int MAXN = int(5e4) + 2; const int MAXM = int(1.1e5); int N, M; int T; pair<int, int> X[MAXM]; bool ansUp[MAXM]; using bs = bitset<MAXN>; namespace uniforming { bs canReach[MAXN]; bool vis[MAXN]; bool findUniforming() { for (int t = 0; t < N; t++) canReach[t...
replace
61
62
61
95
-11
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, M, T, s[100003], t[100003], dis[100003]; bitset<50003> now[50003]; namespace sub1 { void work() { for (int i = 1; i <= N; ++i) now[i].set(i); for (int i = 1; i <= M; ++i) now[s[i]] = now[t[i]] = now[s[i]] | now[t[i]]; for (int i = 1; i <= N; ++i) ...
#include <bits/stdc++.h> using namespace std; int N, M, T, s[100003], t[100003], dis[100003]; bitset<50003> now[50003]; namespace sub1 { void work() { for (int i = 1; i <= N; ++i) now[i].set(i); for (int i = 1; i <= M; ++i) now[s[i]] = now[t[i]] = now[s[i]] | now[t[i]]; for (int i = 1; i <= N; ++i) ...
replace
29
30
29
30
-11
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
replace
145
146
145
169
0
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef bool boolean; #define pii pair<int, int> const int N = 5e4 + 5; const int M = 1e5 + 5; int n, m, type; char ans[M]; int us[M], vs[M]; namespace subtask1 { bitset<N> f[M]; boolean vis[M]; int h[N], A[M], B[M]; void F(int p, int x) { if (!p || vis[p]) { re...
#include <bits/stdc++.h> using namespace std; typedef bool boolean; #define pii pair<int, int> const int N = 5e4 + 5; const int M = 1e5 + 5; int n, m, type; char ans[M]; int us[M], vs[M]; namespace subtask1 { bitset<N> f[M]; boolean vis[M]; int h[N], A[M], B[M]; void F(int p, int x) { if (!p || vis[p]) { re...
replace
68
69
68
69
-11
p02827
C++
Runtime Error
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef pair<int, int> P; typ...
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef pair<int, int> P; typ...
replace
35
36
35
36
-11
p02827
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using uint = unsigned int; #define rep(i, n) for (int i = 0; i < int(n); i++) #define rep1(i, n) for (int i = 1; i <= int(n); i++) #define per(i, n) for (int i = int(n) - 1; i >= 0; i--) #define per1(i, n) for (int i = int(n); i > 0; i--) #define all(c...
#include <bits/stdc++.h> using namespace std; using ll = long long; using uint = unsigned int; #define rep(i, n) for (int i = 0; i < int(n); i++) #define rep1(i, n) for (int i = 1; i <= int(n); i++) #define per(i, n) for (int i = int(n) - 1; i >= 0; i--) #define per1(i, n) for (int i = int(n); i > 0; i--) #define all(c...
replace
88
95
88
90
TLE
p02827
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, t; cin >> n >> m >> t; vector<int> X(m), Y(m); for (int i = 0; i < m; i++) { cin >> X[i] >> Y[i]; X[i]--; Y[i]--; } if (t == 1) { const int N = 50008; vector<bitset<N>> g(n); for (int i = 0; i < n; i++) { ...
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, t; cin >> n >> m >> t; vector<int> X(m), Y(m); for (int i = 0; i < m; i++) { cin >> X[i] >> Y[i]; X[i]--; Y[i]--; } if (t == 1) { const int N = 50008; vector<bitset<N>> g(n); for (int i = 0; i < n; i++) { ...
replace
57
58
57
58
0
p02827
C++
Runtime Error
// https://atcoder.jp/contests/agc041/tasks/agc041_e #define DECIMAL_DIGITS 10 #define STATIC_MOD 1e9 + 7 #ifdef BTK /*<head>*/ #include "Template.hpp" #include "graph/Dinic.hpp" /*</head>*/ #else /*<body>*/ /* #region auto includes */ /* #region stl */ /*<stl>*/ #include <bits/stdc++.h> #include <sys/types.h> #includ...
// https://atcoder.jp/contests/agc041/tasks/agc041_e #define DECIMAL_DIGITS 10 #define STATIC_MOD 1e9 + 7 #ifdef BTK /*<head>*/ #include "Template.hpp" #include "graph/Dinic.hpp" /*</head>*/ #else /*<body>*/ /* #region auto includes */ /* #region stl */ /*<stl>*/ #include <bits/stdc++.h> #include <sys/types.h> #includ...
replace
897
898
897
912
-11
p02827
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define mp make_pair #define PI pair<ll, ll> #define poly vector<ll> #define mem(a) memset((a), 0, sizeof(a)) #define For(i, l, r) for (int i = (int)(l); i <= (int)(r); i++) #define Rep(i, r, l) f...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define mp make_pair #define PI pair<ll, ll> #define poly vector<ll> #define mem(a) memset((a), 0, sizeof(a)) #define For(i, l, r) for (int i = (int)(l); i <= (int)(r); i++) #define Rep(i, r, l) f...
replace
50
51
50
55
TLE
p02828
C++
Runtime Error
#include <bits/stdc++.h> #define IL __inline__ __attribute__((always_inline)) #define For(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define FOR(i, a, b) for (int i = (a), i##end = (b); i < i##end; ++i) #define Rep(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) #define REP(i, a, b) for (in...
#include <bits/stdc++.h> #define IL __inline__ __attribute__((always_inline)) #define For(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define FOR(i, a, b) for (int i = (a), i##end = (b); i < i##end; ++i) #define Rep(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) #define REP(i, a, b) for (in...
delete
136
139
136
136
-11
p02828
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define N 420 #define M 8200 const LL mod = 998244353; LL n, ans, a[N], b[N][N], p[N][N], cnt, fa[M], sz[M], sz2[M], sum[M], C[N][N], f[M][N], g[M][N], dp[N], pw[N]; void upd(LL &x, LL y) { x = (x + y % mod + mod) % mod; } int main() { scan...
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define N 420 #define M 82000 const LL mod = 998244353; LL n, ans, a[N], b[N][N], p[N][N], cnt, fa[M], sz[M], sz2[M], sum[M], C[N][N], f[M][N], g[M][N], dp[N], pw[N]; void upd(LL &x, LL y) { x = (x + y % mod + mod) % mod; } int main() { sca...
replace
6
7
6
7
0
p02828
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld double #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define pb emplace_back #define X first #define Y second const int N = 405; const int S = N * N; typedef pair<int, int> ii; const int mod = 998244353; void add(int &...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld double #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define pb emplace_back #define X first #define Y second const int N = 405; const int S = N * N; typedef pair<int, int> ii; const int mod = 998244353; void add(int &...
replace
57
58
57
58
-11
p02828
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <int MOD_> struct modnum { static constexpr int MOD = MOD_; static_assert(MOD_ > 0, "MOD must be positive"); private: using ll = long long; int v; static int minv(int a, int m) { a %= m; assert(a); return a == 1 ? 1 : int(m - ll(minv(m, a)...
#include <bits/stdc++.h> using namespace std; template <int MOD_> struct modnum { static constexpr int MOD = MOD_; static_assert(MOD_ > 0, "MOD must be positive"); private: using ll = long long; int v; static int minv(int a, int m) { a %= m; assert(a); return a == 1 ? 1 : int(m - ll(minv(m, a)...
replace
151
152
151
152
0
p02828
C++
Runtime Error
#include <algorithm> #include <bitset> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <vector> using namespace std; typedef long long ll; ...
#include <algorithm> #include <bitset> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <vector> using namespace std; typedef long long ll; ...
replace
30
31
30
31
0
p02828
C++
Runtime Error
#include <cstdio> #define N 403 #define mod 998244353 using namespace std; long long newf[N], f[N][N][N], g[N][N][N], C[N][N], th2[N]; int a[N], n; void dfs(int l, int r, int h) { // g[l][h][0]=1;f[l][h][0]=1; int start = 0; bool bo = false; for (int i = l; i <= r; i++) { if (a[i - 1] <= h && a[i] > h && st...
#include <cstdio> #define N 405 #define mod 998244353 using namespace std; long long newf[N], f[N][N][N], g[N][N][N], C[N][N], th2[N]; int a[N], n; void dfs(int l, int r, int h) { // g[l][h][0]=1;f[l][h][0]=1; int start = 0; bool bo = false; for (int i = l; i <= r; i++) { if (a[i - 1] <= h && a[i] > h && st...
replace
1
2
1
2
-11
p02829
Python
Runtime Error
a, b = map(int, input().split()) print(6 - a - b)
a = int(input()) b = int(input()) print(6 - a - b)
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/p02829/Python/s060375473.py", line 1, in <module> a, b = map(int, input().split()) ValueError: not enough values to unpack (expected 2, got 1)
p02829
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll N = 1e6 + 9; const ll p = 31; const ll m = 1e9 + 7; const ll inf = 1e14; ll mod = 1e9 + 7; ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; ...
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll N = 1e6 + 9; const ll p = 31; const ll m = 1e9 + 7; const ll inf = 1e14; ll mod = 1e9 + 7; ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; ...
delete
24
28
24
24
0
p02829
C++
Runtime Error
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define pf push_front #define eb emplace_back #define emp emplace #define ins insert #define mp make_pair #define mt make_tuple #define sz(s) (int)s.size() #define forp(i, a, b) for (int i = a; i <= b; i++) #define rep(i, n) for (int i = 0...
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define pf push_front #define eb emplace_back #define emp emplace #define ins insert #define mp make_pair #define mt make_tuple #define sz(s) (int)s.size() #define forp(i, a, b) for (int i = a; i <= b; i++) #define rep(i, n) for (int i = 0...
replace
120
125
120
125
0
p02829
C++
Runtime Error
/* साहिल पे पहुंचने से इनकार किसे है लेकिन, तूफ़ानो से लड़ने का मज़ा ही कुछ और है, कहते है, कि किस्मत खुदा लिखता है लेकिन, उसे मिटा के खुद गढ़ने का मजा ही कुछ और है। */ #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using nam...
/* साहिल पे पहुंचने से इनकार किसे है लेकिन, तूफ़ानो से लड़ने का मज़ा ही कुछ और है, कहते है, कि किस्मत खुदा लिखता है लेकिन, उसे मिटा के खुद गढ़ने का मजा ही कुछ और है। */ #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using nam...
replace
92
93
92
97
0
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(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++) typedef long long ll; int main() { int a, b; cin >> a >> b; for (int i = 1; i <= 3; i++) { if (i != a && i != b) { ...
#include <bits/stdc++.h> using namespace std; #define REP(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++) typedef long long ll; int main() { int a, b; cin >> a >> b; cout << 6 - (a + b) << endl; }
replace
10
16
10
11
1
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fa(x, v) for (auto x : v) #define f(i, a, b) for (ll i = (ll)a; i <= (ll)b; i++) #define rf(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--) #define spc " " #define endl '\n' #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss sec...
#include <bits/stdc++.h> using namespace std; #define fa(x, v) for (auto x : v) #define f(i, a, b) for (ll i = (ll)a; i <= (ll)b; i++) #define rf(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--) #define spc " " #define endl '\n' #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss sec...
replace
30
31
30
31
0
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>( chrono::high_resolution_clock::now().time_since_epoch()) .count()); #define mp make_pair #define pb push_back #define F first #define S second const i...
#include <bits/stdc++.h> using namespace std; #define int long long int mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>( chrono::high_resolution_clock::now().time_since_epoch()) .count()); #define mp make_pair #define pb push_back #define F first #define S second const i...
delete
26
31
26
26
0
p02829
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int c = 6 - a - b; cout << c; return 1; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int c = 6 - a - b; cout << c; return 0; }
replace
8
9
8
9
1
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define sz(s) (int)s.size() #define endl '\n' void PLAY() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { PLAY(); i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define sz(s) (int)s.size() #define endl '\n' void PLAY() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { PLAY(); int a, b; cin >> a >> b; cout << 6 - (a + b) << endl; return 0; }
replace
10
14
10
11
0
p02829
Python
Runtime Error
a, b = map(int, input().split()) ans = 6 - (a + b) print(ans)
a = int(input()) b = int(input()) print(6 - a - b)
replace
0
3
0
3
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/p02829/Python/s996128891.py", line 1, in <module> a, b = map(int, input().split()) ValueError: not enough values to unpack (expected 2, got 1)
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; vector<int> ans{1, 2, 3}; ans.erase(ans.begin() + a - 1); ans.erase(ans.begin() + b - 1); cout << ans.at(0) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int ans; for (int i = 1; i < 4; i++) { if (i != a && i != b) { ans = i; } } cout << ans << endl; }
replace
6
10
6
13
0
p02829
C++
Runtime Error
#include <iostream> int main() { int a, b; std::cin >> a >> b; return 6 - a - b; }
#include <iostream> int main() { int a, b; std::cin >> a >> b; std::cout << 6 - a - b; return 0; }
replace
5
6
5
7
2
p02829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int A; int B; int quizChoice = 6; cin >> A; cin >> B; quizChoice -= (A + B); return quizChoice; }
#include <bits/stdc++.h> using namespace std; int main() { int A; int B; int quizChoice = 6; cin >> A; cin >> B; quizChoice -= (A + B); cout << quizChoice; return 0; }
replace
13
14
13
16
2
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { char a[100], b[100], c[100]; int i, n; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } a[i] = '\0'; for (i = 0; i < n; i++) { cin >> b[i]; } b[i] = '\0'; // cout<<a<<" "<<b<<endl; int j = 0; for (i = 0; i < n; i++, j = j + 2)...
#include <bits/stdc++.h> using namespace std; int main() { char a[101], b[101], c[204]; int i, n; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; } a[i] = '\0'; for (i = 0; i < n; i++) { cin >> b[i]; } b[i] = '\0'; // cout<<a<<" "<<b<<endl; int j = 0; for (i = 0; i < n; i++, j = j + 2)...
replace
3
4
3
4
0
p02830
C++
Runtime Error
#include <stdio.h> int main(void) { int len, i, j = 0; char str1[100], str2[100], str3[200]; scanf("%d", &len); scanf("%s %s", str1, str2); for (i = 0; i <= len; i++) { str3[j] = str1[i]; j++; str3[j] = str2[i]; j++; } printf("%s\n", str3); return 0; }
#include <stdio.h> int main(void) { int len, i, j = 0; char str1[101], str2[101], str3[202]; scanf("%d", &len); scanf("%s %s", str1, str2); for (i = 0; i <= len; i++) { str3[j] = str1[i]; j++; str3[j] = str2[i]; j++; } printf("%s\n", str3); return 0; }
replace
4
5
4
5
0
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; char a[n], b[n]; string s = ""; scanf("%s%s", a[n], b[n]); for (int i = 0; i < n; i++) { s += a[i]; s += b[i]; } cout << s << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s = "", a, b; cin >> n; cin >> a >> b; for (int i = 0; i < n; i++) { s += a[i]; s += b[i]; } cout << s << "\n"; return 0; }
replace
4
7
4
7
-11
p02830
C++
Runtime Error
#include <iostream> using namespace std; int n, i; string s, t; int main() { cin >> n; for (i = 0; i < n; i++) { cin >> s[i]; } for (i = 0; i < n; i++) { cin >> t[i]; } for (i = 0; i < n; i++) { cout << s[i] << t[i]; } return 0; }
#include <iostream> using namespace std; int n, i; string s, t; int main() { cin >> n >> s >> t; for (i = 0; i < n; i++) { cout << s[i] << t[i]; } return 0; }
replace
7
14
7
8
0
p02830
C++
Runtime Error
#include <bits/stdc++.h> #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b) #define reprev(i, n) reprrev(i, 0, n) #define _GLIBCXX_DEBUG using ll = long long; using ull = unsigned long long; template <class...
#include <bits/stdc++.h> #define repr(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b) #define reprev(i, n) reprrev(i, 0, n) #define _GLIBCXX_DEBUG using ll = long long; using ull = unsigned long long; template <class...
replace
61
62
61
62
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int n; cin >> n; string s, t; cin >> s >> t; for (int i = 0; i < n; i++) { cout << s[i] << t[i]; } cout << "\n"; return 1; }
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int n; cin >> n; string s, t; cin >> s >> t; for (int i = 0; i < n; i++) { cout << s[i] << t[i]; } cout << "\n"; }
delete
13
14
13
13
1
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a; string s, t; cin >> a; cin >> s >> t; string ans = s + t; for (int i = 0; i < 2 * a; i++) { if (i % 2 == 0) { ans.at(i) = s.at(i / 2); } else { ans.at(i) = s.at((i + 1) / 2); } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a; string s, t; cin >> a; cin >> s >> t; string ans = s + t; for (int i = 0; i < 2 * a; i++) { if (i % 2 == 0) { ans.at(i) = s.at(i / 2); } else { ans.at(i) = t.at((i - 1) / 2); } } cout << ans << endl; }
replace
13
14
13
14
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define all(n) begin(n), end(n) struct cww { cww() { ios::sync_with_stdio(false); cin.tie(0); } } star; const long long INF = numeric_limits<long long>::max(); ty...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define all(n) begin(n), end(n) struct cww { cww() { ios::sync_with_stdio(false); cin.tie(0); } } star; const long long INF = numeric_limits<long long>::max(); ty...
replace
28
29
28
29
0
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s, t; cin >> s >> t; for (int i = 0; i < n * 2; i++) { cout << s.at(i) << t.at(i); } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s, t; cin >> s >> t; for (int i = 0; i < n; i++) { cout << s.at(i) << t.at(i); } cout << endl; }
replace
11
12
11
12
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a; unsigned char *s = new unsigned char[101]; unsigned char *t = new unsigned char[101]; unsigned char *r = new unsigned char[101]; cin >> a >> s >> t; for (int i = 0; i < a; i++) { r[2 * i] = s[i]; r[2 * i + 1] = t[i]; } cout << r; del...
#include <iostream> using namespace std; int main() { int a; unsigned char *s = new unsigned char[101]; unsigned char *t = new unsigned char[101]; unsigned char *r = new unsigned char[201]; cin >> a >> s >> t; for (int i = 0; i < a; i++) { r[2 * i] = s[i]; r[2 * i + 1] = t[i]; } cout << r; del...
replace
6
7
6
7
0
p02830
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; int main() { int i, j, k, n, l, m; string str1, str2; string str3; cin >> n; cin >> str1 >> str2; for (i = 0, j = 0; i < n; i++) { str3[j++] = str1[i]; str3[j++] = str2[i]; } for (i = 0; i < n * n; i++) { cout << str3[i]; } retu...
#include <cmath> #include <iostream> using namespace std; int main() { int i, j, k, n, l, m; string str1, str2; string str3; cin >> n; cin >> str1 >> str2; for (i = 0, j = 0; i < n; i++) { str3[j++] = str1[i]; str3[j++] = str2[i]; } for (i = 0; i < n + n; i++) { cout << str3[i]; } retu...
replace
15
16
15
16
0
p02830
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll N = 1e6 + 9; const ll p = 31; const ll m = 1e9 + 7; const ll inf = 1e14; ll mod = 1e9 + 7; ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; ...
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll N = 1e6 + 9; const ll p = 31; const ll m = 1e9 + 7; const ll inf = 1e14; ll mod = 1e9 + 7; ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; ...
delete
24
28
24
24
-11
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using vii = vector<vi>; using in6 = int64_t; using ind = double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; vector<char> a, b(n); rep(i, n) cin >> a[i]; rep(i, n) cin >> b[i]; rep(i, n) cout << a[i...
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using vii = vector<vi>; using in6 = int64_t; using ind = double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; vector<char> a(n); vector<char> b(n); rep(i, n) cin >> a[i]; rep(i, n) cin >> b[i]; rep...
replace
11
12
11
13
-11
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; string s, t; cin >> n >> s >> t; for (int i = 0; i = n; i++) { cout << s.at(i) << t.at(i); } }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s, t; cin >> n >> s >> t; for (int i = 0; i < n; i++) { cout << s.at(i) << t.at(i); } }
replace
6
7
6
7
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
replace
24
26
24
26
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string S, T; char ans[200] = {}; int N, i, count = 0; cin >> N; cin >> S >> T; for (i = 0; i <= N * 2; i += 2) { ans[i] = S[count]; ans[i + 1] = T[count]; count++; } cout << ans << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string S, T; char ans[200] = {}; int N, i, count = 0; cin >> N; cin >> S >> T; for (i = 0; i < N * 2; i += 2) { ans[i] = S[count]; ans[i + 1] = T[count]; count++; } cout << ans << endl; return 0; }
replace
12
13
12
13
0
p02830
Python
Runtime Error
n = int(input()) s, t = [int(input()) for i in range(2)] out = "" for i in range(n): out += s[i] + t[i] print(out)
n = int(input()) s, t = input().split() out = "" for i in range(n): out += s[i] + t[i] print(out)
replace
1
2
1
2
ValueError: invalid literal for int() with base 10: 'ip cc'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02830/Python/s669050732.py", line 2, in <module> s, t = [int(input()) for i in range(2)] File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02830/Python/s669050732.py", line 2, in <listcomp>...
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S, T; cin >> S, T; for (int i = 0; i < N; i++) { cout << S.at(i) << T.at(i); } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string S, T; cin >> S >> T; for (int i = 0; i < N; i++) { cout << S.at(i) << T.at(i); } cout << endl; }
replace
11
12
11
12
-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)
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define pb emplace_back #define mp make_pair #define f(i, a, n) for (int i = a; i < n; i++) #define F first #define S second #define vll vector<ll> #define fast ios::sync_with_stdio(false), cin.tie(0); #define COUT cout << fix...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define pb emplace_back #define mp make_pair #define f(i, a, n) for (int i = a; i < n; i++) #define F first #define S second #define vll vector<ll> #define fast ios::sync_with_stdio(false), cin.tie(0); #define COUT cout << fix...
replace
22
33
22
29
0
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s, t; for (int i = 0; i < n; i++) { cout << s.at(i); cout << t.at(i); } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s, t; cin >> s >> t; for (int i = 0; i < n; i++) { cout << s.at(i); cout << t.at(i); } cout << endl; }
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)
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string raw; string s, t; cin >> N; cin >> raw; s = raw.substr(0, N); t = raw.substr(N + 1, N); for (int i = 0; i < N; i++) { cout << s[i] << t[i]; } cout << "\n"; }
#include <bits/stdc++.h> using namespace std; int main() { int N; string raw; string s, t; getline(cin, raw); N = stoi(raw); getline(cin, raw); s = raw.substr(0, N); t = raw.substr(N + 1, N); for (int i = 0; i < N; i++) { cout << s[i] << t[i]; } cout << "\n"; }
replace
8
10
8
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 3) > this->size() (which is 2)
p02830
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) #define int long long #define all(x) (x).begin(), (x).end() signed main() { int N; string S, T, U; cin >...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) #define int long long #define all(x) (x).begin(), (x).end() signed main() { int N; string S, T, U; cin >...
replace
17
19
17
19
0
p02830
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string a, b, c; cin >> a >> b; c = a.at(0); c += b.at(0); for (int i = 1; i <= n; i++) { c += a.at(i); c += b.at(i); } cout << c << endl; }
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; string a, b, c; cin >> a >> b; c = a.at(0); c += b.at(0); for (int i = 1; i < n; i++) { c += a.at(i); c += b.at(i); } cout << c << endl; }
replace
10
11
10
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 2) >= this->size() (which is 2)
p02830
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; string S, T; cin >> N; for (int i = 0; i < N; i++) { cin >> S.at(i); } for (int i = 0; i < N; i++) { cin >> T.at(i); } for (int i = 0; i < N; i++) { cout << S.at(i) << T.at(i); } }
#include <bits/stdc++.h> using namespace std; int main() { int N; string S, T; cin >> N >> S >> T; for (int i = 0; i < N; i++) { cout << S.at(i) << T.at(i); } }
replace
5
12
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)
p02831
Python
Runtime Error
import fractions a, b = map(int, input().split()) print(int(a * b / fractions.gcd(a * b)))
import fractions a, b = map(int, input().split()) print(a * b // fractions.gcd(a, b))
replace
4
5
4
5
AttributeError: module 'fractions' has no attribute 'gcd'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02831/Python/s463768606.py", line 5, in <module> print(int(a * b / fractions.gcd(a * b))) AttributeError: module 'fractions' has no attribute 'gcd'
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll gcd(ll a, ll b) { if (b == 0) return a; else return (b, a % b); } int main() { ll a, b; cin >> a >> b; cout << (a * b) / gcd(a, b); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } int main() { ll a, b; cin >> a >> b; cout << (a * b) / gcd(a, b); }
replace
6
8
6
7
0
p02831
Python
Runtime Error
# C - Snack from math import gcd A, B = map(int, input().split()) print(A * B // gcd(A, B))
# C - Snack from fractions import gcd A, B = map(int, input().split()) print(A * B // gcd(A, B))
replace
2
3
2
3
0
p02831
Python
Runtime Error
# from fractions import gcd from math import gcd a, b = map(int, input().split()) print(a * b // gcd(a, b)) exit(0)
from fractions import gcd # from math import gcd a, b = map(int, input().split()) print(a * b // gcd(a, b)) exit(0)
replace
0
2
0
3
0
p02831
Python
Runtime Error
import math a, b = map(int, input().split()) print((a * b) // math.gcd(a, b))
import math a, b = map(int, input().split()) i = 1 flag = True while flag: if (a * i) % b == 0: flag = False ans = a * i break i += 1 print(ans)
replace
3
4
3
14
0
p02831
Python
Runtime Error
from math import gcd a, b = map(int, input().split()) print(int(a * b / gcd(a, b)))
from fractions import gcd a, b = map(int, input().split()) print(int(a * b / gcd(a, b)))
replace
0
1
0
1
0
p02831
Python
Runtime Error
from math import gcd a, b = tuple(map(int, input().split())) print(int(a * b / gcd(a, b)))
from fractions import gcd a, b = tuple(map(int, input().split())) print(int(a * b / gcd(a, b)))
replace
0
1
0
1
0
p02831
Python
Runtime Error
# abc148_c.py import sys import time import unittest from io import StringIO import math def resolve(): A, B = [int(i) for i in input().split()] print(int(A * B / math.gcd(A, B))) class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin ...
# abc148_c.py import sys import time import unittest from io import StringIO import fractions as math def resolve(): A, B = [int(i) for i in input().split()] print(int(A * B / math.gcd(A, B))) class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys....
replace
5
6
5
6
0
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define SPEED \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define ll long l...
#include <bits/stdc++.h> using namespace std; #define SPEED \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define ll long l...
replace
15
27
15
18
TLE
p02831
Python
Runtime Error
from math import gcd a, b = map(int, input().split()) lcm = a * b // gcd(a, b) print(lcm)
from fractions import gcd a, b = map(int, input().split()) lcm = a * b // gcd(a, b) print(lcm)
replace
0
1
0
1
0
p02831
C++
Runtime Error
#include <iostream> #include <map> #include <set> #include <unordered_map> #include <vector> using namespace std; const int N = 1e5 + 10; typedef long long ll; typedef pair<ll, ll> PII; int n; string s1, s2, ans; ll a, b; ll f(ll a, ll b) { b == 0 ? a : f(b, a % b); } int main() { cin >> a >> b; cout << a * b...
#include <iostream> #include <map> #include <set> #include <unordered_map> #include <vector> using namespace std; const int N = 1e5 + 10; typedef long long ll; typedef pair<ll, ll> PII; int n; string s1, s2, ans; ll a, b; ll f(ll a, ll b) { return b == 0 ? a : f(b, a % b); } int main() { cin >> a >> b; cout <...
replace
16
17
16
17
0
p02831
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define ef emplace_front #define eb emplace_back #define mp make_pai...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define ef emplace_front #define eb emplace_back #define mp make_pai...
replace
45
47
45
47
-8
p02831
C++
Runtime Error
#include <cstdlib> #include <iostream> using namespace std; long gcd(long x, long y) { long t; if (x < y) { long tmp = x; x = y; y = tmp; } t = x % y; if (t == 0) { return y; } else { gcd(y, t); } } int main() { long a, b; cin >> a >> b; cout << (a * b) / gcd(a, b) << endl; ...
#include <cstdlib> #include <iostream> using namespace std; long gcd(long x, long y) { long t; if (x < y) { long tmp = x; x = y; y = tmp; } t = x % y; if (t == 0) { return y; } else { return gcd(y, t); } } int main() { long a, b; cin >> a >> b; cout << (a * b) / gcd(a, b) << ...
replace
16
17
16
17
0
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; long long n, k, mn; int main() { cin >> n >> k; if (n < k) { mn = n; } else { mn = k; } for (int i = mn; i <= n * k; i++) { if (i % n == 0 && i % k == 0) { cout << i; return 0; } } return 0; }
#include <bits/stdc++.h> using namespace std; long long n, k, mn; int main() { cin >> n >> k; cout << n * k / __gcd(n, k); return 0; }
replace
8
19
8
9
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int a, b; cin >> a >> b; int max = 0; for (int i = 1; i < min(a, b); i++) { if (a % i == 0 && b % i == 0) { max = i; } } cout << (int64_t)a * b / max << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int a, b; cin >> a >> b; int max = 0; for (int i = 1; i <= min(a, b); i++) { if (a % i == 0 && b % i == 0) { max = i; } } cout << (int64_t)a * b / max << endl; }
replace
9
10
9
10
0
p02831
Python
Runtime Error
from math import gcd a, b = map(int, input().split()) print(a * b // gcd(a, b))
def gcd(a, b): if a == 0: return b return gcd(b % a, a) a, b = map(int, input().split()) print(a * b // gcd(a, b))
replace
0
1
0
5
0
p02831
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long int a, b; cin >> a >> b; for (long int i = 0; i < 10000000000; i++) { if (i % a == 0 && i % b == 0) { cout << i << endl; } } }
#include <iostream> using namespace std; int main() { long int a, b; cin >> a >> b; for (int i = 1; i <= b; i++) { if (a * i % b == 0) { cout << a * i << endl; return 0; } } }
replace
6
9
6
10
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long GCD(long long a, long long b) { if (b == 1) return a; return GCD(b, a % b); } long long LCM(long long a, long long b) { return a / GCD(a, b) * b; } int main() { long long a, b; scanf("%lld %lld", &a, &b); printf("%lld", LCM(a, b)); return 0; }
#include <bits/stdc++.h> using namespace std; long long GCD(long long a, long long b) { if (b == 0) return a; return GCD(b, a % b); } long long LCM(long long a, long long b) { return a / GCD(a, b) * b; } int main() { long long a, b; scanf("%lld %lld", &a, &b); printf("%lld", LCM(a, b)); return 0; }
replace
3
4
3
4
0
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; gcd(b, a % b); } int main() { long long a, b; cin >> a >> b; if (b % a == 0) cout << b; else cout << a / gcd(a, b) * b; return 0; }
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; gcd(b, a % b); } int main() { long long a, b; cin >> a >> b; // cout<<a/gcd(a,b)*b<<endl; for (int i = 1; i <= b; i++) { if ((a * i) % b == 0) { cout << a * i << endl; break; ...
replace
10
14
10
17
0
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b; cin >> a >> b; if (__gcd(a, b) == 1) { cout << a * b; } else { for (long long int i = max(a, b);; i++) { if (i % a == 0 && i % b == 0) { cout << i; break; } } } }
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b; cin >> a >> b; cout << (a * b) / __gcd(a, b); }
replace
5
15
5
6
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() #define maxs(x, y) x = max(x, y) #define mins(x, y) x = min(x, y) using namespace std; using ll = long long; typedef pair<in...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() #define maxs(x, y) x = max(x, y) #define mins(x, y) x = min(x, y) using namespace std; using ll = long long; typedef pair<in...
insert
26
26
26
27
0
p02831
C++
Time Limit Exceeded
/* */ #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define ll long long #define cint const int #define ld long double #define sz(a) (int)a.size() #define all(a) a.begin(), a.end() #define pb push_back #define ppb pop_bac...
/* */ #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define ll long long #define cint const int #define ld long double #define sz(a) (int)a.size() #define all(a) a.begin(), a.end() #define pb push_back #define ppb pop_bac...
replace
48
49
48
49
TLE
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { LL a, b; cin >> a >> b; if (a > b) { swap(a, b); } if (b - a == 1) { cout << a * b << "\n"; return 0; } for (LL i = a;; i++) { if (i % a == 0 && i % b == 0) { cout << i << "\n"; return 0; } ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { LL a, b; cin >> a >> b; if (a > b) { swap(a, b); } for (LL i = b;; i += b) { if (i % a == 0) { cout << i << "\n"; return 0; } } }
replace
10
16
10
13
TLE
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; cin >> a >> b; long long c = a * b; long long ans; for (long long i = 1; i <= c; ++i) { if (i % a == 0 && i % b == 0) { ans = i; break; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; cin >> a >> b; long long c = a * b; long long ans; for (long long i = 1; i <= c; ++i) { ans = a * i; if (ans % a == 0 && ans % b == 0) { break; } } cout << ans << endl; }
replace
8
10
8
10
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define p_q priority_queue #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { ll a, b; cin >> a >> b; ll min, el; if (a > b) { min = b; el = a; } else { min = a; el = b; } ll g = 0, gm = 0; for (ll i = ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define p_q priority_queue #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { ll a, b; cin >> a >> b; ll min, el; if (a > b) { min = b; el = a; } else { min = a; el = b; } ll g = 1, gm = 1; for (ll i = ...
replace
20
22
20
22
0
p02831
C++
Time Limit Exceeded
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { long long a, b, n; scanf("%d %d", &a, &b); for (long long i = a; i > 0; i--) { if (a % i == 0 && b % i == 0) { n = i; break; } } printf("%lld", a * b / n); return 0; }
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { long long a, b, n; scanf("%lld %lld", &a, &b); for (long long i = a; i > 0; i--) { if (a % i == 0 && b % i == 0) { n = i; break; } } printf("%lld", a * b / n); return 0; }
replace
9
10
9
10
TLE
p02831
Python
Runtime Error
import math A, B = map(int, input().split()) def lcm(x, y): return (x * y) // math.gcd(x, y) print(lcm(A, B))
import math A, B = map(int, input().split()) def gcd(a, b): while b: a, b = b, a % b return a # a,bの最小公倍数 def lcm(a, b): return a * b // gcd(a, b) print(lcm(A, B))
replace
5
7
5
16
0
p02831
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; int p = a * b; int g = __gcd(a, b); int l = p / g; cout << l; }
#include <algorithm> #include <iostream> using namespace std; int main() { long int a, b; cin >> a >> b; long int p = a * b; long int g = __gcd(a, b); long int l = p / g; cout << l; }
replace
4
8
4
9
0
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int A, B; cin >> A >> B; int v = max(A, B); int i = 1; int ans = v; while (!((ans / A > 0 && ans / B > 0) && (ans % A == 0 && ans % B == 0))) { i++; ans = v * i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int A, B; cin >> A >> B; int v = max(A, B); int w = min(A, B); long int ans = v; while ((ans % w != 0) || !(ans / v > 0)) { ans += v; } cout << ans << endl; }
replace
7
12
7
11
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll gcd(ll a, ll b) { if (b == 0) return a; return (gcd(b, a % b)); } int main() { ll a, b; ll ans = a * b; ll k = gcd(a, b); ans /= k; cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll gcd(ll a, ll b) { if (b == 0) return a; return (gcd(b, a % b)); } int main() { ll a, b; cin >> a >> b; ll ans = a * b; ll k = gcd(a, b); ans /= k; cout << ans << "\n"; return 0; }
insert
10
10
10
11
0
p02831
C++
Runtime Error
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
replace
35
36
35
36
10
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, i; cin >> n; string a, b; cin >> a >> b; for (i = 0; i < n; i++) { cout << a[i] << b[i]; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long m, n, r, t; cin >> m >> n; t = m * n; do { r = m % n; m = n; n = r; } while (r != 0); cout << t / m << endl; return 0; }
replace
3
10
3
12
0
p02831
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define freinput "input.txt", "r", stdin #define freoutput "output.txt", "w", stdout #define mp make_pair #define fi first #define sc second #define pb push_back #define ellapse printf("Time : %0.3lf\n", clock() * 1.0 / CLOCKS_PER_SEC); typedef long long ll; typedef unsigne...
#include <bits/stdc++.h> using namespace std; #define freinput "input.txt", "r", stdin #define freoutput "output.txt", "w", stdout #define mp make_pair #define fi first #define sc second #define pb push_back #define ellapse printf("Time : %0.3lf\n", clock() * 1.0 / CLOCKS_PER_SEC); typedef long long ll; typedef unsigne...
replace
21
27
21
22
TLE
p02831
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int min_ = min(a, b); int i = min_; while ((i % a != 0) || (i % b != 0)) { i += min_; // cout << i << endl; } cout << i << endl; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; long long i = b; while (i % a != 0) { i += b; // cout << i << endl; } cout << i << endl; }
replace
7
11
7
10
TLE
p02831
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main() { long long a, b; cin >> a >> b; long long ans; ans = max(a, b); for (long long i = 0; i < 1e9; i++) { if (ans % a == 0 && ans % b == 0) { cout << ans << endl; return 0; } ans++; } }
#include <algorithm> #include <iostream> using namespace std; int main() { long long a, b; cin >> a >> b; long long ans = a * b / __gcd(a, b); cout << ans << endl; return 0; }
replace
7
16
7
10
TLE
p02831
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b; cout << a * b / __gcd(a, b); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll a, b; cin >> a >> b; cout << a * b / __gcd(a, b); return 0; }
insert
6
6
6
7
0
p02831
C++
Runtime Error
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define MOD 998244353 using namespace std; long long PGCD(long long a, long long b) { if (a % b == 0) return b; return PGCD(b, a ...
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define MOD 998244353 using namespace std; long long PGCD(long long a, long long b) { if (a % b == 0) return b; return PGCD(b, a ...
insert
22
22
22
23
0
p02832
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); int b = 1; for (int i = 0; i < n; i++) { cin >> a.at(n); if (a.at(i) == b) b++; } if (b == 1) cout << -1 << endl; else cout << n - b + 1 << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); int b = 1; for (int i = 0; i < n; i++) { cin >> a.at(i); if (a.at(i) == b) b++; } if (b == 1) cout << -1 << endl; else cout << n - b + 1 << endl; }
replace
10
11
10
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02832
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define mp mak...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define mp mak...
delete
14
20
14
14
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02832
C++
Runtime Error
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; constexpr ll infl =...
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; constexpr ll infl =...
replace
32
33
32
33
0
p02832
C++
Runtime Error
#include "bits/stdc++.h" #include <cassert> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) const int mod = 1000000007; const int inf = 1ll << 61; typedef pair<int, int> P; typedef pair<P, int> PP; int a[100006]; signed main() { int n; cin >> n; rep(i, n) cin >> a[i]; in...
#include "bits/stdc++.h" #include <cassert> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) const int mod = 1000000007; const int inf = 1ll << 61; typedef pair<int, int> P; typedef pair<P, int> PP; int a[1000006]; signed main() { int n; cin >> n; rep(i, n) cin >> a[i]; i...
replace
9
10
9
10
0
p02832
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a, t = 1; long long b[20001]; cin >> a; for (int i = 0; i < a; i++) cin >> b[i]; for (int i = 0; i < a; i++) if (b[i] == t) t++; if (t > 1) cout << a - t + 1 << endl; else cout << "-1" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, t = 1; long long b[200001]; cin >> a; for (int i = 0; i < a; i++) cin >> b[i]; for (int i = 0; i < a; i++) if (b[i] == t) t++; if (t > 1) cout << a - t + 1 << endl; else cout << "-1" << endl; }
replace
6
7
6
7
0
p02832
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n; cin >> n; int break_num = 0; int a[n]; bool break_flg[n]; for (int i = 0; i < n; i++) { cin >> a[i]; break_flg[i] = false; } for (int i = 0; i < n; i++) { int index_num = 0; for (int j = 0; j <= i; j++) { if (break_flg[...
#include <iostream> using namespace std; int main() { int n; cin >> n; int break_num = 0; int a[n]; bool break_flg[n]; for (int i = 0; i < n; i++) { cin >> a[i]; break_flg[i] = false; } int index_num = 0; for (int i = 1; i <= n; i++) { if (i - break_num != a[i - 1]) { break_num++; ...
replace
14
27
14
18
TLE
p02832
C++
Runtime Error
#include <iostream> using namespace std; int main() { int length; cin >> length; int tot = 0; int brick[100000]; int sen = 1; for (int i = 0; i < length; i++) { cin >> brick[i]; if (brick[i] != sen) { tot++; } else { sen++; } } if (sen == 1) { tot = -1; } cout <<...
#include <iostream> using namespace std; int main() { int length; cin >> length; int tot = 0; int brick[1000000]; int sen = 1; for (int i = 0; i < length; i++) { cin >> brick[i]; if (brick[i] != sen) { tot++; } else { sen++; } } if (sen == 1) { tot = -1; } cout <...
replace
10
11
10
11
0
p02832
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long int a, b, c, ar[100009], sum, cnt; int main() { cin >> a; long long int j = 1; for (int i = 1; i <= a; i++) cin >> ar[i]; for (int i = 1; i <= a; i++) { if (ar[i] != j) cnt++; else { j++; } } if (cnt == a) cout << "-1"...
#include <bits/stdc++.h> using namespace std; long long int a, b, c, ar[1000009], sum, cnt; int main() { cin >> a; long long int j = 1; for (int i = 1; i <= a; i++) cin >> ar[i]; for (int i = 1; i <= a; i++) { if (ar[i] != j) cnt++; else { j++; } } if (cnt == a) cout << "-1...
replace
2
3
2
3
0