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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03059 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
#define int long long
#define str string
#define rep(x, y) for (int i = x; i < y; i++)
#define REP(x, y) for (int j = x; j < y; j++)
#define all(x) x.begin(), x.end()
#define vint vector<int>
#define vchar vector<char>
#define vstr vector<string>
#define... | #include <bits/stdc++.h>
#include <ctype.h>
using namespace std;
#define int long long
#define str string
#define rep(x, y) for (int i = x; i < y; i++)
#define REP(x, y) for (int j = x; j < y; j++)
#define all(x) x.begin(), x.end()
#define vint vector<int>
#define vchar vector<char>
#define vstr vector<string>
#define... | replace | 15 | 21 | 15 | 16 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03059 | C++ | Time Limit Exceeded | /* ______
_______ /\ |``\ | | /
| / \ |__/ |____ |/
| / _ _\ | \ | |\
| / \ | \ |______ | \
Dept. of CSE
Comilla University
*/
#include <bits/stdc++.h>
#define pi 2 * acos(0.0)
#define ll long long
#defin... | /* ______
_______ /\ |``\ | | /
| / \ |__/ |____ |/
| / _ _\ | \ | |\
| / \ | \ |______ | \
Dept. of CSE
Comilla University
*/
#include <bits/stdc++.h>
#define pi 2 * acos(0.0)
#define ll long long
#defin... | replace | 42 | 57 | 42 | 44 | TLE | |
p03059 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int sumDigits(int n) {
int s;
while (n < 0) {
s += n % 10;
n /= 10;
}
return s;
}
int main() {
int A, B;
int ans = 0;
float T;
cin >> A >> B >> T;
int n = 1;
while (A * n <= T + 0.5) {
ans += B;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int sumDigits(int n) {
int s;
while (n < 0) {
s += n % 10;
n /= 10;
}
return s;
}
int main() {
int A, B;
int ans = 0;
float T;
cin >> A >> B >> T;
int n = 1;
while (A * n <= T + 0.5) {
ans += B;
n += 1;
}
cout << ans << endl;
} | insert | 21 | 21 | 21 | 22 | TLE | |
p03059 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define OO 1e9
#define SS second
#define FF first
#define Trace(n) cout << #n << " = " << n << endl;
#define ll long long
// #define endl "\n"
#define all(v) ((v).begin()), ((v).end())
#define boom main
#define cn(n)... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define OO 1e9
#define SS second
#define FF first
#define Trace(n) cout << #n << " = " << n << endl;
#define ll long long
// #define endl "\n"
#define all(v) ((v).begin()), ((v).end())
#define boom main
#define cn(n)... | delete | 29 | 34 | 29 | 29 | 0 | |
p03059 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
int a, b, t;
a = atoi(argv[1]);
b = atoi(argv[2]);
t = atoi(argv[3]);
int n = t / a;
printf("%d\n", b * n);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
int a, b, t;
scanf("%d %d %d", &a, &b, &t);
int n = t / a;
printf("%d\n", b * n);
return 0;
}
| replace | 5 | 9 | 5 | 6 | -11 | |
p03059 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
... | replace | 100 | 109 | 100 | 101 | TLE | |
p03059 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, T;
int sum;
for (int i = 1; A * i < T + 0.5; i++) {
sum += B;
}
cout << sum << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, T;
int sum;
cin >> A >> B >> T;
for (int i = 1; A * i < T + 0.5; i++) {
sum += B;
}
cout << sum << endl;
} | insert | 8 | 8 | 8 | 9 | TLE | |
p03059 | Python | Runtime Error | a, b, t = (int(i) for i in input())
times = int(t / a)
num = times * b
print(num)
| a, b, t = (int(i) for i in input().split())
times = int(t / a)
num = times * b
print(num)
| replace | 0 | 1 | 0 | 1 | ValueError: invalid literal for int() with base 10: ' ' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03059/Python/s003873800.py", line 1, in <module>
a, b, t = (int(i) for i in input())
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03059/Python/s003873800.py", line 1, in <genexpr>
... |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> V(N);
vector<int> C(N);
long long answer = 0;
for (int i = 0; i < N; i++) {
cin >> V.at(i);
cin >> C.at(N);
if (V.at(i) - C.at(i) > 0) {
answer += V.at(i) - C.at(i);
}
}
cout << answer << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> V(N);
vector<int> C(N);
long long answer = 0;
for (int i = 0; i < N; i++) {
cin >> V.at(i);
}
for (int i = 0; i < N; i++) {
cin >> C.at(i);
}
for (int i = 0; i < N; i++) {
if (V.at(i) - C.at(i) > 0) {... | replace | 10 | 11 | 10 | 15 | -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)
|
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fw(p) for (int w = 0; w < (p); w++)
#define fx(p) for (int x = 0; x < (p); x++)
#define fy(p) for (int y = 0; y < (p); y++)
#define fz(p) for (int z = 0; z < (p); z++)
#define fyg(p, g) for (int y = (g); y < (p); y++)
#define fzg(p, g) for (int ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fw(p) for (int w = 0; w < (p); w++)
#define fx(p) for (int x = 0; x < (p); x++)
#define fy(p) for (int y = 0; y < (p); y++)
#define fz(p) for (int z = 0; z < (p); z++)
#define fyg(p, g) for (int y = (g); y < (p); y++)
#define fzg(p, g) for (int ... | replace | 71 | 72 | 71 | 72 | 0 | |
p03060 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vn;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
vn.push_back(a);
}
vector<int> vc;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
vc.push_... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vn;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
vn.push_back(a);
}
vector<int> vc;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
vc.push_... | replace | 31 | 32 | 31 | 32 | 0 | |
p03060 | 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
ll INF = 10001000100;
int main() {
int n;
cin >> n;
vector<int> v(n);
vector<int> c(n);
rep(i, n) cin >> v[i];
rep(i, n) cin >> c[i];
bitset<20> sum;
int ans = 0;
rep(i, 1 << n) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define ll long long
ll INF = 10001000100;
int main() {
int n;
cin >> n;
vector<int> v(n);
vector<int> c(n);
rep(i, n) cin >> v[i];
rep(i, n) cin >> c[i];
bitset<20> sum;
int ans = 0;
rep(i, n) {
i... | replace | 16 | 17 | 16 | 17 | 0 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
cin >> N;
vector<int> vec1, vec2;
for (int i = 0; i < N; i++)
cin >> vec1[i];
for (int j = 0; j < N; j++)
cin >> vec2[j];
for (int k = 0; k < N; k++) {
if (vec1[k] > vec2[k]) {
ans += vec1[k];
ans -= vec2[k];... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, ans = 0;
cin >> N;
vector<int> vec1(20), vec2(20);
for (int i = 0; i < N; i++)
cin >> vec1[i];
for (int j = 0; j < N; j++)
cin >> vec2[j];
for (int k = 0; k < N; k++) {
if (vec1[k] > vec2[k]) {
ans += vec1[k];
ans -= ... | replace | 6 | 7 | 6 | 7 | -11 | |
p03060 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define __ \
{ ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define __ \
{ ... | replace | 19 | 20 | 19 | 20 | 0 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v.at(i);
}
vector<int> w(n);
for (int i = 0; i < n; i++) {
cin >> w.at(i);
}
vector<int> vw(n);
for (int i = 0; i < n; i++) {
vw.at(i) = v.at(i) - w.at(i);
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v.at(i);
}
vector<int> w(n);
for (int i = 0; i < n; i++) {
cin >> w.at(i);
}
vector<int> vw(n);
for (int i = 0; i < n; i++) {
vw.at(i) = v.at(i) - w.at(i);
... | replace | 21 | 22 | 21 | 22 | 0 | |
p03060 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rept(i, a, b)... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rept(i, a, b)... | replace | 27 | 28 | 27 | 28 | -11 | |
p03060 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1 << 30)
#define INFLL (1ll << 60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll &a, ll b) {
a *= b;
a %= MOD;
}
void add_mod(ll &a, ll b) {
a += b;
a %= MOD;
}
... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1 << 30)
#define INFLL (1ll << 60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size
void mul_mod(ll &a, ll b) {
a *= b;
a %= MOD;
}
void add_mod(ll &a, ll b) {
a += b;
a %= MOD;
}
... | replace | 36 | 37 | 36 | 37 | 0 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int max = 0;
int V[n], C[n];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> V[i];
}
for (int i = 0; i < n; i++) {
cin >> C[i];
}
for (int i = 0; i < n; i++) {
if (V[i] > C[i]) {
max += V[i] - C[i];
}
}
cout << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int max = 0;
vector<int> V(n);
vector<int> C(n);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> V[i];
}
for (int i = 0; i < n; i++) {
cin >> C[i];
}
for (int i = 0; i < n; i++) {
if (V[i] > C[i]) {
max += V[i] - C[i]... | replace | 5 | 6 | 5 | 7 | 0 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < n; i++)
int main() {
int n;
int v[n + 10];
int c[n + 10];
cin >> n;
REP(i, n) { cin >> v[i]; }
REP(i, n) { cin >> c[i]; }
int ans = 0;
REP(i, n) {
i... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < n; i++)
int main() {
int n;
int v[n + 100];
int c[n + 100];
cin >> n;
REP(i, n) { cin >> v[i]; }
REP(i, n) { cin >> c[i]; }
int ans = 0;
REP(i, n) {
... | replace | 10 | 12 | 10 | 12 | 0 | |
p03060 | C++ | Runtime Error | /*
Author: ankrypt
*/
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
ll N;
ll Vs[25];
ll Cs[25];
ll dp[25][55][55];
ll rec(int ind, int val, int cost) {
if (ind == N) {
return val - cost;
}
ll &ans = dp[ind][val][co... | /*
Author: ankrypt
*/
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
ll N;
ll Vs[25];
ll Cs[25];
ll dp[25][2005][2005];
ll rec(int ind, int val, int cost) {
if (ind == N) {
return val - cost;
}
ll &ans = dp[ind][val... | replace | 15 | 16 | 15 | 16 | 0 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0;
vector<int> v, c;
for (int i = 0; i < n; i++) {
cin >> v[i];
}
for (int i = 0; i < n; i++) {
cin >> c[i];
}
for (int i = 0; i < n; i++) {
if (v[i] - c[i] > 0) {
sum += v[i] - c[i];
}
}
c... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0;
vector<int> v(n), c(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
for (int i = 0; i < n; i++) {
cin >> c[i];
}
for (int i = 0; i < n; i++) {
if (v[i] - c[i] > 0) {
sum += v[i] - c[i];
}
... | replace | 7 | 8 | 7 | 8 | -11 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define C continue;
#define D double
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define vi vector<int>
#define vs vector<string>
#define vb vector<bool>
#define vd vector<D>
#define vll vector<ll>
#define vull vector<ul... | #include <bits/stdc++.h>
using namespace std;
#define C continue;
#define D double
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define vi vector<int>
#define vs vector<string>
#define vb vector<bool>
#define vd vector<D>
#define vll vector<ll>
#define vull vector<ul... | replace | 46 | 48 | 46 | 47 | -11 | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i < b; i++)
int main() {
int n;
cin >> n;
int ans = 0;
vector<int> v, c;
rep(i, 0, n) { cin >> v[i]; }
rep(i, 0, n) {
cin >> c[i];
if (v[i] > c[i])
ans += v[i] - c[i];
}
cout << ans;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i < b; i++)
int main() {
int n;
cin >> n;
int ans = 0;
vector<int> v(n), c(n);
rep(i, 0, n) { cin >> v[i]; }
rep(i, 0, n) {
cin >> c[i];
if (v[i] > c[i])
ans += v[i] - c[i];
}
cout << an... | replace | 8 | 9 | 8 | 9 | -11 | |
p03060 | C++ | Runtime Error | /** Author: Nicklaus **/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli;
typedef long double ld;
int main() {
int n;
cin >> n;
vector<int> a(n), b(b);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
cin >> b[i];
int ans = 0;
for ... | /** Author: Nicklaus **/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli;
typedef long double ld;
int main() {
int n;
cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
cin >> b[i];
int ans = 0;
for ... | replace | 10 | 11 | 10 | 11 | -6 | terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
|
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> V(N);
vector<int> C(N);
int P = 0;
cin >> N;
// N個の宝石の価値を代入する
for (int i = 0; i < N; i++) {
cin >> V.at(i);
}
// N個の宝石のコストを代入する
for (int i = 0; i < N; i++) {
cin >> C.at(i);
}
// 宝石の価値とコストを比較する
// 0以上であれば... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> V(21);
vector<int> C(21);
int P = 0;
cin >> N;
// N個の宝石の価値を代入する
for (int i = 0; i < N; i++) {
cin >> V.at(i);
}
// N個の宝石のコストを代入する
for (int i = 0; i < N; i++) {
cin >> C.at(i);
}
// 宝石の価値とコストを比較する
// 0以上であ... | replace | 5 | 7 | 5 | 7 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, s = 0, ans = 0;
cin >> n;
vector<int> a(n), b(n), c(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = 0; i < n; i++) {
cin >> b.at(i);
c.at(i) = a.at(i) - b.at(i);
}
sort(c.begin(), c.end());
reverse(c.beg... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, s = 0, ans = 0;
cin >> n;
vector<int> a(n), b(n), c(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = 0; i < n; i++) {
cin >> b.at(i);
c.at(i) = a.at(i) - b.at(i);
}
sort(c.begin(), c.end());
reverse(c.beg... | insert | 16 | 16 | 16 | 18 | 0 | |
p03060 | C++ | Time Limit Exceeded | #include <cfenv>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int V[20], C[20];
int main() {
int N;
cin >> N;
for (int i = 0; i < N; ++i)
cin >> V[i];
for (int i = 0; i < N; ++i)
cin >> C[i];
int sum = 0;
for (int i = 0; N; ++i) {
int a = V[i] - C[i];
if (a > ... | #include <cfenv>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int V[20], C[20];
int main() {
int N;
cin >> N;
for (int i = 0; i < N; ++i)
cin >> V[i];
for (int i = 0; i < N; ++i)
cin >> C[i];
int sum = 0;
for (int i = 0; i < N; ++i) {
int a = V[i] - C[i];
if (... | replace | 15 | 16 | 15 | 16 | TLE | |
p03060 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int N, c, sum;
int V[10];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> V[i];
}
sum = 0;
for (int i = 0; i < N; i++) {
cin >> c;
if (c < V[i]) {
sum += V[i] - c;
}
}
cout << sum << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int N, c, sum;
int V[20];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> V[i];
}
sum = 0;
for (int i = 0; i < N; i++) {
cin >> c;
if (c < V[i]) {
sum += V[i] - c;
}
}
cout << sum << endl;
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p03060 | C++ | Runtime Error | #include <iostream>
#include <vector>
// #include <fstream>
using namespace std;
int main(int argc, const char *argv[]) {
// ifstream in("input.txt");
// cin.rdbuf(in.rdbuf());
int N;
cin >> N;
int max = 0;
vector<int> V, C;
for (int i = 0; i < N; i++) {
cin >> V[i];
}
for (int i = 0; i ... | #include <iostream>
#include <vector>
// #include <fstream>
using namespace std;
int main(int argc, const char *argv[]) {
// ifstream in("input.txt");
// cin.rdbuf(in.rdbuf());
int N;
cin >> N;
int max = 0;
vector<int> V(N), C(N);
for (int i = 0; i < N; i++) {
cin >> V[i];
}
for (int i =... | replace | 14 | 15 | 14 | 15 | -11 | |
p03060 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a, b;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
cin >> b[i];
int ans = 0;
for (int i = 0; i < n; i++) {
if (a[i] > b[i])
ans += a[i] - b[i];
}
cout << ans;
... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
cin >> b[i];
int ans = 0;
for (int i = 0; i < n; i++) {
if (a[i] > b[i])
ans += a[i] - b[i];
}
cout <<... | replace | 6 | 7 | 6 | 7 | -11 | |
p03060 | Python | Time Limit Exceeded | def main():
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
maxi = 0
for i in range(2**N):
binary = list(map(int, format(i, "b").zfill(N)))
ans = 0
for j, k in enumerate(binary):
if k == 1:
ans += V[j] - C[j... | def main():
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
K = [V[i] - C[i] for i in range(N)]
ans = 0
for k in K:
if k > 0:
ans += k
print(ans)
if __name__ == "__main__":
main()
| replace | 4 | 15 | 4 | 10 | TLE | |
p03060 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
int main() {
int N;
cin >> N;
vector<int> V, C, S;
rep(i, N) cin >> V.at(i);
rep(i, N) cin >> C.at(i);
int answer = 0;
rep(i, N) S.at(i) = V.at(i) - C.at(i);
rep(i, N) {
if (S.at(i) > 0)
answer... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
int main() {
int N;
cin >> N;
vector<int> V(30), C(30), S(30);
rep(i, N) cin >> V.at(i);
rep(i, N) cin >> C.at(i);
int answer = 0;
rep(i, N) S.at(i) = V.at(i) - C.at(i);
rep(i, N) {
if (S.at(i) > 0)
... | replace | 8 | 9 | 8 | 9 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
|
p03060 | Python | Time Limit Exceeded | n = int(input())
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))
ret = -float("inf")
for i in range((2**n)):
total_cost = 0
total_value = 0
j = 0
while i > 0:
if i & 1:
total_cost += cs[j]
total_value += vs[j]
i >>= 1
j += 1
... | n = int(input())
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))
# ret = - float('inf')
# for i in range((2 ** n)):
# total_cost = 0
# total_value = 0
# j = 0
# while i > 0:
# if i & 1:
# total_cost += cs[j]
# total_value += vs[j]
# i >>... | replace | 4 | 17 | 4 | 25 | TLE | |
p03060 | Python | Time Limit Exceeded | def resolve():
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
maxA = 0
for i in range(2**N):
X = 0
Y = 0
for j in range(N):
if (i >> j) & 1:
X += V[j]
Y += C[j]
maxA = max(maxA, ... | def resolve():
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0
for i in range(N):
if V[i] > C[i]:
ans += V[i] - C[i]
print(ans)
resolve()
| replace | 4 | 14 | 4 | 9 | TLE | |
p03060 | Python | Runtime Error | def sub():
N, Vs, Cs = [e for e in input().split(" ")]
N = int(N)
Vs = [int(e) for e in Vs.split(" ")]
Cs = [int(e) for e in Cs.split(" ")]
ds = [v - c for v, c in zip(Vs, Cs)]
ds = [d for d in ds if d > 0]
print(sum(ds))
sub()
| def sub():
N, Vs, Cs = [input() for _ in range(3)]
N = int(N)
Vs = [int(e) for e in Vs.split(" ")]
Cs = [int(e) for e in Cs.split(" ")]
ds = [v - c for v, c in zip(Vs, Cs)]
ds = [d for d in ds if d > 0]
print(sum(ds))
sub()
| replace | 1 | 2 | 1 | 2 | ValueError: not enough values to unpack (expected 3, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03060/Python/s308117687.py", line 11, in <module>
sub()
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03060/Python/s308117687.py", line 2, in sub
N, Vs, Cs = [e for e in input().spl... |
p03060 | Python | Time Limit Exceeded | N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))
ans = -100000000000
for num in range(2**N):
value = cost = 0
for i in range(N):
if (num >> i) & 1 == 1:
value += vlist[i]
cost += clist[i]
if value - cost > ans:
ans = va... | N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))
ans = 0
for i in range(N):
if vlist[i] - clist[i] > 0:
ans += vlist[i] - clist[i]
print(ans)
| replace | 3 | 13 | 3 | 7 | TLE | |
p03060 | Python | Runtime Error | n = int(input())
v = [int(item) for item in input().split()]
c = [int(item) for item in input().split()]
d = [[v[i], c[i]] for i in range(n)]
d.sort(key=lambda x: x[0] - x[1], reverse=True)
ans = 0
i = 0
while d[i][0] - d[i][1] > 0:
ans += d[i][0] - d[i][1]
i += 1
print(ans)
| n = int(input())
v = [int(item) for item in input().split()]
c = [int(item) for item in input().split()]
d = [[v[i], c[i]] for i in range(n)]
d.sort(key=lambda x: x[0] - x[1], reverse=True)
ans = 0
i = 0
while i < n and d[i][0] - d[i][1] > 0:
ans += d[i][0] - d[i][1]
i += 1
print(ans)
| replace | 9 | 10 | 9 | 10 | 0 | |
p03060 | Python | Time Limit Exceeded | # coding: utf-8
import itertools
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
d = sum(v) - sum(c)
maxd = d if d > 0 else 0
for m in range(1, n):
a0 = [i for i in list(itertools.combinations(list(range(n)), m))]
for a1 in a0:
d = sum([v[j] - c[j] for j in a1])... | # coding: utf-8
import itertools
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
d = sum([v[i] - c[i] for i in range(n) if v[i] - c[i] > 0])
print(d)
| replace | 6 | 15 | 6 | 8 | TLE | |
p03060 | Python | Time Limit Exceeded | n = int(input())
v = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))
ans = 0
for bit in range(1 << n):
tmp = 0
for i in range(n):
if bit >> i & 1:
tmp += v[i] - c[i]
ans = max(ans, tmp)
print(ans)
| n = int(input())
v = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))
ans = 0
for i in range(n):
ans += max(0, v[i] - c[i])
print(ans)
| replace | 5 | 11 | 5 | 7 | TLE | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
long long gcd(long long n1, long long n2) {
if (n1 < n2)
std::swap(n1, n2);
long long m;
do {
m = n1 % n2;
n1 = n2;
n2 = m;
} while (m != 0);
return n1;
}
int main() {
long long N;
std::cin >> N;
std::vect... | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
long long gcd(long long n1, long long n2) {
if (n1 < n2)
std::swap(n1, n2);
if (n2 == 0)
return n1;
long long m;
do {
m = n1 % n2;
n1 = n2;
n2 = m;
} while (m != 0);
return n1;
}
int main() {
long long N;... | insert | 8 | 8 | 8 | 10 | -8 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
#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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pint = pa... | #include <bits/stdc++.h>
using namespace std;
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <vector>
#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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pint = pa... | replace | 35 | 36 | 35 | 36 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
ll gcd(ll a, ll b) {
if (a * b == 0)
return a + b;
if (a < b)
gcd(b, a);
ll r;
while ((r = a % b)) {
a = b;
b... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
ll gcd(ll a, ll b) {
if (a * b == 0)
return a + b;
if (a < b)
gcd(b, a);
ll r;
while ((r = a % b)) {
a = b;
b... | replace | 29 | 31 | 29 | 31 | 0 | |
p03061 | C++ | Runtime Error | /************************Code by Hardik
* Aggarwal!!!!***********************************/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
... | /************************Code by Hardik
* Aggarwal!!!!***********************************/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
... | delete | 37 | 43 | 37 | 37 | -11 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using ll = unsigned long long;
using namespace std;
// http://drken1215.hatenablog.com/entry/2019/04/27/224100_1
int n;
ll *A;
int gcd(int a, int b) {
if (b == 0) {
return a;
} else {
gcd(b, a % b);
}
}
int main(void) {
cin... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using ll = unsigned long long;
using namespace std;
// http://drken1215.hatenablog.com/entry/2019/04/27/224100_1
int n;
ll *A;
int gcd(int a, int b) {
if (b == 0) {
return a;
} else {
gcd(b, a % b);
}
}
int main(void) {
cin... | replace | 45 | 46 | 45 | 46 | -11 | |
p03061 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
int main() {
ll N;
vector<ll> A(N);
cin >> N;
for (ll i = 0; i < N; i++) {
cin >> A[i];
}
// 入力完了
vector<ll> L(N), R(N);
L... | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
int main() {
ll N;
vector<ll> A(N);
cin >> N;
for (ll i = 0; i < N; i++) {
cin >> A[i];
}
// 入力完了
vector<ll> L(N), R(N);
L... | replace | 29 | 30 | 29 | 30 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03061 | Python | Time Limit Exceeded | import fractions
N = int(input())
A = list(map(int, input().split()))
gcd_max = 0
for i in range(N):
a_temp = A[:i]
a_temp.extend(A[i + 1 :])
gcd_temp = a_temp[0]
for a in a_temp:
gcd_temp = fractions.gcd(gcd_temp, a)
if gcd_temp <= gcd_max:
break
else:
gcd_max =... | import fractions
N = int(input())
A = list(map(int, input().split()))
L = [0] * N
R = [0] * N
for i in range(0, N - 1):
L[i + 1] = fractions.gcd(L[i], A[i])
for i in range(N - 1, 0, -1):
R[i - 1] = fractions.gcd(R[i], A[i])
print(max([fractions.gcd(L[i], R[i]) for i in range(N)]))
| replace | 4 | 16 | 4 | 11 | TLE | |
p03061 | Python | Runtime Error | from math import gcd
N = int(input())
A = list(map(int, input().split()))
cum_left = [A[0]]
cum_right = [A[N - 1]]
for i in range(1, N - 1):
cum_left.append(gcd(cum_left[-1], A[i]))
cum_right.append(gcd(cum_right[-1], A[N - 1 - i]))
ans = max(cum_left[N - 2], cum_right[N - 2])
for i in range(1, N - 1):
a... | from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
cum_left = [A[0]]
cum_right = [A[N - 1]]
for i in range(1, N - 1):
cum_left.append(gcd(cum_left[-1], A[i]))
cum_right.append(gcd(cum_right[-1], A[N - 1 - i]))
ans = max(cum_left[N - 2], cum_right[N - 2])
for i in range(1, N - 1):
... | replace | 0 | 1 | 0 | 1 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int req(vector<int> A, int N) {
int wrongB = 0;
int wrongC = 0;
vector<int> B(N), C(N);
B[0] = A[0];
C[1] = A[1];
for (int i = 1; i < N; i++) {
B[i] = A[i] % A[0];
if (B[i] == 0) {
B[i] = A[0];
continue;
}
wrongB++;
}
for (int i ... | #include <bits/stdc++.h>
using namespace std;
int req(vector<int> A, int N) {
int wrongB = 0;
int wrongC = 0;
vector<int> B(N), C(N);
B[0] = A[0];
C[1] = A[1];
for (int i = 1; i < N; i++) {
B[i] = A[i] % A[0];
if (B[i] == 0) {
B[i] = A[0];
continue;
}
wrongB++;
}
for (int i ... | replace | 23 | 24 | 23 | 24 | 0 | |
p03061 | Python | Time Limit Exceeded | import fractions
N = int(input())
aLst = list(map(int, input().split()))
ansLst = []
for i in range(len(aLst)):
ans = 0
for j in range(len(aLst)):
if i != j:
ans = fractions.gcd(ans, aLst[j])
ansLst.append(ans)
ansLst.sort(reverse=True)
print(ansLst[0])
| import fractions
N = int(input())
aLst = list(map(int, input().split()))
lans = 0
llst = [0] * (N + 1)
rans = 0
rlst = [0] * (N + 1)
for i in range(N):
lans = fractions.gcd(lans, aLst[i])
llst[i + 1] = lans
for i in range(N - 1, -1, -1):
rans = fractions.gcd(rans, aLst[i])
rlst[i] = rans
ansMax = 0... | replace | 5 | 14 | 5 | 23 | TLE | |
p03061 | Python | Time Limit Exceeded | from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
if n == 2:
print(max(a))
exit()
x = [a[0], gcd(a[0], a[1])]
y = [gcd(a[-2], a[-1]), a[-1]]
for i in range(1, n - 2):
x.append(gcd(x[i], a[i + 1]))
y.insert(0, gcd(y[0], a[-i - 2]))
ans = max(x[-1], y[0])
for i in range(n - 2... | from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
if n == 2:
print(max(a))
exit()
x = [a[0], gcd(a[0], a[1])]
for i in range(n - 3):
x.append(gcd(x[i + 1], a[i + 2]))
ans = x[-1]
y = a[-1]
for i in range(1, n - 1):
z = gcd(y, a[-i])
ans = max(ans, gcd(x[-i - 1], z))
... | replace | 8 | 16 | 8 | 17 | TLE | |
p03061 | C++ | Runtime Error | //
// Created by Tetsuya Shiota on 2019-04-13.
//
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <type_traits>
#include <stack>
#include ... | //
// Created by Tetsuya Shiota on 2019-04-13.
//
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <type_traits>
#include <stack>
#include ... | replace | 115 | 124 | 115 | 117 | 0 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int gcd(int a, int b) {
if (a == 0) {
return b;
}
if (b == 0) {
return a;
}
if (a % b == 0) {
return (b);
} else {
return (gcd(b, a % b));
}
}
int main() {
int ans = 0, N;
cin >> N;
ve... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int gcd(int a, int b) {
if (a == 0) {
return b;
}
if (b == 0) {
return a;
}
if (a % b == 0) {
return (b);
} else {
return (gcd(b, a % b));
}
}
int main() {
int ans = 0, N;
cin >> N;
ve... | replace | 23 | 24 | 23 | 24 | 0 | |
p03061 | C++ | Runtime Error | #include <iostream>
#include <vector>
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() {
int N;
cin >> N;
vector<ll> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
vector<ll> left(N, 0);
vector<ll> right(N, 0... | #include <iostream>
#include <vector>
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() {
int N;
cin >> N;
vector<ll> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
vector<ll> left(N, 0);
vector<ll> right(N, 0... | replace | 27 | 28 | 27 | 28 | -6 | free(): invalid pointer
|
p03061 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<int> l(n), r(n);
for (int i = 0; i < n; i++)
l[i + 1] = gcd(l[i]... | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<int> l(n), r(n);
for (int i = 0; i < n - 1; i++)
l[i + 1] = gcd(... | replace | 15 | 16 | 15 | 16 | 0 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int no_of_elements;
cin >> no_of_elements;
vector<int> A(no_of_elements);
for (int i = 1; i <= no_of_elements; i++)
cin >> A[i];
vector<int> prefix_gcd(no_of_elements + 1, 0);
for (int i = 1; ... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int no_of_elements;
cin >> no_of_elements;
vector<int> A(no_of_elements + 1);
for (int i = 1; i <= no_of_elements; i++)
cin >> A[i];
vector<int> prefix_gcd(no_of_elements + 1, 0);
for (int i =... | replace | 11 | 12 | 11 | 12 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
#define Grafo vector<vector<pair<int, int>>>
#define Container vector<vector<int>>
#define MAX 40321
#define INFINITO INT_MAX
using namespace std;
int A[MAX];
int WA[MAX];
int n, maior;
int mdc(int x, int y) {
if (x == -1) {
return y;
}
if (y == -1) {
return x;
}
return __g... | #include <bits/stdc++.h>
#define MAX 100001
using namespace std;
int A[MAX];
int WA[MAX];
int n, maior;
int mdc(int x, int y) {
if (x == -1) {
return y;
}
if (y == -1) {
return x;
}
return __gcd(x, y);
}
void conquer(int i1, int j1, int i2, int j2) {
int left = mdc(A[i1], WA[i1]);
int right = ... | replace | 1 | 5 | 1 | 2 | 0 | |
p03061 | Python | Runtime Error | from math import gcd
n = int(input())
a = list(map(int, input().split()))
pre = [0]
for i in range(n - 1):
pre.append(gcd(pre[-1], a[i]))
post = [0]
for i in range(n - 1):
post.append(gcd(post[-1], a[n - 1 - i]))
res = 0
for i in range(n):
res = max(gcd(pre[i], post[n - 1 - i]), res)
print(res)
| def gcd(a, b):
while b:
a, b = b, a % b
return a
n = int(input())
a = list(map(int, input().split()))
pre = [0]
for i in range(n - 1):
pre.append(gcd(pre[-1], a[i]))
post = [0]
for i in range(n - 1):
post.append(gcd(post[-1], a[n - 1 - i]))
res = 0
for i in range(n):
res = max(gcd(pre[i... | replace | 0 | 1 | 0 | 5 | 0 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
ll c;
while (a > 0) {
c = a;
a = b % a;
b = c;
}
return c;
}
int main() {
ll b, c, d, e, k, n, o = 1, p, q, x, y, z, max1 = 0, ans = 1;
string s, t, u;
cin >> n;
ll a[n... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
ll c;
while (a > 0) {
c = a;
a = b % a;
b = c;
}
return c;
}
int main() {
ll b, c, d, e, k, n, o = 1, p, q, x, y, z, max1 = 0, ans = 1;
string s, t, u;
cin >> n;
ll a[n... | replace | 28 | 29 | 28 | 29 | TLE | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define repf(i, m, n) for (int(i) = m; (i) < n; (i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#def... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define repf(i, m, n) for (int(i) = m; (i) < n; (i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#def... | replace | 72 | 73 | 72 | 74 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
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++)
typedef long long ll;
ll gcd(ll x, ll y) {
if (y == 0) {
return x;
}
return gcd(y, x % y);
}
int main() {
int N;
cin >> N;
vector<ll> A(N);
rep(i, N) { cin >> A.... | #include <bits/stdc++.h>
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++)
typedef long long ll;
ll gcd(ll x, ll y) {
if (y == 0) {
return x;
}
return gcd(y, x % y);
}
int main() {
int N;
cin >> N;
vector<ll> A(N);
rep(i, N) { cin >> A.... | replace | 19 | 23 | 19 | 21 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p03061 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
int N;
using namespace std;
vector<int> A;
vector<int> B;
vector<int> C;
int gcd(int a, int b) {
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
int main() {
cin >> N;
A.resize(N);
B.resize(N);
C.resize(N);
for (int i = 0;... | #include <iostream>
#include <string>
#include <vector>
int N;
using namespace std;
vector<int> A;
vector<int> B;
vector<int> C;
int gcd(int a, int b) {
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
int main() {
cin >> N;
A.resize(N);
B.resize(N);
C.resize(N);
for (int i = 0;... | replace | 31 | 32 | 31 | 36 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
#define MAX_N 100100
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
int r = a % b;
return gcd(b, r);
}
int main() {
int n;
cin >> n;
vector<int> a(n), right_gcd(n), left_gcd(n);
for (int i = 0; i < n; i++)
cin >> a[i];
// gcd wit... | #include <bits/stdc++.h>
#include <math.h>
#define MAX_N 100100
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
int r = a % b;
return gcd(b, r);
}
int main() {
int n;
cin >> n;
vector<int> a(n + 1), right_gcd(n + 1), left_gcd(n + 1);
for (int i = 0; i < n; i++)
cin >> a[i];
... | replace | 16 | 17 | 16 | 17 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if (a == 0 || b == 0) {
return max(a, b);
} else if (a == 1 || b == 1) {
return 1;
}
long long q;
bool pro = true;
while (pro) {
q = a % b;
if (q = 0) {
return min(a, b);
} else {
a = b;... | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if (a == 0 || b == 0) {
return max(a, b);
} else if (a == 1 || b == 1) {
return 1;
}
long long q;
bool pro = true;
while (pro) {
q = a % b;
if (q == 0) {
return min(a, b);
} else {
a = b... | replace | 14 | 15 | 14 | 15 | -8 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <string>
// #include <bits/stdc++.h>
using namespace std;
/*inline int read(){
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <string>
// #include <bits/stdc++.h>
using namespace std;
/*inline int read(){
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
... | replace | 16 | 17 | 16 | 17 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#define REP(i, num) for (int i = 0; i < (num); ++i)
using namespace std;
using ll = long long;
template <typename T = int> T in() {
T x;
cin >> x;
return (x);
}
ll gcd(ll a, ll b) {
if (a < b) {
swap(a, b);
}
if (b < 1)
return a;
while (ll r = (a % b)) {
a = b;
... | #include "bits/stdc++.h"
#define REP(i, num) for (int i = 0; i < (num); ++i)
using namespace std;
using ll = long long;
template <typename T = int> T in() {
T x;
cin >> x;
return (x);
}
ll gcd(ll a, ll b) {
if (a < b) {
swap(a, b);
}
if (b < 1)
return a;
while (ll r = (a % b)) {
a = b;
... | replace | 35 | 44 | 35 | 45 | TLE | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <stack>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define print(s) cout << s << endl
usi... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <stack>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define print(s) cout << s << endl
usi... | replace | 41 | 42 | 41 | 42 | -6 | double free or corruption (out)
|
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> pre_gcd(n + 1), suf_gcd(n + 1);
for (int i = 1; i <= ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> pre_gcd(n + 1), suf_gcd(n + 1);
for (int i = 1; i <= ... | replace | 19 | 20 | 19 | 20 | 0 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
long long gcd(long long x, long long y) {
long long a = min(x, y), b = max(x, y);
if (b % a == 0)
return a;
return (gcd(a, b % a));
}
int main() {
long long n, *a;
cin >> n;
a = new long long[n];
for (int i = 0; i < n; i++)
cin >> a... | #include <algorithm>
#include <iostream>
using namespace std;
long long gcd(long long x, long long y) {
long long a = min(x, y), b = max(x, y);
if (b % a == 0)
return a;
return (gcd(a, b % a));
}
int main() {
long long n, *a;
cin >> n;
a = new long long[n];
for (int i = 0; i < n; i++)
cin >> a... | insert | 25 | 25 | 25 | 30 | 0 | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long
#define ld long double
#define MOD 1000000007
#define u128 __int128
#define ff first
#define ss second
#define INTMAX 1000000009
#define N 100050
ll bmexp(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long
#define ld long double
#define MOD 1000000007
#define u128 __int128
#define ff first
#define ss second
#define INTMAX 1000000009
#define N 100050
ll bmexp(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
... | replace | 30 | 31 | 30 | 31 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
struct CinInit {
CinInit() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(20);
};
} CinInit;
int gcd(const int a, const int b) {
if (a < b)
return gcd(b, a);
else if (b == 0)
return a;
else if (b == 1)
return 1;
el... | #include <bits/stdc++.h>
using namespace std;
struct CinInit {
CinInit() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(20);
};
} CinInit;
int gcd(const int a, const int b) {
if (a < b)
return gcd(b, a);
else if (b == 0)
return a;
else if (b == 1)
return 1;
el... | replace | 19 | 20 | 19 | 20 | TLE | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
if (x == 0)
return y;
if (y == 0)
return x;
while (x != y) {
if (x > y)
x -= y;
else
y -= x;
}
return x;
}
int main() {
int N;
cin >> N;
// vector<vector<char>> d(H, vector<char>(W));
vector<int> A(N + ... | #include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
if (x < y)
swap(x, y);
while (y != 0) {
x %= y;
swap(x, y);
}
return x;
}
int main() {
int N;
cin >> N;
// vector<vector<char>> d(H, vector<char>(W));
vector<int> A(N + 1);
for (int i = 1; i <= N; i++)
cin >> A.at(... | replace | 4 | 13 | 4 | 9 | TLE | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int gcd(int n, int m) {
if (m == 0)
return n;
else
return gcd(m, n % m);
}
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
int x[n], y[n];
x[0] = a[0], y[n - 1] = a[n - 1];
for (int i = 1; i < ... | #include <algorithm>
#include <iostream>
using namespace std;
int gcd(int n, int m) {
if (m == 0)
return n;
else
return gcd(m, n % m);
}
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
int x[n], y[n];
x[0] = a[0], y[n - 1] = a[n - 1];
for (int i = 1; i < ... | replace | 22 | 23 | 22 | 23 | TLE | |
p03061 | C++ | Runtime Error | // Created by conan1024hao on 2019/11/23.
// Copyright © 2019 conan1024hao. All rights reserved.
// 専用ライブラリです、自由にコピーして構いません。
// 感谢看我的代码!Wechat:conan1024hao QQ:810396815
#pragma GCC optimize("O3")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include... | // Created by conan1024hao on 2019/11/23.
// Copyright © 2019 conan1024hao. All rights reserved.
// 専用ライブラリです、自由にコピーして構いません。
// 感谢看我的代码!Wechat:conan1024hao QQ:810396815
#pragma GCC optimize("O3")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include... | replace | 60 | 61 | 60 | 61 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, GCD = 0;
cin >> N;
vector<int> H(N), CD(N + 1), CDR(N + 1);
for (int i = 0; i < N; i++)
cin >> H[i];
for (int i = 0; i < N; i++) {
fo... | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, GCD = 0;
cin >> N;
vector<int> H(N), CD(N + 1), CDR(N + 1);
for (int i = 0; i < N; i++)
cin >> H[i];
for (int j = 0; j < N; j++) {
CD... | replace | 13 | 22 | 13 | 18 | TLE | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int f, i, j, N, a[100001], m;
vector<int> v;
set<int> se;
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &a[i]);
}
m = max(a[0], a[1]);
auto p = se.insert(1);
for (i = 1; i * i <= m; i++) {
if (a[0] % i == 0) {
p = se.i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int f, i, j, N, a[100001], m;
vector<int> v;
set<int> se;
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &a[i]);
}
m = max(a[0], a[1]);
auto p = se.insert(1);
v.push_back(1);
for (i = 1; i * i <= m; i++) {
if (a[0] % i == 0... | insert | 14 | 14 | 14 | 15 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for (ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
temp... | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for (ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
temp... | insert | 87 | 87 | 87 | 89 | TLE | |
p03061 | Python | Runtime Error | from math import gcd
n = int(input())
a = list(map(int, input().split()))
forward = []
backward = [0 for x in range(n)]
if n == 2:
print(max(a[0], a[1]))
exit(0)
for i in range(n):
if i == 0:
forward.append(a[i])
else:
forward.append(gcd(forward[i - 1], a[i]))
for i in range(n - 1,... | from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
forward = []
backward = [0 for x in range(n)]
if n == 2:
print(max(a[0], a[1]))
exit(0)
for i in range(n):
if i == 0:
forward.append(a[i])
else:
forward.append(gcd(forward[i - 1], a[i]))
for i in range(n... | replace | 0 | 1 | 0 | 1 | 0 | |
p03061 | Python | Runtime Error | from math import gcd
n = int(input())
a = list(map(int, input().split()))
fromLeft = [0] * n
fromLeft[0] = a[0]
fromRight = [0] * n
fromRight[0] = a[n - 1]
for i in range(1, n):
fromLeft[i] = gcd(fromLeft[i - 1], a[i])
fromRight[i] = gcd(fromRight[i - 1], a[n - i - 1])
ret = fromLeft[n - 1]
for i in range(n):
... | def gcd(x, y):
while y:
x, y = y, x % y
return x
n = int(input())
a = list(map(int, input().split()))
fromLeft = [0] * n
fromLeft[0] = a[0]
fromRight = [0] * n
fromRight[0] = a[n - 1]
for i in range(1, n):
fromLeft[i] = gcd(fromLeft[i - 1], a[i])
fromRight[i] = gcd(fromRight[i - 1], a[n - i - ... | replace | 0 | 1 | 0 | 5 | 0 | |
p03061 | Python | Time Limit Exceeded | from functools import reduce
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
ans = [reduce(gcd, A)]
if len(A) == 1:
print(A[0])
exit()
for i in a:
b = sorted(A)
b.remove(i)
if a.count(i) == 1:
ans.append(reduce(gcd, b))
print(max(ans))
| from functools import reduce
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
A = list(set(a))
ans = [reduce(gcd, A)]
if len(A) == 1:
print(A[0])
exit()
for i in A:
b = sorted(A)
b.remove(i)
if a.count(i) == 1:
ans.append(reduce(gcd, b))
print(max(ans))
| replace | 11 | 12 | 11 | 12 | TLE | |
p03061 | Python | Runtime Error | from math import gcd
def main():
N = int(input())
nums = list(map(int, input().split()))
L = [0 for _ in range(N + 1)]
R = [0 for _ in range(N + 1)]
for i, num in enumerate(nums):
L[i + 1] = gcd(L[i], num)
for i in range(N - 2, -1, -1):
R[i] = gcd(R[i + 1], nums[i + 1])
... | #!/snap/bin/pypy3
def gcd(a, b):
if b == 0:
return a
c = a % b
return gcd(b, c)
def main():
N = int(input())
nums = list(map(int, input().split()))
L = [0 for _ in range(N + 1)]
R = [0 for _ in range(N + 1)]
for i, num in enumerate(nums):
L[i + 1] = gcd(L[i], num)
... | replace | 0 | 1 | 0 | 6 | 0 | |
p03061 | Python | Time Limit Exceeded | N = int(input())
A = [int(i) for i in input().split()]
if len(A) > 1:
result = sorted(A)[1]
else:
result = min(A)
while True:
counter = 0
should_continue = False
for e in A:
if e % result != 0:
counter += 1
if counter > 1:
should_continue = True
... | N = int(input())
A = [int(i) for i in input().split()]
if len(A) > 1:
result = sorted(A)[1]
else:
result = min(A)
while True:
counter = 0
should_continue = False
for e in A:
if e % result != 0:
counter += 1
if counter > 1:
should_continue = True
... | insert | 18 | 18 | 18 | 19 | TLE | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
typedef long long int lli;
typedef pair<int, int> P;
int A[10000];
int R[10000];
int L[10000];
int n;
int gcd(int a, int b) {
if (a < b)
swap(a, b);
if (b == 0)
return a;
int r;
r = a % b;
while (r != 0) {
... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
typedef long long int lli;
typedef pair<int, int> P;
int A[100000];
int R[100000];
int L[100000];
int n;
int gcd(int a, int b) {
if (a < b)
swap(a, b);
if (b == 0)
return a;
int r;
r = a % b;
while (r != 0)... | replace | 7 | 10 | 7 | 10 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;
int gcd(int m, int n) {
while (m != n)
m > n ? (m = m - n) : (... | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int ma... | replace | 9 | 14 | 9 | 10 | TLE | |
p03061 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define OO 1e9
#define SS second
#define FF first
#define Trace(n) cout << #n << " = " << n << endl;
#define ll long long
// #define endl "\n"
#define all(v) ((v).begin()), ((v).end())
#define boom main
#define cn(n)... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define OO 1e9
#define SS second
#define FF first
#define Trace(n) cout << #n << " = " << n << endl;
#define ll long long
// #define endl "\n"
#define all(v) ((v).begin()), ((v).end())
#define boom main
#define cn(n)... | delete | 29 | 34 | 29 | 29 | -11 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
if (x > y)
swap(x, y);
if (y % x == 0)
return x;
else
return gcd(y % x, x);
}
int main(void) {
int n;
cin >> n;
long long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
long long g[n]; // i番目を除いたn-1この... | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
if (x > y)
swap(x, y);
if (y % x == 0)
return x;
else
return gcd(y % x, x);
}
int main(void) {
int n;
cin >> n;
long long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
long long g[n]; // i番目を除いたn-1この... | replace | 17 | 27 | 17 | 33 | TLE | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
int c = min(a, b), d = max(a, b);
if (d % c == 0)
return c;
return GCD(c, d % c);
}
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
if (a[0] == a[n - 1]) {
... | #include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
int c = min(a, b), d = max(a, b);
if (d % c == 0)
return c;
return GCD(c, d % c);
}
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.begin(), a.end());
if (a[0] == a[n - 1]) {
... | replace | 26 | 27 | 26 | 27 | TLE | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll, ll>
#define vvll vector<vector<ll>>
#define pb push_back
#define inf 1e16
#define M 1000000007
#define all(v) (v).begin(), (v).end()
#define rep(i, a, ... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll, ll>
#define vvll vector<vector<ll>>
#define pb push_back
#define inf 1e16
#define M 1000000007
#define all(v) (v).begin(), (v).end()
#define rep(i, a, ... | replace | 34 | 35 | 34 | 35 | TLE | |
p03061 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<... | replace | 25 | 26 | 25 | 26 | MLE | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int main() {
ll n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<ll> left(n, 0);
vector<ll> right(n, 0);
for (int i = 0; i < n; i++)
left[i + 1]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int main() {
ll n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
vector<ll> left(n + 1, 0);
vector<ll> right(n + 1, 0);
for (int i = 0; i < n; i++)
lef... | replace | 13 | 15 | 13 | 15 | -6 | free(): invalid pointer
|
p03061 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
map<pair<int, int>, int> g_range_gcd;
int range_gcd(const vector<int> &A, int l, int r) {
if (r - l == 1)... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
map<pair<int, int>, int> g_range_gcd;
int range_gcd(const vector<int> &A, int l, int r) {
if (r - l == 1)... | replace | 19 | 20 | 19 | 21 | TLE | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<vector<int>>;
template <class T> inline bool chmin(T &a, T b) {
... | #include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array) / sizeof(array[0]))
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<vector<int>>;
template <class T> inline bool chmin(T &a, T b) {
... | replace | 29 | 30 | 29 | 30 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
#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++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long... | #include <bits/stdc++.h>
#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++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long... | replace | 48 | 49 | 48 | 49 | -6 | free(): invalid pointer
|
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
while (x && y) {
x %= y;
if (x == 0)
break;
y %= x;
}
return x + y;
}
int seg(int l, int r, int n, int nl, int nr, vector<int> t) {
if (l >= nr || r <= nl)
return 0; // 範囲がノードから外れている
else if (l <= nl && r >= nr)
re... | #include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
while (x && y) {
x %= y;
if (x == 0)
break;
y %= x;
}
return x + y;
}
int seg(int l, int r, int n, int nl, int nr, vector<int> &t) {
if (l >= nr || r <= nl)
return 0; // 範囲がノードから外れている
else if (l <= nl && r >= nr)
r... | replace | 11 | 12 | 11 | 12 | TLE | |
p03061 | C++ | Runtime Error | //
// Created by kuroneko on 2019-07-06.
//
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
ll GCD(ll a, ll b) {
if (a < b)
swap(a, b);
if (b == 0)
return a;
return GCD(b, a % b);
}
int LCM(int a, int b) {
int g =... | //
// Created by kuroneko on 2019-07-06.
//
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
ll GCD(ll a, ll b) {
if (a < b)
swap(a, b);
if (b == 0)
return a;
return GCD(b, a % b);
}
int LCM(int a, int b) {
int g =... | replace | 30 | 31 | 30 | 31 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ll n;
cin >> n;
ll a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
ll count = 0, ans;
for (int i = a[1]; i > 0; i--) {
for (int j = 0; j < n; j++) {
if (a[j] % i == 0)
count++;
}
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ll n;
cin >> n;
ll a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
ll count = 0, ans;
for (int i = a[1]; i > 0; i--) {
if (a[1] % i == 0 || a[0] % i == 0) {
for (int j = 0; j < n; j++) {
... | replace | 12 | 15 | 12 | 17 | TLE | |
p03061 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll A[10101];
ll L[10101];
ll R[10101];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> A[i];
}
L[1] = A[1];
f... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll A[101010];
ll L[101010];
ll R[101010];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> A[i];
}
L[1] = A[1];
... | replace | 8 | 11 | 8 | 11 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
while (a && b) {
(a < b) ? b %= a : a %= b;
}
return a + b;
}
int main() {
int N;
cin >> N;
vector<int> A(N);
for (auto &a : A) {
cin >> a;
}
int gcd_max = -1;
for (int ii = 0; ii < N; ii++) {
int gcd_sub = (ii == 0... | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
while (a && b) {
(a < b) ? b %= a : a %= b;
}
return a + b;
}
int main() {
int N;
cin >> N;
vector<int> A(N);
for (auto &a : A) {
cin >> a;
}
vector<int> gcd_front(N);
vector<int> gcd_back(N);
gcd_front[0] = A[0];
... | replace | 18 | 27 | 18 | 34 | TLE | |
p03061 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>... | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>... | replace | 38 | 39 | 38 | 39 | 0 | |
p03061 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int N;
vector<int> A;
int gcd(int a, int b) {
if (b > a) {
swap(a, b);
}
while (b != 0) {
int na = b;
int nb = a % b;
a = na;
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int N;
vector<int> A;
int gcd(int a, int b) {
if (b > a) {
swap(a, b);
}
while (b != 0) {
int na = b;
int nb = a % b;
a = na;
... | replace | 32 | 33 | 32 | 33 | 0 | |
p03061 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
const double EPS = 1e-10;
const ll MOD = 7 + (1e+9);
const ll INF = 1e18 + 7;
#d... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
const double EPS = 1e-10;
const ll MOD = 7 + (1e+9);
const ll INF = 1e18 + 7;
#d... | replace | 94 | 98 | 94 | 97 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.