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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p00004 | C++ | Time Limit Exceeded | /*************************************************************************
> File Name: 23.cpp
> Author: ralph
> Mail: 1694487365@qq.com
> Created Time: 2018年12月21日 星期五 21时32分48秒
************************************************************************/
#include <bits/stdc++.h>
using na... | /*************************************************************************
> File Name: 23.cpp
> Author: ralph
> Mail: 1694487365@qq.com
> Created Time: 2018年12月21日 星期五 21时32分48秒
************************************************************************/
#include <bits/stdc++.h>
using na... | replace | 11 | 19 | 11 | 15 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
while (1) {
float a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, x = 0, y = 0;
scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f);
y = (c * d - f * a) / (b * d - e * a);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
}
return 0;
} | #include <stdio.h>
int main() {
float a, b, c, d, e, f, x, y;
while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) {
y = (c * d - f * a) / (b * d - e * a);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
}
return 0;
} | replace | 3 | 6 | 3 | 6 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <algorithm>
#include <stdio.h>
using namespace std;
int main() {
double a, b, c, d, e, f, x, y;
while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f)) {
y = (c * d - f * a) / (b * d - a * e);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
}
return 0;
} | #include <algorithm>
#include <stdio.h>
using namespace std;
int main() {
double a, b, c, d, e, f, x, y;
while (scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF) {
y = (c * d - f * a) / (b * d - a * e);
x = (c - b * y) / a;
printf("%.3f %.3f\n", x, y);
}
return 0;
} | replace | 5 | 6 | 5 | 6 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <stdio.h>
using namespace std;
double a, b, c, d, e, f;
double x, y;
int main() {
while (1) {
cin >> a >> b >> c >> d >> e >> f;
y = (c - f * a / d) / (b - e * a / d);
x = -b / a * y + c / a;
printf("%.3lf %.3lf\n", x, y);
}
} | #include <algorithm>
#include <iostream>
#include <stdio.h>
using namespace std;
double a, b, c, d, e, f;
double x, y;
int main() {
while (cin >> a >> b >> c >> d >> e >> f) {
double det = a * e - b * d;
x = (c * e - b * f) / det;
y = (a * f - c * d) / det;
if (x == -0)
x = 0;
if (y == -0... | replace | 10 | 15 | 10 | 19 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <stdio.h>
int main() {
double a, b, c, d, e, f, x, y;
while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f)) {
x = ((c * e - f * b) / (a * e - d * b));
y = ((c - a * x) / b);
if (x > 0)
x += 0.0005;
else
x -= 0.0005;
if (y > 0)
x += 0.0005;
else
y = -0.0... | #include <stdio.h>
int main() {
double a, b, c, d, e, f;
while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != -1) {
printf("%.3lf %.3lf\n",
(c * e - f * b) == 0 ? 0 : (c * e - f * b) / (a * e - d * b),
(c * d - a * f) == 0 ? 0 : (c * d - a * f) / (b * d - a * e));
}
return 0;
... | replace | 2 | 15 | 2 | 7 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
for (float a, b, c, d, e, f, x, y, g, h;
std::cin.eof() || (std::cin >> a >> b >> c >> d >> e >> f, 1);
printf("%.3f %.3f\n", x, y))
g = b * d - a * e, h = c * d - a * f,
d * g ? (x = f / d - e * h / g / d,
y = b ? c / b - a * x / b : f / e - d * x /... | #include <iostream>
int main() {
for (float a, b, c, d, e, f, x, y, g, h;; printf("%.3f %.3f\n", x, y)) {
std::cin >> a >> b >> c >> d >> e >> f;
if (std::cin.eof())
break;
g = b * d - a * e;
h = c * d - a * f;
d *g ? (x = f / d - e * h / g / d,
y = b ? c / b - a * x / b : f / e ... | replace | 2 | 9 | 2 | 12 | TLE | |
p00004 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
double halfadjust(double x) {
int tmp = (x * 10000);
tmp = tmp % 10;
double ans = static_cast<double>(static_cast<int>(x * 1000));
ans = ans / 1000;
if (tmp >= 5)
ans += 0.001;
if (tmp <= -5)
ans -= 0.001;
return ans;
}
double a, b, c, d, e, f;
void solve(... | #include <iomanip>
#include <iostream>
double halfadjust(double x) {
int tmp = (x * 10000);
tmp = tmp % 10;
double ans = static_cast<double>(static_cast<int>(x * 1000));
ans = ans / 1000;
if (tmp >= 5)
ans += 0.001;
if (tmp <= -5)
ans -= 0.001;
return ans;
}
double a, b, c, d, e, f;
void solve(... | replace | 27 | 31 | 27 | 29 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main(void) {
while (... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main(void) {
ll a, b... | replace | 17 | 20 | 17 | 19 | TLE | |
p00005 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
long long int GCD(long long int a, long long int b) {
return (b % a == b) ? a : GCD(b % a, a);
}
long long int LCM(long long int a, long long int b) {
return (a / GCD(a, b)) * b;
}
int main() {
long long int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ... | #include "bits/stdc++.h"
using namespace std;
long long int GCD(long long int a, long long int b) {
return (b % a == 0) ? a : GCD(b % a, a);
}
long long int LCM(long long int a, long long int b) {
return (a / GCD(a, b)) * b;
}
int main() {
long long int a, b;
while (cin >> a >> b) {
cout << GCD(a, b) << ... | replace | 4 | 5 | 4 | 5 | 0 | |
p00005 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long int a, b, x, y, z;
while (cin >> a >> b, a, b) {
x = max(a, b);
y = min(a, b);
while (1) {
if (y == 0)
break;
z = x % y;
x = y;
y = z;
}
cout << x << ' ' << a * b / x << endl;
... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long int a, b, x, y, z;
while (cin >> a >> b) {
x = max(a, b);
y = min(a, b);
while (1) {
if (y == 0)
break;
z = x % y;
x = y;
y = z;
}
cout << x << ' ' << a * b / x << endl;
}
... | replace | 7 | 8 | 7 | 8 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
long long int a, b, t, aa, bb;
while (1) {
cin >> a;
if (a == 0)
break;
cin >> b;
aa = a;
bb = b;
while (1) {
if (b == 0)
break;
t = b;
b = a % b;
a = t;
}
cout << a << " " << aa * bb / a... | #include <iostream>
using namespace std;
int main() {
long long int a, b, t, aa, bb;
while (1) {
cin >> a;
if (cin.eof())
break;
cin >> b;
aa = a;
bb = b;
while (1) {
if (b == 0)
break;
t = b;
b = a % b;
a = t;
}
cout << a << " " << aa * bb ... | replace | 8 | 9 | 8 | 9 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cmath>
#include <cstdio>
using namespace std;
int main() {
int a, b;
while (scanf("%d%d", &a, &b) != EOF) {
int gcd;
for (int i = 2; i <= ((a < b) ? b : a); i++) {
if ((a % i == 0) && (b % i == 0))
gcd = i;
}
printf("%d %d\n", gcd, (int)((long)a * b / (long)gcd));
}
... | #include <cmath>
#include <cstdio>
using namespace std;
int main() {
int a, b;
while (scanf("%d%d", &a, &b) != EOF) {
int gcd = a, tmp_b = b;
int tmp;
while (tmp_b != 0) {
tmp = gcd % tmp_b;
gcd = tmp_b;
tmp_b = tmp;
}
printf("%d %d\n", gcd, (int)((long)a * b / (long)gcd));... | replace | 9 | 14 | 9 | 15 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int gcd(int x, int y) {
int amari;
while (y != 0) {
amari = x % y;
x = y;
y = amari;
}
return x;
}
int lcm(int x, int y) {
int g = gcd(x, y);
return x / g * y;
}
int main() {
int a, b;
while (true) {
cin >> a >> b;
cout << gcd(a, b) << ' ' ... | #include <iostream>
using namespace std;
int gcd(int x, int y) {
int amari;
while (y != 0) {
amari = x % y;
x = y;
y = amari;
}
return x;
}
int lcm(int x, int y) {
int g = gcd(x, y);
return x / g * y;
}
int main() {
int a, b;
while (true) {
cin >> a >> b;
if (std::cin.eof()) {
... | insert | 22 | 22 | 22 | 25 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b = 0) {
return a;
}
return gcd(b, a % b);
}
int main() {
while (true) {
int a, b;
cin >> a >> b;
if (cin.eof())
break;
int g = gcd(a, b);
cout << g << " " << a / g * b << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
int main() {
while (true) {
int a, b;
cin >> a >> b;
if (cin.eof())
break;
int g = gcd(a, b);
cout << g << " " << a / g * b << endl;
}
return 0;
}
| replace | 4 | 5 | 4 | 5 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <stdio.h>
using namespace std;
long long int n, m, ans, amari, ahokusa;
int main(void) {
while (1) {
scanf("%lld%lld", &n, &m);
ans = n * m;
if (n < m) {
ahokusa = n;
n = m;
m = ahokusa;
}
amari = n % m;
while (amari != 0) {
n = m;
m = amari;
amari... | #include <stdio.h>
using namespace std;
long long int n, m, ans, amari, ahokusa;
int main() {
while (scanf("%lld%lld", &n, &m) != -1) {
ans = n * m;
if (n < m) {
ahokusa = n;
n = m;
m = ahokusa;
}
amari = n % m;
while (amari != 0) {
n = m;
m = amari;
amari = n ... | replace | 4 | 7 | 4 | 6 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, c, rest;
while (1) {
cin >> a >> b;
int a2 = a, b2 = b;
if (a > b) {
c = a;
a = b;
b = c;
}
while ((rest = b % a) != 0) {
b = a;
a = rest;
}
cout << a << " " << a2 / a * b2 << endl;
}
return... | #include <iostream>
using namespace std;
int main() {
int a, b, c, rest;
while (cin >> a >> b) {
int a2 = a, b2 = b;
if (a > b) {
c = a;
a = b;
b = c;
}
while ((rest = b % a) != 0) {
b = a;
a = rest;
}
cout << a << " " << a2 / a * b2 << endl;
}
return 0;
} | replace | 4 | 6 | 4 | 5 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int a, b, a1, b1, r;
int tmp = 0;
int i = 0;
while (scanf("%d %d", &a, &b)) {
if (a < b) {
tmp = a;
a = b;
b = tmp;
}
a1 = a;
b1 = b;
r = a1 % b1;
while (r != 0) {
a1 = b1;
b1 = r;
... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int a, b, a1, b1, r;
int tmp = 0;
int i = 0;
while (cin >> a >> b) {
if (a < b) {
tmp = a;
a = b;
b = tmp;
}
a1 = a;
b1 = b;
r = a1 % b1;
while (r != 0) {
a1 = b1;
b1 = r;
r = a... | replace | 9 | 10 | 9 | 10 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int lcm(int a, int b, int ans_gcd) {
int ans;
ans = a / ans_gcd * b;
return ans;
}
int main() {
int a, b;
int ans_gcd, ans_lcm;
while (1) { // cin >> a >> b) {
... | #include <cstdio>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int lcm(int a, int b, int ans_gcd) {
int ans;
ans = a / ans_gcd * b;
return ans;
}
int main() {
int a, b;
int ans_gcd, ans_lcm;
while (cin >> a >> b) {
if ((a... | replace | 25 | 27 | 25 | 26 | TLE | |
p00005 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int x[2], k = 1, a, b;
while (cin >> x[1] >> x[2]) {
if (x[2] > x[1])
swap(x[1], x[2]);
a = x[1];
b = x[2];
while (x[3 - k] != 0) {
x[k] = x[k] % x[3 - k];
k = 3 - k;
}
cout << x[k] << " " << a / x... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int x[3], k = 1, a, b;
while (cin >> x[1] >> x[2]) {
if (x[2] > x[1])
swap(x[1], x[2]);
a = x[1];
b = x[2];
while (x[3 - k] != 0) {
x[k] = x[k] % x[3 - k];
k = 3 - k;
}
cout << x[k] << " " << a / x... | replace | 5 | 6 | 5 | 6 | -6 | *** stack smashing detected ***: terminated
|
p00005 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
if (a < b)
swap(a, b);
return gcd(b, a % b);
}
int main() {
int a, b;
while (scanf("%d %d", &a, &b), &a, &b) {
int g = gcd(a, b);
printf("%d %d\n", g, a / g * b / g * g);
}
return 0... | #include <algorithm>
#include <cstdio>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
if (a < b)
swap(a, b);
return gcd(b, a % b);
}
int main() {
int a, b;
while (scanf("%d %d", &a, &b) != EOF) {
int g = gcd(a, b);
printf("%d %d\n", g, a / g * b / g * g);
}
return 0;... | replace | 15 | 16 | 15 | 16 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f, g, l;
while (cin >> a >> b) {
c = a;
d = b;
e = a;
f = b;
while (1) {
if (a > b) {
a %= b;
if (a == 0) {
g = b;
break;
}
} else if (a < b) {
b %= a;
... | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f, g, l;
while (cin >> a >> b) {
c = a;
d = b;
e = a;
f = b;
while (1) {
if (a >= b) {
a %= b;
if (a == 0) {
g = b;
break;
}
} else if (a < b) {
b %= a;
... | replace | 11 | 12 | 11 | 12 | TLE | |
p00005 | C++ | Time Limit Exceeded |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool solve() {
int a, b;
while (cin >> a >> b) {
int lcm, gcd;
for (int i = min(a, b); i >= 1; i--) {
if (!(a ... |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
bool solve() {
int a, b;
while (cin >> a >> b) {
int lcm, gcd;
int n = min(a, b);
if (!(a % n) && !(b % n)) {
... | replace | 18 | 22 | 18 | 27 | TLE | |
p00005 | C++ | Runtime Error | #include <iostream>
using namespace std;
int gcd(int m, int n) {
if ((0 == m) || (0 == n))
return 0;
while (m != n) {
if (m > n)
m = m - n;
else
n = n - m;
}
return m;
}
int lcm(int m, int n) {
if ((0 == m) || (0 == n))
return 0;
return ((m / gcd(m, n)) * n);
}
int main() {
i... | #include <iostream>
using namespace std;
int gcd(int m, int n) {
if ((0 == m) || (0 == n))
return 0;
while (m != n) {
if (m > n)
m = m - n;
else
n = n - m;
}
return m;
}
int lcm(int m, int n) {
if ((0 == m) || (0 == n))
return 0;
return ((m / gcd(m, n)) * n);
}
int main() {
i... | replace | 22 | 26 | 22 | 25 | 1 | |
p00005 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long a, b;
while (cin >> a >> b) {
long long gcd;
long long c = max(a, b);
long long d = min(a, b);
while (true) {
if (c % d == 0) {
gcd = d;
goto C;
} else {
c -= d;
swap(c, d... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long a, b;
while (cin >> a >> b) {
long long gcd;
long long c = max(a, b);
long long d = min(a, b);
while (true) {
if (c % d == 0) {
gcd = d;
goto C;
} else {
c -= d;
if (c <= ... | replace | 15 | 16 | 15 | 18 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, i;
while (cin >> a >> b) {
for (i = a; i > 0; i--) {
if (b % i == 0 && a % i == 0) {
cout << i << " ";
break;
}
// if (i == 0)
// cout << 1 << " ";
}
if (a > b)
i = a;
else
i = b;
... | #include <iostream>
using namespace std;
int main() {
int a, b, i;
while (cin >> a >> b) {
if (a > b)
i = b;
else
i = a;
for (; i > 0; i--) {
if (b % i == 0 && a % i == 0) {
cout << i << " ";
break;
}
// if (i == 0)
// cout << 1 << " ";
}
if (... | replace | 6 | 7 | 6 | 11 | TLE | |
p00005 | C++ | Runtime Error | #include <iostream>
using namespace std;
long gcd(long a, long b) { return a % b == 0 ? b : gcd(b, b % a); }
int main() {
long a, b;
while (cin >> a >> b) {
cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;
}
} | #include <iostream>
using namespace std;
long gcd(long a, long b) {
if (a < b)
return gcd(b, a);
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
int main() {
long a, b;
while (cin >> a >> b) {
cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;
}
} | replace | 3 | 4 | 3 | 12 | 0 | |
p00005 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int a, b, fl;
while (cin >> a >> b) {
fl = 0;
for (int i = 1; fl == 0; i++) {
if (a % i == 0 && b % (a / i) == 0) {
cout << a / i << " ";
fl++;
} else
;
}
fl = 0;
for (int i = 1; fl == 0; i++) {
i... | #include <iostream>
using namespace std;
int main(void) {
int a, b, fl;
while (cin >> a >> b) {
fl = 0;
for (int i = 1; fl == 0; i++) {
if (a % i == 0 && b % (a / i) == 0) {
cout << a / i << " ";
fl++;
} else
;
}
fl = 0;
for (int i = 1; fl == 0; i++) {
i... | replace | 15 | 16 | 15 | 16 | TLE | |
p00005 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long gcd(long a, long b) { return a % b ? b : gcd(b, a % b); }
void solve(long a, long b) {
int c = gcd(a, b);
cout << c << " " << a / c * b << endl;
}
int main() {
long a, b;
while (cin >> a >> b)
solve(a, b);
} | #include <bits/stdc++.h>
using namespace std;
long gcd(long a, long b) { return a % b ? gcd(b, a % b) : b; }
void solve(long a, long b) {
int c = gcd(a, b);
cout << c << " " << a / c * b << endl;
}
int main() {
long a, b;
while (cin >> a >> b)
solve(a, b);
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p00005 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int a, b, r, G, R, L, tmp;
while (cin >> a >> b) {
R = a;
L = b;
if (b > a) {
a = tmp;
a = b;
b = tmp;
}
while (1) {
r = a % b;
if (r == 0)
break;
a = b;
b = r;
}
G = b;
R = R / G;... | #include <iostream>
using namespace std;
int main() {
int a, b, r, G, R, L, tmp;
while (cin >> a >> b) {
R = a;
L = b;
if (b > a) {
tmp = a;
a = b;
b = tmp;
}
while (1) {
r = a % b;
if (r == 0)
break;
a = b;
b = r;
}
G = b;
R = R / G;... | replace | 8 | 9 | 8 | 9 | 0 | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int gcd(int a, int b) { return b > 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
int a, b;
while (cin >> a >> b, a, b) {
cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
}
} | #include <iostream>
using namespace std;
int gcd(int a, int b) { return b > 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
int a, b;
while (cin >> a >> b) {
cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
}
} | replace | 10 | 11 | 10 | 11 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
#define CASE double
using namespace std;
int GCD(CASE x, CASE y) {
if (x == 0 || y == 0)
return x + y;
else {
if (x >= y) {
x = x - y;
GCD(x, y);
} else {
y = y - x;
GCD(x, y);
}
}
}
int main() {
CASE a, b;
unsigned long int d, l;
while (1) {
... | #include <iostream>
#define CASE double
using namespace std;
int GCD(CASE x, CASE y) {
if (x == 0 || y == 0)
return x + y;
else {
if (x >= y) {
x = x - y;
GCD(x, y);
} else {
y = y - x;
GCD(x, y);
}
}
}
int main() {
CASE a, b;
unsigned long int d, l;
while (cin >>... | replace | 23 | 26 | 23 | 25 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
using namespace std;
long long a, b;
long long gcd(long long x, long long y) {
if (b == 0)
return x;
else
return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return (x * y) / gcd(x, y); }
int main() {
while (cin >> a >> b) {
cout << gcd(a, b) << " ... | #include <cmath>
#include <iostream>
using namespace std;
long long a, b;
long long gcd(long long x, long long y) {
if (y == 0)
return x;
else
return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return (x * y) / gcd(x, y); }
int main() {
while (cin >> a >> b) {
cout << gcd(a, b) << " ... | replace | 7 | 8 | 7 | 8 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cstdio>
using namespace std;
int gcdr(int a, int b) {
if (b == 0)
return a;
return gcdr(b, a % b);
}
int main() {
int a, b, gcd;
long int lcm;
while (true) {
scanf("%d%d", &a, &b);
gcd = gcdr(a, b);
// printf("%d\n",gcd);
lcm = (long)a * b / gcd;
printf("%d %ld\n", gcd, lc... | #include <cstdio>
using namespace std;
int gcdr(int a, int b) {
if (b == 0)
return a;
return gcdr(b, a % b);
}
int main() {
int a, b, gcd;
long int lcm;
while (scanf("%d%d", &a, &b) != EOF) {
gcd = gcdr(a, b);
// printf("%d\n",gcd);
lcm = (long)a * b / gcd;
printf("%d %ld\n", gcd, lcm);... | replace | 13 | 15 | 13 | 14 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int p, q;
int a, b, c;
int lcm, gcd;
while (1) {
cin >> p >> q;
if (cin.eof())
break;
if (p > q) {
a = p;
b = q;
} else {
b = p;
a = q;
}
while (a % b) {
c = a - b;
a = b;
b = c;
... | #include <iostream>
using namespace std;
int main() {
int p, q;
int a, b, c;
int lcm, gcd;
while (1) {
cin >> p >> q;
if (cin.eof())
break;
if (p > q) {
a = p;
b = q;
} else {
b = p;
a = q;
}
while (a % b) {
c = a % b;
a = b;
b = c;
... | replace | 21 | 22 | 21 | 22 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <cstdio>
int main() {
unsigned long a, b;
while (scanf("%lu %lu", &a, &b)) {
unsigned long max = (a > b) ? a : b, min = (a < b) ? a : b;
while (min) {
int r = max % min;
max = min;
min = r;
}
unsigned long lcm = a * b / max;
printf("%lu %lu\n", max, lcm);
}
retu... | #include <cstdio>
int main() {
unsigned long a, b;
while (scanf("%lu %lu", &a, &b) != EOF) {
unsigned long max = (a > b) ? a : b, min = (a < b) ? a : b;
while (min) {
int r = max % min;
max = min;
min = r;
}
unsigned long lcm = a * b / max;
printf("%lu %lu\n", max, lcm);
}
... | replace | 5 | 6 | 5 | 6 | TLE | |
p00005 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
int main() {
int a, b;
while (scanf("%d%d", &a, &b))
printf("%d %d\n", std::__gcd(a, b), std::__gcd(a, b) * b);
return 0;
}
| #include <algorithm>
#include <cstdio>
int main() {
int a, b;
while (2 == scanf("%d%d", &a, &b))
printf("%d %d\n", std::__gcd(a, b), a / std::__gcd(a, b) * b);
return 0;
} | replace | 4 | 6 | 4 | 6 | TLE | |
p00006 | C++ | Time Limit Exceeded | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
int i = 0, j = str.size() - 1;
while (i < j) {
char tmp;
tmp = str[i];
str[i] = str[j];
str[j] = tmp;
}
cout << str << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
int i = 0, j = str.size() - 1;
while (i < j) {
char tmp;
tmp = str[i];
str[i] = str[j];
str[j] = tmp;
++i;
--j;
}
cout << str << endl;
return 0;
} | insert | 14 | 14 | 14 | 16 | TLE | |
p00006 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;
... | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;
... | replace | 32 | 33 | 32 | 33 | -11 | |
p00006 | C++ | Runtime Error | #include <stdio.h>
int main() {
char str[20];
int i, j;
scanf("%s", str);
for (i = 0; str[i] != '\0'; i++) {
}
for (j = i - 1; j > -1; j--) {
printf("%c", str[j]);
}
puts("");
return 0;
} | #include <stdio.h>
int main() {
char str[21];
int i, j;
scanf("%s", str);
for (i = 0; str[i] != '\0'; i++) {
}
for (j = i - 1; j > -1; j--) {
printf("%c", str[j]);
}
puts("");
return 0;
} | replace | 2 | 3 | 2 | 3 | 0 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i++) {
cout << str[i];
}
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i--) {
cout << str[i];
}
cout << endl;
return 0;
} | replace | 9 | 10 | 9 | 10 | -11 | |
p00006 | Python | Runtime Error | print(input[::-1])
| print(input()[::-1])
| replace | 0 | 1 | 0 | 1 | TypeError: 'builtin_function_or_method' object is not subscriptable | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00006/Python/s441661847.py", line 1, in <module>
print(input[::-1])
TypeError: 'builtin_function_or_method' object is not subscriptable
|
p00006 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int main(void) {
char str[20];
scanf("%s", str);
for (int i = strlen(str) - 1; i > 0; i--)
printf("%s", str[i - 1]);
printf("\n");
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char str[20];
scanf("%s", str);
for (int i = strlen(str) - 1; i >= 0; i--) {
printf("%c", str[i]);
}
printf("\n");
return 0;
} | replace | 6 | 8 | 6 | 9 | -11 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (size_t i = str.size() - 1; i >= 0; --i) {
cout << str[i];
}
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (size_t i = str.size() - 1; i >= 0; --i) {
if (i == -1)
break;
cout << str[i];
}
cout << endl;
return 0;
} | insert | 8 | 8 | 8 | 10 | -11 | |
p00006 | C++ | Time Limit Exceeded | #include <iostream>
#include <math.h>
#include <string>
#include <vector>
int main(void);
std::string rev_string(std::string str);
int main() {
std::string str = "";
// char str[20];
std::cin >> str;
std::cout << rev_string(str) << std::endl;
while (1)
;
return 0;
}
//*
std::string rev_string(std::s... | #include <iostream>
#include <math.h>
#include <string>
#include <vector>
int main(void);
std::string rev_string(std::string str);
int main() {
std::string str = "";
// char str[20];
std::cin >> str;
std::cout << rev_string(str) << std::endl;
// while (1);
return 0;
}
//*
std::string rev_string(std::str... | replace | 14 | 16 | 14 | 15 | TLE | |
p00006 | C++ | Runtime Error | #include <cstring>
#include <iostream>
using namespace std;
int main() {
char in[20], out[20];
cin >> in;
int len = strlen(in);
for (int i = 0; i < len; i++) {
out[len - i - 1] = in[i];
}
out[len] = 0;
cout << out << endl;
return 0;
} | #include <cstring>
#include <iostream>
using namespace std;
int main() {
char in[21], out[21];
cin >> in;
int len = strlen(in);
for (int i = 0; i < len; i++) {
out[len - i - 1] = in[i];
}
out[len] = 0;
cout << out << endl;
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p00006 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define FOR(I, F, N) for (int I = F; I < (int... | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define FOR(I, F, N) for (int I = F; I < (int... | replace | 31 | 32 | 31 | 32 | -11 | |
p00006 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char str[20];
scanf("%s", str);
int len = strlen(str);
for (int i = len - 1; i >= 0; i--) {
printf("%c", str[i]);
}
printf("\n");
return 0;
}
| #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char str[21];
scanf("%s", str);
int len = strlen(str);
for (int i = len - 1; i >= 0; i--) {
printf("%c", str[i]);
}
printf("\n");
return 0;
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p00006 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
string str;
cin >> str;
int l = str.size();
for (int i = l; i >= 0; i++) {
cout << str[i];
}
cout << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
string str;
cin >> str;
int l = str.size();
for (int i = l; i > 0; i--) {
cout << str[i - 1];
}
cout << endl;
return 0;
} | replace | 7 | 9 | 7 | 9 | -11 | |
p00006 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
string x;
int i;
cin >> x;
for (i = x.size();; i--) {
cout << x[i];
}
cout << endl;
return 0;
} | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
string x;
int i;
cin >> x;
for (i = x.size(); i--;) {
cout << x[i];
}
cout << endl;
return 0;
} | replace | 9 | 10 | 9 | 10 | -11 | |
p00006 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
int n = str.size();
for (int i = n - 1; i >= 0; i++) {
cout << str[i];
}
cout << endl;
} | #include <iostream>
using namespace std;
int main() {
string str;
cin >> str;
int n = str.size();
for (int i = n - 1; i >= 0; i--) {
cout << str[i];
}
cout << endl;
} | replace | 6 | 7 | 6 | 7 | -11 | |
p00006 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
int main(void) {
char str[20], reversed_str[20];
scanf("%s", str);
int len = strlen(str);
int i;
for (i = 0; i < len; ++i) {
reversed_str[i] = str[len - 1 - i];
}
reversed_str[len] = '\0';
printf("%s\n", reversed_str);
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char str[21], reversed_str[21];
scanf("%s", str);
int len = strlen(str);
int i;
for (i = 0; i < len; ++i) {
reversed_str[i] = str[len - 1 - i];
}
reversed_str[len] = '\0';
printf("%s\n", reversed_str);
return 0;
} | replace | 4 | 5 | 4 | 5 | 0 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
string s;
int main() {
cin >> s;
for (unsigned i = s.size() - 1; i >= 0; i--)
cout << s[i];
return 0;
} | #include <iostream>
#include <string>
using namespace std;
string s;
int main() {
cin >> s;
for (string::reverse_iterator it = s.rbegin(); it != s.rend(); it++)
cout << *it;
cout << endl;
return 0;
} | replace | 6 | 8 | 6 | 9 | -11 | |
p00006 | C++ | Runtime Error | #include <stdio.h>
int main() {
int n = 0;
char a[1000];
for (int i = 0; i < 1000; i++)
a[i] = '\0';
scanf("%s", a);
while (a[n] != '\0')
n++;
for (int i = n - 1; i >= 0; i++)
printf("%c", a[i]);
printf("\n");
} | #include <stdio.h>
int main() {
int n = 0;
char a[1000];
for (int i = 0; i < 1000; i++)
a[i] = '\0';
scanf("%s", a);
while (a[n] != '\0')
n++;
for (int i = n - 1; i >= 0; i--)
printf("%c", a[i]);
printf("\n");
} | replace | 9 | 10 | 9 | 10 | -11 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
char a;
string str;
cin >> str;
for (int i = 0; i != str.size() - 1 - i; i++) {
a = str[i];
str[i] = str[str.size() - 1 - i];
str[str.size() - 1 - i] = a;
}
cout << str << endl;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
char a;
string str;
cin >> str;
for (int i = 0; i < str.size() - 1 - i; i++) {
a = str[i];
str[i] = str[str.size() - 1 - i];
str[str.size() - 1 - i] = a;
}
cout << str << endl;
} | replace | 7 | 8 | 7 | 8 | -11 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s.size() <= 20) {
for (int i = s.size();; i--) {
cout << s[i];
}
cout << endl;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
if (s.size() <= 20) {
for (int i = s.size(); i--;) {
cout << s[i];
}
cout << endl;
}
return 0;
} | replace | 7 | 8 | 7 | 8 | -11 | |
p00006 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i >= 0; ++i)
cout << s[i];
cout << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.size() - 1; i >= 0; --i)
cout << s[i];
cout << endl;
}
| replace | 9 | 10 | 9 | 10 | -11 | |
p00006 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i++)
cout << str[i];
cout << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = str.size() - 1; i >= 0; i--)
cout << str[i];
cout << endl;
return 0;
} | replace | 8 | 9 | 8 | 9 | -11 | |
p00007 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
while (1) {
int m = 100000;
while (n--) {
m = ceil(m * 1.05 / 1000) * 1000;
}
cout << m << endl;
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
int m = 100000;
while (n--) {
m = ceil(m * 1.05 / 1000) * 1000;
}
cout << m << endl;
}
return 0;
} | replace | 8 | 9 | 8 | 9 | TLE | |
p00007 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n, debt = 100000;
cin >> n;
while (n--) {
debt = debt * 1.05;
debt += 999;
debt /= 1000;
debt *= 1000;
}
cout << debt << endl;
while (1)
;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n, debt = 100000;
cin >> n;
while (n--) {
debt = debt * 1.05;
debt += 999;
debt /= 1000;
debt *= 1000;
}
cout << debt << endl;
return 0;
} | delete | 14 | 16 | 14 | 14 | TLE | |
p00007 | Python | Runtime Error | import math
r = 100
n = input()
for i in range(n):
r = math.ceil(r * 1.05)
print(r * 1000)
| import math
r = 100
n = int(input())
for i in range(n):
r = math.ceil(r * 1.05)
print(r * 1000)
| replace | 3 | 4 | 3 | 4 | TypeError: 'str' object cannot be interpreted as an integer | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00007/Python/s183798433.py", line 5, in <module>
for i in range(n):
TypeError: 'str' object cannot be interpreted as an integer
|
p00008 | C++ | Time Limit Exceeded | #include <iostream>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
using namespace std;
int main() {
int n;
while (cin >> n, n) {
int co = 0;
rep(a, 10) {
rep(b, 10) {
rep(c, 10) {
if (n - a - b - c >= 0 && n - a - b - c < 10)
co++;
... | #include <iostream>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
using namespace std;
int main() {
int n;
while (cin >> n) {
int co = 0;
rep(a, 10) {
rep(b, 10) {
rep(c, 10) {
if (n - a - b - c >= 0 && n - a - b - c < 10)
co++;
... | replace | 6 | 7 | 6 | 7 | TLE | |
p00008 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
int val;
while (cin >> val)
cerr << val << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int n, a[4], count;
while (cin >> n) {
count = 0;
for (a[0] = 0; a[0] < 10; a[0]++)
for (a[1] = 0; a[1] < 10; a[1]++)
for (a[2] = 0; a[2] < 10; a[2]++)
for (a[3] = 0; a[3] < 10; a[3]++)
if (a[0] + a[1] + a[2] + ... | replace | 5 | 8 | 5 | 19 | 0 | 35
1
|
p00008 | C++ | Time Limit Exceeded | #include <iostream>
#define rep(i, a) for (int i = 0; i < a; ++i)
using namespace std;
int main(void) {
int n;
int a[4];
while (cin >> n, n) {
int count = 0;
rep(i, 10) {
rep(j, 10) {
rep(c, 10) {
rep(d, 10) {
if (i + j + c + d == n)
++count;
}... | #include <iostream>
#define rep(i, a) for (int i = 0; i < a; ++i)
using namespace std;
int main(void) {
int n;
while (cin >> n) {
int a[4] = {};
int count = 0;
rep(i, 10) {
rep(j, 10) {
rep(c, 10) {
rep(d, 10) {
if (i + j + c + d == n)
++count;
... | replace | 7 | 9 | 7 | 9 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int countSolve(int a, int b, int n);
void solve(int n);
int main() {
int n;
while (1) {
cin >> n;
solve(n);
}
return 0;
}
int countSolve(int a, int b, int n) {
int x = n - a - b;
int count = 0, i = 0, j = 0;
for (i = 0; i < 10; i++) {
for (j = 0; j <... | #include <iostream>
using namespace std;
int countSolve(int a, int b, int n);
void solve(int n);
int main() {
int n;
while (1) {
cin >> n;
if (cin.eof())
break;
solve(n);
}
return 0;
}
int countSolve(int a, int b, int n) {
int x = n - a - b;
int count = 0, i = 0, j = 0;
for (i = 0; i ... | insert | 10 | 10 | 10 | 12 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int combination(int n) {
int temp = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 10; k++)
if ((n - i - j - k) >= 0 && (n - i - j - k) < 10)
temp++;
return temp;
}
int main() {
int n;
while (1) {
cin ... | #include <iostream>
using namespace std;
int combination(int n) {
int temp = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 10; k++)
if ((n - i - j - k) >= 0 && (n - i - j - k) < 10)
temp++;
return temp;
}
int main() {
int n;
while (cin >> n) {
... | replace | 15 | 17 | 15 | 16 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <cstdio>
// #include<cmath>
// #include<iostream>
using namespace std;
int main() {
int n, i, a, b, c, d;
while (scanf("%d", &n)) {
for (i = 0, a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + d... | #include <cstdio>
// #include<cmath>
// #include<iostream>
using namespace std;
int main() {
int n, i, a, b, c, d;
while (~scanf("%d", &n)) {
for (i = 0, a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + ... | replace | 8 | 9 | 8 | 9 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
int cnt = 0;
for (int i = 0; i = 10; i++) {
for (int j = 0; j = 10; j++) {
for (int k = 0; k = 10; k++) {
if (0 <= n - i - j - k && n - i - j - k < 10)
cnt++;
}
}
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
int cnt = 0;
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
for (int k = 0; k < 10; k++) {
if (0 <= n - i - j - k && n - i - j - k < 10)
cnt++;
}
}
}
... | replace | 6 | 9 | 6 | 9 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main(void) {
int n = 0;
while (true) {
n = 0;
cin >> n;
int num = 0;
for (int a = 0; a < 10; a++) {
for (int b = 0; b < 10; b++) {
for (int c = 0; c < 10; c++) {
for (int d = 0; d < 10; d++) {
if (a + b + c + d == n)... | #include <iostream>
using namespace std;
int main(void) {
int n, i = 0;
while (cin >> n) {
int num = 0;
for (int a = 0; a < 10; a++) {
for (int b = 0; b < 10; b++) {
for (int c = 0; c < 10; c++) {
for (int d = 0; d < 10; d++) {
if (a + b + c + d == n)
num+... | replace | 5 | 10 | 5 | 7 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n, count;
while (cin >> n, n) {
count = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 10; k++)
for (int l = 0; l < 10; l++)
if (i + j + k + l == n)
count++;
cou... | #include <iostream>
using namespace std;
int main() {
int n, count;
while (cin >> n && n) {
count = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 10; k++)
for (int l = 0; l < 10; l++)
if (i + j + k + l == n)
count++;
c... | replace | 5 | 6 | 5 | 6 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
int n;
while (std::cin >> n) {
int count = 0;
for (int a = 0; a < 10; ++a) {
for (int b = 0; a < 10; ++b) {
for (int c = 0; a < 10; ++c) {
for (int d = 0; a < 10; ++d) {
if (a + b + c + d == n) {
++count;
}
... | #include <iostream>
int main() {
int n;
while (std::cin >> n) {
int count = 0;
for (int a = 0; a < 10; ++a) {
for (int b = 0; b < 10; ++b) {
for (int c = 0; c < 10; ++c) {
for (int d = 0; d < 10; ++d) {
if (a + b + c + d == n) {
++count;
}
... | replace | 8 | 11 | 8 | 11 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
int main(void) {
int n, count = 0;
while (1) {
scanf("%d", &n);
if (n == EOF)
break;
for (size_t a = 0; a <= 9; a++) {
for (size_t b = 0; b <= 9; b++) {
for (size_t c = 0; c <= 9; c++) {
for (size_t d = 0; d <= 9; d++) {
if... | #include <stdio.h>
#include <string.h>
int main(void) {
int n, count = 0;
while (scanf("%d", &n) != EOF) {
for (size_t a = 0; a <= 9; a++) {
for (size_t b = 0; b <= 9; b++) {
for (size_t c = 0; c <= 9; c++) {
for (size_t d = 0; d <= 9; d++) {
if (a + b + c + d == n) {
... | replace | 4 | 8 | 4 | 5 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a = 0, b = 0, c = 0, d = 0, e = 0, n, count;
while (1) {
cin >> n;
do {
if ((a + b + c + d) == n) {
count++;
}
if (a == 9 && b == 9 && c == 9 && d == 9) {
e = 1;
}
else if (b == 9 && c == 9 && d == 9) ... | #include <iostream>
using namespace std;
int main() {
int a = 0, b = 0, c = 0, d = 0, e = 0, n, count;
for (int i = 1; i <= 50; i++) {
cin >> n;
do {
if ((a + b + c + d) == n) {
count++;
}
if (a == 9 && b == 9 && c == 9 && d == 9) {
e = 1;
}
else if (b == 9 &... | replace | 6 | 7 | 6 | 7 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define llong long long
int n;
int ans;
bool memo[1001];
void solve(int num, int sum, int d) {
if (d == 4) {
if (sum == num) {
ans++;
}
return;
}
if (num < sum)
return;
for (int i = 0; i <= 9; i++) {
solve(num, sum + i, d + 1);
}
r... | #include <bits/stdc++.h>
using namespace std;
#define llong long long
int n;
int ans;
bool memo[1001];
void solve(int num, int sum, int d) {
if (d == 4) {
if (sum == num) {
ans++;
}
return;
}
if (num < sum)
return;
for (int i = 0; i <= 9; i++) {
solve(num, sum + i, d + 1);
}
r... | replace | 27 | 28 | 27 | 28 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
int n = 0;
while (scanf("%d", &n) && n != EOF) {
int ans = 0;
for (int i = 0; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9; k++) {
for (int l = 0; l <= 9; l++) {
if (n ... | #include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
int n = 0;
while (scanf("%d", &n) != EOF) {
int ans = 0;
for (int i = 0; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9; k++) {
for (int l = 0; l <= 9; l++) {
if (n == i ... | replace | 8 | 9 | 8 | 9 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
int main() {
int n, a, b, c, d, count;
while (scanf("%d", &n)) {
count = 0;
for (a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + d == n)
count = co... | #include <iostream>
#include <stdio.h>
int main() {
int n, a, b, c, d, count;
while (scanf("%d", &n) == 1) {
count = 0;
for (a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + d == n)
count... | replace | 5 | 6 | 5 | 6 | TLE | |
p00008 | C++ | Time Limit Exceeded | // ↓template↓
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n) n.begin(), n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}, alp[30];
long long fac[200005], finv[2... | // ↓template↓
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n) n.begin(), n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}, alp[30];
long long fac[200005], finv[2... | replace | 44 | 45 | 44 | 45 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int dp[40];
int main() {
for (int i = 0; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9; k++) {
for (int l = 0; l <= 9; l++) {
dp[i + j + k + l]++;
}
}
}
}
while (true) {
int n;
cin >> n;
if (n... | #include <iostream>
using namespace std;
int dp[40];
int main() {
for (int i = 0; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9; k++) {
for (int l = 0; l <= 9; l++) {
dp[i + j + k + l]++;
}
}
}
}
int n;
while (cin >> n) {
if (n == 0) {
... | replace | 13 | 16 | 13 | 15 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, n, e = 0;
for (;;) {
cin >> n;
for (a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + d == n)
e++;
}
... | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, n, e;
while (cin >> n) {
e = 0;
for (a = 0; a < 10; a++) {
for (b = 0; b < 10; b++) {
for (c = 0; c < 10; c++) {
for (d = 0; d < 10; d++) {
if (a + b + c + d == n)
e++;
}
... | replace | 4 | 7 | 4 | 7 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int n;
int d[4][61];
int main(void) {
for (int i = 0; i <= 9; i++)
d[0][i]++;
for (int i = 0; i < 3; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9 * (i + 2); k++) {
d[i + 1][k + j] += d[i][k];
}
}
}
while (cin >> n, n) ... | #include <iostream>
using namespace std;
int n;
int d[4][61];
int main(void) {
for (int i = 0; i <= 9; i++)
d[0][i]++;
for (int i = 0; i < 3; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k <= 9 * (i + 2); k++) {
d[i + 1][k + j] += d[i][k];
}
}
}
while (cin >> n, !ci... | replace | 19 | 20 | 19 | 20 | TLE | |
p00008 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, counter = 0;
while (scanf("%d", n) == -1) {
for (int a = ... | #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, counter = 0;
while (scanf("%d", &n) != -1) {
counter = 0;... | replace | 15 | 16 | 15 | 17 | -11 | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n, g, ans = 0;
while (1) {
cin >> n;
for (int a = 0; a <= 9; a++) {
for (int b = 0; b <= 9; b++) {
for (int c = 0; c <= 9; c++) {
for (int d = 0; d <= 9; d++) {
g = a + b + c + d;
if (g == n)
... | #include <iostream>
using namespace std;
int main() {
int n, g, ans = 0;
while (cin >> n) {
for (int a = 0; a <= 9; a++) {
for (int b = 0; b <= 9; b++) {
for (int c = 0; c <= 9; c++) {
for (int d = 0; d <= 9; d++) {
g = a + b + c + d;
if (g == n)
ans... | replace | 4 | 6 | 4 | 5 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
int func(int n) {
int count = 0;
for (int a = 0; a <= 9; a++) {
for (int b = 0; b <= 9; b++) {
for (int c = 0; c <= 9; c++) {
for (int d = 0; d <= 9; d++) {
if (a + b + c + d == n) {
count++;
}
}
}
}
}
return count;
}
in... | #include <iostream>
int func(int n) {
int count = 0;
for (int a = 0; a <= 9; a++) {
for (int b = 0; b <= 9; b++) {
for (int c = 0; c <= 9; c++) {
for (int d = 0; d <= 9; d++) {
if (a + b + c + d == n) {
count++;
}
}
}
}
}
return count;
}
in... | replace | 23 | 27 | 23 | 25 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
int dp[2][51];
int main() {
while (1) {
int n;
if (0 == scanf("%d", &n)) {
break;
}
int now = 0;
for (int i = 0; i <= 50; i++) {
dp[now][i] = 0;
}
dp[now][0] = 1;
for (int k = 0; k < 4; k++) {
int nex = (now + 1) % 2;
for... | #include <stdio.h>
#include <string.h>
int dp[2][51];
int main() {
while (1) {
int n;
if (EOF == scanf("%d", &n)) {
break;
}
int now = 0;
for (int i = 0; i <= 50; i++) {
dp[now][i] = 0;
}
dp[now][0] = 1;
for (int k = 0; k < 4; k++) {
int nex = (now + 1) % 2;
f... | replace | 8 | 9 | 8 | 9 | TLE | |
p00008 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
template <class T> int streamvar(std::istream &in, T &var) {
if (!in) {
cerr << "invalid istream" << endl;
return 1;
}
in >> var;
if... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
template <class T> int streamvar(std::istream &in, T &var) {
if (!in) {
cerr << "invalid istream" << endl;
return 1;
}
in >> var;
if... | replace | 17 | 18 | 17 | 18 | 0 | no var
|
p00008 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int cnt;
while (1) {
int num;
cin >> num;
cnt = 0;
for (int a = 0; a < 10; a++) {
for (int b = 0; b < 10; b++) {
for (int c = 0; c < 10; c++) {
for (int d = 0; d < 10; d++) {
if (a + b + c + ... | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int cnt;
int num;
while (cin >> num) {
cnt = 0;
for (int a = 0; a < 10; a++) {
for (int b = 0; b < 10; b++) {
for (int c = 0; c < 10; c++) {
for (int d = 0; d < 10; d++) {
if (a + b + c + d == num)... | replace | 6 | 9 | 6 | 8 | TLE | |
p00008 | C++ | Time Limit Exceeded |
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
int cnt = 0;
for (int i = 0; i <= 9; ++i)
for (int j = 0; i <= 9; ++j)
for (int k = 0; k <= 9; ++k)
for (int l = 0; l <= 9; ++l)
if (i + j + k + l == n)
++cnt;
cout << cnt... |
#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
int cnt = 0;
for (int i = 0; i <= 9; ++i)
for (int j = 0; j <= 9; ++j)
for (int k = 0; k <= 9; ++k)
for (int l = 0; l <= 9; ++l)
if (i + j + k + l == n)
++cnt;
cout << cnt... | replace | 10 | 11 | 10 | 11 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c, d, n, x, sum = 0;
for (;;) {
cin >> x;
for (a = 0; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
n = a + b + c + d;
if (x ... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c, d, n, x, sum = 0, i;
for (i = 0; i < 50; i++) {
cin >> x;
for (a = 0; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
n = a + b + c + d;... | replace | 4 | 6 | 4 | 6 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main(void) {
int dp[50][4];
for (int i = 0; i < 50; i++) {
for (int j = 0; i < 4; j++) {
if (i < 10 && j == 0)
dp[i][j] = 1;
else
dp[i][j] = 0;
}
}
for (int i = 1; i < 4; i++) {
for (int j = 0; j < 10; j++) {
for (int k... | #include <iostream>
using namespace std;
int main(void) {
int c;
while (cin >> c) {
int cnt = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 10; k++)
for (int l = 0; l < 10; l++)
if (i + j + k + l == c)
cnt++;
cout << c... | replace | 4 | 27 | 4 | 14 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << #x << ": " << x << endl;
#define line() cerr << "---------------" << endl;
int main() {
while (1) {
int n;
cin >> n;
int cnt = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
for ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << #x << ": " << x << endl;
#define line() cerr << "---------------" << endl;
int main() {
int n;
while (scanf("%d", &n) != EOF) {
int cnt = 0;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
... | replace | 8 | 12 | 8 | 10 | TLE | |
p00008 | C++ | Time Limit Exceeded | #include <stdio.h>
int main(void) {
int num, cnt = 0;
int i, j, k, l;
while (scanf("%d", &num)) {
for (i = 0; i < 10; i++) {
for (j = 0; j < 10; j++) {
for (k = 0; k < 10; k++) {
for (l = 0; l < 10; l++) {
if (i + j + k + l == num) {
cnt++;
}
... | #include <stdio.h>
int main(void) {
int num, cnt = 0;
int i, j, k, l;
while (scanf("%d", &num) != EOF) {
for (i = 0; i < 10; i++) {
for (j = 0; j < 10; j++) {
for (k = 0; k < 10; k++) {
for (l = 0; l < 10; l++) {
if (i + j + k + l == num) {
cnt++;
... | replace | 6 | 7 | 6 | 7 | TLE | |
p00009 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
std::vector<std::size_t> prime_table = {2};
void make_prime_table() {
std::set<std::size_t> undefined_table;
for (std::size_t i = 3; i <= 999999; ++i) {
undefined_table.insert(i);
}
const std::size... | #include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
std::vector<std::size_t> prime_table = {2};
void make_prime_table() {
std::set<std::size_t> undefined_table;
for (std::size_t i = 3; i <= 999999; i += 2) {
undefined_table.insert(i);
}
const std::s... | replace | 11 | 12 | 11 | 12 | TLE | |
p00009 | C++ | Memory Limit Exceeded | #include <iostream>
using namespace std;
//??¨??????????????????????????§?´???°??¨?????????
//?´???°??¨??¨?´???????????????£?????????????????§??¨????????????
const int MAX_V = 10000000;
int prime[MAX_V + 1]; //?´???°??¨
int sum[MAX_V + 1]; //?´???°?????°???????¨?
int main() {
int i, k, v;
prime[0] = prime[1] =... | #include <iostream>
using namespace std;
//??¨??????????????????????????§?´???°??¨?????????
//?´???°??¨??¨?´???????????????£?????????????????§??¨????????????
const int MAX_V = 999999;
int prime[MAX_V + 1]; //?´???°??¨
int sum[MAX_V + 1]; //?´???°?????°???????¨?
int main() {
int i, k, v;
prime[0] = prime[1] = 0... | replace | 6 | 7 | 6 | 7 | MLE | |
p00009 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXI... | #include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXI... | replace | 26 | 27 | 26 | 27 | 0 | |
p00009 | C++ | Runtime Error | #include <iostream>
#include <vector>
#define MAX 100000
using namespace std;
int main() {
// bool num[MAX];
pair<bool, int> num[MAX];
int input = 0;
while (cin >> input) {
int count = 0;
for (int i = 2; i < MAX; i++) {
num[i].first = true;
num[i].second = i;
}
for (int i = 2; i < i... | #include <iostream>
#include <vector>
#define MAX 1000000
using namespace std;
int main() {
// bool num[MAX];
pair<bool, int> num[MAX];
int input = 0;
while (cin >> input) {
int count = 0;
for (int i = 2; i < MAX; i++) {
num[i].first = true;
num[i].second = i;
}
for (int i = 2; i < ... | replace | 2 | 3 | 2 | 3 | 0 | |
p00009 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
int N;
bool is_prime[1000000];
is_prime[0] = 0;
is_prime[1] = 0;
for (int i = 2; i < 1000000; i++) {
is_prime[i] = 1;
}
for (int s = 2; s < 1000000; s++) {
if (is_prime[s] == 1) {
for (long long i = s * s; i < 1000000; i += s) {
... | #include <iostream>
using namespace std;
int main() {
int N;
bool is_prime[1000000];
is_prime[0] = 0;
is_prime[1] = 0;
for (int i = 2; i < 1000000; i++) {
is_prime[i] = 1;
}
for (long s = 2; s < 1000000; s++) {
if (is_prime[s] == 1) {
for (long long i = s * s; i < 1000000; i += s) {
... | replace | 12 | 13 | 12 | 13 | -11 | |
p00009 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
bool a[1000000];
a[0] = a[1] = false;
for (int i = 2; i < 1000000; i++) {
a[i] = true;
}
for (int i = 2; i * i < 1000000; i++) {
if (a[i]) {
for (int j = i * i; j < 10000000; j += i) {
a[j] = false;
}
}
}
int n[10000... | #include <iostream>
using namespace std;
int main() {
bool a[1000000];
a[0] = a[1] = false;
for (int i = 2; i < 1000000; i++) {
a[i] = true;
}
for (int i = 2; i * i < 1000000; i++) {
if (a[i]) {
for (int j = i * i; j < 1000000; j += i) {
a[j] = false;
}
}
}
int n[100000... | replace | 13 | 14 | 13 | 14 | -11 | |
p00009 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#inclu... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#inclu... | replace | 66 | 67 | 66 | 67 | 0 | |
p00009 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> p;
int n;
p.push_back(2);
for (int i = 3; i < 999999; i++) {
for (int j = 0;; j++) {
if (i % p[j] == 0)
break;
if (i < p[j] * p[j]) {
p.push_back(i);
break;
}
}
}
while (cin... | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> p;
int n;
p.push_back(2);
for (int i = 3; i < 999999; i++) {
for (int j = 0;; j++) {
if (i % p[j] == 0)
break;
if (i < p[j] * p[j]) {
p.push_back(i);
break;
}
}
}
p.push_bac... | insert | 18 | 18 | 18 | 19 | 0 | |
p00009 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int f[1000001];
int main() {
fill_n(f, 1000001, 1);
f[0] = f[1] = 0;
for (int i = 2; i < 1000001; i++) {
f[i] += f[i - 1];
if (!f[i])
continue;
for (int j = i + i; j < 1000001; j += i)
f[j] = 0;
}
int N;
while (scanf("%d", &N), &N) {
... | #include <bits/stdc++.h>
using namespace std;
int f[1000001];
int main() {
fill_n(f, 1000001, 1);
f[0] = f[1] = 0;
for (int i = 2; i < 1000001; i++) {
f[i] += f[i - 1];
if (!f[i])
continue;
for (int j = i + i; j < 1000001; j += i)
f[j] = 0;
}
int N;
while (scanf("%d", &N) != EOF)... | replace | 18 | 19 | 18 | 19 | TLE | |
p00009 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 1e6 + 7;
int prime[maxn];
bool is_prime[maxn];
int n, p = -1;
void Eular() {
for (int i = 1; i <= maxn - 7; i++)
is_prime[i] = true;
for (int i = 2; i <= maxn - 7; i++) {
if (is_prime[i])
prime[++p] = i;
for (int j = 0; j... | #include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 1e6 + 7;
int prime[maxn];
bool is_prime[maxn];
int n, p = -1;
void Eular() {
for (int i = 1; i <= maxn - 7; i++)
is_prime[i] = true;
for (int i = 2; i <= maxn - 7; i++) {
if (is_prime[i])
prime[++p] = i;
for (int j = 0; j... | replace | 23 | 24 | 23 | 24 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.