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
p03186
C++
Time Limit Exceeded
/*#include<iostream> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<cstdio> #include<deque> #include<fstream> #include<iomanip> #include<map> #include <numeric>*/ #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define ok1 printf("ok1\n"); #define ok2 pr...
/*#include<iostream> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<cstdio> #include<deque> #include<fstream> #include<iomanip> #include<map> #include <numeric>*/ #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define ok1 printf("ok1\n"); #define ok2 pr...
replace
46
61
46
52
TLE
p03186
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <util...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <util...
replace
115
133
115
117
TLE
p03186
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int cnt = 0; bool stomach = true; while (1) { if (stomach) { if (c > 0) { c--; cnt++; stomach = false; } } if (a == 0 && b == 0) break; if (b > 0) { b--; ...
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if (a + b + 1 >= c) cout << b + c << endl; else cout << (a + b + 1) + b << endl; } // 解説参考.
replace
7
34
7
12
TLE
p03186
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int eat = 0; bool poison = false; int cookies(int a, int b, int c) { if (poison) { if (b > 0) { b--; eat++; poison = false; cookies(a, b, c); } else if (a > 0) { a--; poison = false; cookies(a, b, c); } } else if (...
#include <bits/stdc++.h> using namespace std; int eat = 0; bool poison = false; int cookies(int a, int b, int c) { if (poison) { if (b > 0) { b--; eat++; poison = false; cookies(a, b, c); } else if (a > 0) { a--; poison = false; cookies(a, b, c); } } else if (...
delete
26
27
26
26
TLE
p03186
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define ll long long void file() { #ifndef ONLINE_JUDGE freopen("a_input.txt", "r", stdin); freopen("a_output.txt", "w", stdout); #endif } void fast() { std::ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); } int dx[] = ...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define ll long long void file() { #ifndef ONLINE_JUDGE freopen("a_input.txt", "r", stdin); freopen("a_output.txt", "w", stdout); #endif } void fast() { std::ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); } int dx[] = ...
replace
18
20
18
20
0
p03186
Python
Time Limit Exceeded
A, B, C = map(int, input().split()) ans = 0 c = C for i in range(C): if c > 0 and B > 0: ans += 2 c -= 1 B -= 1 elif c > 0 and A > 0: ans += 1 c -= 1 A -= 1 if c > 0: ans += 1 print(ans + B)
A, B, C = map(int, input().split()) ans = 0 if B >= C: print(B + C) exit() ans = 2 * B C -= B if A >= C: print(ans + C) exit() print(ans + A + 1)
replace
2
15
2
11
TLE
p03186
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <...
delete
51
56
51
51
TLE
p03187
C++
Time Limit Exceeded
#include <bits/stdc++.h> #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-conversion" #define NDEBUG #define SHOW(...) static_cast<void>(0) //!===========================================================!// //! dP dP dP !// //! 88 ...
#include <bits/stdc++.h> #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-conversion" #define NDEBUG #define SHOW(...) static_cast<void>(0) //!===========================================================!// //! dP dP dP !// //! 88 ...
replace
137
138
137
159
TLE
p03187
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long LL; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long LL; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar...
replace
24
25
24
25
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long signed int LL; typedef long long unsigned int LU; #define incID(i, l, r) for (int i = (l); i < (r); i++) #define incII(i, l, r) for (int i = (l); i <= (r); i++) #define decID(i, l, r) for (int i = (r)-1; i >= (l); i--) #define decII(i, l, r) for (int i =...
#include <bits/stdc++.h> using namespace std; typedef long long signed int LL; typedef long long unsigned int LU; #define incID(i, l, r) for (int i = (l); i < (r); i++) #define incII(i, l, r) for (int i = (l); i <= (r); i++) #define decID(i, l, r) for (int i = (r)-1; i >= (l); i--) #define decII(i, l, r) for (int i =...
delete
75
77
75
75
0
p03187
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstring> #include <vector> #define SF scanf #define PF printf #define MAXN 100010 using namespace std; typedef long long ll; int n; ll ans, a[MAXN], L, lft, rit, nstl, nstr, num; int main() { SF("%lld%d", &L, &n); for (int i = 1; i <= n; i++) SF("%lld", &a[i]); ans...
#include <cmath> #include <cstdio> #include <cstring> #include <vector> #define SF scanf #define PF printf #define MAXN 200010 using namespace std; typedef long long ll; int n; ll ans, a[MAXN], L, lft, rit, nstl, nstr, num; int main() { SF("%lld%d", &L, &n); for (int i = 1; i <= n; i++) SF("%lld", &a[i]); ans...
replace
6
7
6
7
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define N 2010 #define INF 1e18 using namespace std; template <typename T> void read(T &x) { x = 0; char c = getchar(); int fh = 1; while (!isdigit(c)) { if (c == '-') fh = -1; c = getchar(); } while (isdigit(c)) x = x * 10 + c - '0', c = getch...
#include <bits/stdc++.h> #define ll long long #define N 200010 #define INF 1e18 using namespace std; template <typename T> void read(T &x) { x = 0; char c = getchar(); int fh = 1; while (!isdigit(c)) { if (c == '-') fh = -1; c = getchar(); } while (isdigit(c)) x = x * 10 + c - '0', c = get...
replace
2
3
2
3
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const double PI = 3.14159265358979323846; typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; // cout << fixed << setprecision(20); int L, N; int X[1100...
#include <bits/stdc++.h> using namespace std; #define int long long const double PI = 3.14159265358979323846; typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; // cout << fixed << setprecision(20); int L, N; int X[2200...
replace
13
16
13
16
0
p03187
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int N = 100005; #define ll long long int l[N], r[N]; ll sl[N], sr[N]; inline int read() { int x = 0; char e = getchar(); for (; e < '0' || e > '9'; e = getchar()) ; for (; e >= '0' && e <= '9'; e = getch...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int N = 200005; #define ll long long int l[N], r[N]; ll sl[N], sr[N]; inline int read() { int x = 0; char e = getchar(); for (; e < '0' || e > '9'; e = getchar()) ; for (; e >= '0' && e <= '9'; e = getch...
replace
5
6
5
6
0
p03187
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll n, m; int main() { ll l; cin >> l >> n; ll x[n + 1], cumsum[n + 1], icumsum[n + 1]; for (ll i = 1; i <= n; i++) { cin >> x[i]; } for (ll i = 0; i <= n; i++) { cumsum[i] = 0; icumsum[i] = 0; } ...
#include <cmath> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll n, m; int main() { ll l; cin >> l >> n; ll x[n + 1], cumsum[n + 1], icumsum[n + 1]; for (ll i = 1; i <= n; i++) { cin >> x[i]; } for (ll i = 0; i <= n; i++) { cumsum[i] = 0; icumsum[i] = 0; } ...
replace
20
24
20
22
TLE
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> pi; typedef vector<pi> vpi; typedef long double ld; #define pb emplace_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(x) (ll) x.size() #de...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> pi; typedef vector<pi> vpi; typedef long double ld; #define pb emplace_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(x) (ll) x.size() #de...
replace
15
16
15
16
0
p03187
C++
Runtime Error
#include <cstdio> int n, m; long long pre[100001][2], las[100011][2], x[100001], l, ans; long long getmax(long long aa, long long bb) { if (aa > bb) return (aa); else return (bb); } int main() { scanf("%lld%d", &l, &n); for (int i = 1; i <= n; i++) scanf("%lld", &x[i]); pre[0][0] = pre[0][1] = 0; ...
#include <cstdio> int n, m; long long pre[200011][2], las[200011][2], x[200011], l, ans; long long getmax(long long aa, long long bb) { if (aa > bb) return (aa); else return (bb); } int main() { scanf("%lld%d", &l, &n); for (int i = 1; i <= n; i++) scanf("%lld", &x[i]); pre[0][0] = pre[0][1] = 0; ...
replace
2
3
2
3
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t = 0; char ch = getchar(); int f = 1; while ('0' > ch || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } do { (t *= 10) += ch - '0'; ch = getchar(); } while ('0' <= ch && ch <= '9'); t *= f;...
#include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t = 0; char ch = getchar(); int f = 1; while ('0' > ch || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } do { (t *= 10) += ch - '0'; ch = getchar(); } while ('0' <= ch && ch <= '9'); t *= f;...
replace
18
20
18
20
0
p03187
C++
Runtime Error
/* ---------- STL Libraries ---------- */ // IO library #include <cstdio> #include <fstream> #include <iomanip> #include <ios> #include <iostream> // algorithm library #include <algorithm> #include <cmath> #include <numeric> #include <random> // container library #include <array> #include <bitset> #include <deque> #...
/* ---------- STL Libraries ---------- */ // IO library #include <cstdio> #include <fstream> #include <iomanip> #include <ios> #include <iostream> // algorithm library #include <algorithm> #include <cmath> #include <numeric> #include <random> // container library #include <array> #include <bitset> #include <deque> #...
delete
105
108
105
105
0
p03187
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> using namespace std; #define ll long long #define REP(i, a, b) for (int i = (a),...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <vector> using namespace std; #define ll long long #define REP(i, a, b) for (int i = (a),...
replace
41
42
41
42
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> #define MAX_N 2000 using namespace std; typedef long long lint; int n, l; int v[MAX_N + 1]; lint rez = 0; lint st[MAX_N + 1]; lint dr[MAX_N + 2]; lint getSumSt(int s, int d) { if (s > d) return 0; return (st[d] - st[s - 1]); } lint getSumDr(int s, int d) { if (s > d) ret...
#include <bits/stdc++.h> #define MAX_N 200000 using namespace std; typedef long long lint; int n, l; int v[MAX_N + 1]; lint rez = 0; lint st[MAX_N + 1]; lint dr[MAX_N + 2]; lint getSumSt(int s, int d) { if (s > d) return 0; return (st[d] - st[s - 1]); } lint getSumDr(int s, int d) { if (s > d) r...
replace
2
3
2
3
0
p03187
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define LL long long #define M 100020 using namespace std; LL read() { LL nm = 0, fh = 1; char cw = getchar(); for (; !isdigit(cw); cw = getchar()) if (cw == '-') fh = -fh; for (; isdigit(cw); cw = getchar()...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define LL long long #define M 1000020 using namespace std; LL read() { LL nm = 0, fh = 1; char cw = getchar(); for (; !isdigit(cw); cw = getchar()) if (cw == '-') fh = -fh; for (; isdigit(cw); cw = getchar(...
replace
6
7
6
7
0
p03187
C++
Runtime Error
/* 对应原理 其实每次只有两种选择,所有这个题的对拍很好写 怎么确定能不能达到最大值呢 跑步的速度是可以加快的,每次贪心选择能行吗 有一些能够拿两次,最终答案一定是要将什么拿两次的 最快的办法当然是永不回头,但是最慢的办法并不是一步一回头 我们要积累7+7+1=15 顺时针能够拿两次 为了把很大的一个数拿两次,必须他的补集中有能够回去的,并且那个数字一定是我右边紧邻的那个 为了拿到这一个7两次,顺时针必须留一个, 就意味着逆时针3次对应顺时针1次 并且必须先逆3 为了拿到这个4两次,顺时针留一个 则逆2顺2 且逆先 为了拿到3两次,顺时针留一个 逆1顺3 i n-i 当i<n-i时 左i 右(i+1)减去最左边 最后一次是顺时...
/* 对应原理 其实每次只有两种选择,所有这个题的对拍很好写 怎么确定能不能达到最大值呢 跑步的速度是可以加快的,每次贪心选择能行吗 有一些能够拿两次,最终答案一定是要将什么拿两次的 最快的办法当然是永不回头,但是最慢的办法并不是一步一回头 我们要积累7+7+1=15 顺时针能够拿两次 为了把很大的一个数拿两次,必须他的补集中有能够回去的,并且那个数字一定是我右边紧邻的那个 为了拿到这一个7两次,顺时针必须留一个, 就意味着逆时针3次对应顺时针1次 并且必须先逆3 为了拿到这个4两次,顺时针留一个 则逆2顺2 且逆先 为了拿到3两次,顺时针留一个 逆1顺3 i n-i 当i<n-i时 左i 右(i+1)减去最左边 最后一次是顺时...
replace
33
34
33
34
0
p03187
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> #define int long long using namespace std; const int N = 1e5 + 10, inf = 1e9; int x[N], tmp[N], d1[N], d2[N]; int L, n, ans; int D1(int l, int r) { return r < l ? 0 : (d1[r] - d1[l - 1]); } int D2(int l, int r) { return r < l ? 0 : (d2[r] - d2[l - 1]); } void Cal...
#include <cstdio> #include <cstdlib> #include <iostream> #define int long long using namespace std; const int N = 2e5 + 10; int x[N], tmp[N], d1[N], d2[N]; int L, n, ans; int D1(int l, int r) { return r < l ? 0 : (d1[r] - d1[l - 1]); } int D2(int l, int r) { return r < l ? 0 : (d2[r] - d2[l - 1]); } void Calc() { for...
replace
5
6
5
6
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> #define MOD 1e9 + 7 using namespace std; #define pp push_back #define po pop_back #define mp make_pair #define clr(a) memset(a, 0, sizeof(a)) #define neg(a) memset(a, -1, sizeof(a)) #define fas(a) memset(a, false, sizeof(a)) #define debug(x) cout << #x << ": " << x << endl #define debug1(x) cou...
#include <bits/stdc++.h> #define MOD 1e9 + 7 using namespace std; #define pp push_back #define po pop_back #define mp make_pair #define clr(a) memset(a, 0, sizeof(a)) #define neg(a) memset(a, -1, sizeof(a)) #define fas(a) memset(a, false, sizeof(a)) #define debug(x) cout << #x << ": " << x << endl #define debug1(x) cou...
delete
96
99
96
96
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXN = 200011; LL ld[MAXN], rd[MAXN]; LL a[MAXN]; int n, m; LL l, ans; int main() { scanf("%lld%d", &l, &n); for (int i = 1; i <= n; ++i) { scanf("%lld", &a[i]); } ld[n] = 0; ld[n - 1] = l - (a[n] - a[n - 1]); int pre = n; ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXN = 200011; LL ld[MAXN], rd[MAXN]; LL a[MAXN]; int n, m; LL l, ans; int main() { scanf("%lld%d", &l, &n); for (int i = 1; i <= n; ++i) { scanf("%lld", &a[i]); } ld[n] = 0; ld[n - 1] = l - (a[n] - a[n - 1]); int pre = n; ...
replace
18
19
18
19
0
p03187
C++
Runtime Error
#include <cstdio> #include <iostream> #define RI register int #define CI const int & using namespace std; const int N = 100005; int l, n, a[N]; long long pfx[N], sfx[N], ans; int main() { RI i; for (scanf("%d%d", &l, &n), i = 1; i <= n; ++i) scanf("%d", &a[i]); for (i = 1; i <= n; ++i) pfx[i] = pfx[i - 1]...
#include <cstdio> #include <iostream> #define RI register int #define CI const int & using namespace std; const int N = 200005; int l, n, a[N]; long long pfx[N], sfx[N], ans; int main() { RI i; for (scanf("%d%d", &l, &n), i = 1; i <= n; ++i) scanf("%d", &a[i]); for (i = 1; i <= n; ++i) pfx[i] = pfx[i - 1]...
replace
5
6
5
6
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int nmax = 2e3 + 4; long long l, n; long long x[nmax]; long long ac[nmax]; long long solve(bool right, int s) { long long ans; if (right) { if (!((n - s) & 1)) { ans = 2 * (-ac[s - 1] + ac[(s + n) / 2 - 1] + ac[(s + n) / 2] - ac[n]) + x[(s +...
#include <bits/stdc++.h> using namespace std; const int nmax = 2e5 + 4; long long l, n; long long x[nmax]; long long ac[nmax]; long long solve(bool right, int s) { long long ans; if (right) { if (!((n - s) & 1)) { ans = 2 * (-ac[s - 1] + ac[(s + n) / 2 - 1] + ac[(s + n) / 2] - ac[n]) + x[(s +...
replace
2
3
2
3
0
p03187
C++
Time Limit Exceeded
#pragma GCC optimize(3) #include <bits/stdc++.h> #define MAXN 200005 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; typedef long long ll; typedef pair<int, int> P; ll L, n, a[MAXN], ans; ll dp[MAXN]; ll go(ll x, ll y, bool dir) { ll ret; if (dir) ret = y - x;...
#pragma GCC optimize(3) #include <bits/stdc++.h> #define MAXN 200005 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; typedef long long ll; typedef pair<int, int> P; ll L, n, a[MAXN], ans; ll dp[MAXN]; ll go(ll x, ll y, bool dir) { ll ret; if (dir) ret = y - x;...
replace
30
34
30
34
TLE
p03187
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <...
replace
50
51
50
51
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; ...
replace
28
29
28
29
0
p03187
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define inf 1050000000 #define infll 1050000000000000000ll #define pii pair<int, int> #define pll pair<ll, ll> #define mpr make_pair #define fi first #define se second #define vi vector<int> #define pb push_back #define ad(x, y) (x = (x + (y)) % mod) #define up(x, y) (x < (...
#include <bits/stdc++.h> #define ll long long #define inf 1050000000 #define infll 1050000000000000000ll #define pii pair<int, int> #define pll pair<ll, ll> #define mpr make_pair #define fi first #define se second #define vi vector<int> #define pb push_back #define ad(x, y) (x = (x + (y)) % mod) #define up(x, y) (x < (...
replace
14
15
14
15
0
ans:15
p03187
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> using namespace std; long long X[100000]; long long cum_sum_x[100000]; long long reverse_cum_sum_x[1000...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <utility> using namespace std; long long X[200000]; long long cum_sum_x[200000]; long long reverse_cum_sum_x[2000...
replace
14
17
14
17
0
p03188
C++
Runtime Error
#include <bits/stdc++.h> #define title "title" #define ll long long #define ull unsigned ll #define fix(x) fixed << setprecision(x) #define pii pair<int, int> #define vint vector<int> #define pb push_back using namespace std; void Freopen() { freopen(title ".in", "r", stdin); freopen(title ".out", "w", stdout); } i...
#include <bits/stdc++.h> #define title "title" #define ll long long #define ull unsigned ll #define fix(x) fixed << setprecision(x) #define pii pair<int, int> #define vint vector<int> #define pb push_back using namespace std; void Freopen() { freopen(title ".in", "r", stdin); freopen(title ".out", "w", stdout); } i...
replace
47
48
47
48
0
p03188
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using int64 = long long; int main() { int X[500][500]; int C; cin >> C; int K = 2 * (C + 3) / 4; for (int i = 0; i < K; i++) { for (int j = 0; j < K; j++) { if (i % 2 == 0) X[i][j] = (i + j) % K; else X[i][j] = K + (i + j) % K...
#include <bits/stdc++.h> using namespace std; using int64 = long long; int main() { int X[500][500]; int C; cin >> C; if (C == 1) { cout << 1 << endl; cout << 1 << endl; return 0; } int K = 2 * ((C + 3) / 4); for (int i = 0; i < K; i++) { for (int j = 0; j < K; j++) { if (i % 2 ...
replace
12
14
12
18
0
p03188
C++
Time Limit Exceeded
#include <cstdio> using namespace std; int K; int main() { scanf("%d", &K); if (K <= 500) { printf("%d\n", K); for (int i = 1; i <= K; ++i) { for (int j = 1; j <= K; ++j) printf("%d ", i); printf("\n"); } } else while (true) ; return 0; }
#include <cstdio> using namespace std; int K; int main() { scanf("%d", &K); if (K <= 500) { printf("%d\n", K); for (int i = 1; i <= K; ++i) { for (int j = 1; j <= K; ++j) printf("%d ", i); printf("\n"); } } else { int N = ((K / 4) + (K % 4 != 0)) * 2; printf("%d\n", N);...
replace
16
19
16
29
TLE
p03188
C++
Runtime Error
#include <cstdio> int main() { int K; scanf("%d", &K); if (K % 2 == 0) { printf("%d\n", K / 2); for (int i = 1; i <= K / 2; ++i) for (int j = 1; j <= K / 2; ++j) printf("%d%c", (i % 2 == 1 ? 0 : K / 2) + j, " \n"[j == K / 2]); } else return 1; }
#include <cstdio> int main() { int K; scanf("%d", &K); if (K == 1) return !puts("1\n1"); int n = (K + 3) / 4 * 2; printf("%d\n", n); for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) printf("%d%c", (i % 2 && n + (i + j) % n < K ? n : 0) + (i + j) % n + 1, " \n"[j + 1 == n])...
replace
5
12
5
13
0
p03189
C++
Runtime Error
#include <bits/stdc++.h> #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 MP make_pair using namespace std; typedef long long LL; typedef pair<int, int> PII; const int MOD = 1e9 + 7; const int INV2 = (MOD + 1) / 2; int dp[2005][2005]; int n, p[2005]; ...
#include <bits/stdc++.h> #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 MP make_pair using namespace std; typedef long long LL; typedef pair<int, int> PII; const int MOD = 1e9 + 7; const int INV2 = (MOD + 1) / 2; int dp[3005][3005]; int n, p[3005]; ...
replace
11
16
11
16
0
p03189
C++
Runtime Error
/* --- author: dxm --- */ #include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; #define INF 1e9 #define Inf 1e18 #define rep(i, n) for (int(i) = 0; (i) < n; i++) #define REP(i, n) for (int(i) = 1; (i) <= n; i++) #define mp make_pair #define pb push_back #define fst first #define snd second typedef long...
/* --- author: dxm --- */ #include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; #define INF 1e9 #define Inf 1e18 #define rep(i, n) for (int(i) = 0; (i) < n; i++) #define REP(i, n) for (int(i) = 1; (i) <= n; i++) #define mp make_pair #define pb push_back #define fst first #define snd second typedef long...
replace
35
36
35
36
0
p03189
C++
Runtime Error
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; #define...
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; #define...
replace
61
62
61
62
0
p03189
C++
Runtime Error
#include <bits/stdc++.h> #define N 1010 using namespace std; typedef long long ll; const int mod = 1000000007; const int inv2 = 500000004; char *p1, *p2, buf[100000]; #define nc() \ (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p...
#include <bits/stdc++.h> #define N 3010 using namespace std; typedef long long ll; const int mod = 1000000007; const int inv2 = 500000004; char *p1, *p2, buf[100000]; #define nc() \ (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p...
replace
2
3
2
3
0
p03189
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <set> #include <string> #include <utility> #define MAX_N 105 using namespace std; typedef long long ll; const ll mod = 1000000007; ll mpow(ll x, ll n) { ll ret = 1; while (n > 0) { if ((n & 1) == 1) { ret *= x; ret %= mod; } ...
#include <algorithm> #include <iostream> #include <queue> #include <set> #include <string> #include <utility> #define MAX_N 3005 using namespace std; typedef long long ll; const ll mod = 1000000007; ll mpow(ll x, ll n) { ll ret = 1; while (n > 0) { if ((n & 1) == 1) { ret *= x; ret %= mod; } ...
replace
6
7
6
7
0
p03189
C++
Time Limit Exceeded
#include <iostream> using i64 = long long; const int N = 3000 + 7; const i64 MOD = 1000000007; const i64 Inv2 = MOD - MOD / 2; int n, q; int a[N]; i64 f[N][N], g[N][N], ans, coe = 1; int main() { // freopen("code.in", "r", stdin); // freopen("code.out", "w", stdout); scanf("%d%d", &n, &q); for (int i = 1; ...
#include <iostream> using i64 = long long; const int N = 3000 + 7; const i64 MOD = 1000000007; const i64 Inv2 = MOD - MOD / 2; int n, q; int a[N]; i64 f[N][N], g[N][N], ans, coe = 1; int main() { // freopen("code.in", "r", stdin); // freopen("code.out", "w", stdout); scanf("%d%d", &n, &q); for (int i = 1; ...
replace
34
36
34
37
TLE
p03189
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const LL MOD = 1000000007; LL powmod(LL a, LL n) { if (n == 0) return 1; if (n % 2) return (a * powmod(a, n - 1)) % MOD; LL c = powmod(a, n / 2); return (c * c) % MOD; } LL inv(LL a) { return powmod(a, MOD - 2); } LL fact[110000]; LL i...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const LL MOD = 1000000007; LL powmod(LL a, LL n) { if (n == 0) return 1; if (n % 2) return (a * powmod(a, n - 1)) % MOD; LL c = powmod(a, n / 2); return (c * c) % MOD; } LL inv(LL a) { return powmod(a, MOD - 2); } LL fact[110000]; LL i...
replace
38
41
38
41
0
p03189
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ld long double // This code is written by It...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ld long double // This code is written by It...
replace
38
40
38
40
0
p03189
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = 0; c = getchar(); } while (isdigit(c)) { x = (x << 3) + (x << 1) + (c ^ 48); c = getchar(); } ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = 0; c = getchar(); } while (isdigit(c)) { x = (x << 3) + (x << 1) + (c ^ 48); c = getchar(); } ...
delete
38
42
38
38
TLE
p03189
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; #define rep(i, x, y) \ for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \ i < i##_max_for_repmacro; ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #de...
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; #define rep(i, x, y) \ for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \ i < i##_max_for_repmacro; ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #de...
delete
34
38
34
34
-11
p03190
C++
Runtime Error
// BadWaper gg #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 5010 using namespace std; typedef long long ll...
// BadWaper gg #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 20010 using namespace std; typedef long long l...
replace
15
16
15
16
0
p03190
C++
Runtime Error
#include <cstdio> using namespace std; #define N 5005 int a[N], b[N], n, s1, s2; char s[N], t[N]; long long solve(int t) { long long as = 0; int fg = 0; if (t < 0) { t = -t; fg = 1; for (int i = 1; i <= n; i++) a[i] ^= b[i] ^= a[i] ^= b[i]; s1 ^= s2 ^= s1 ^= s2; } int l1 = 1, r1 = 1 - t;...
#include <cstdio> using namespace std; #define N 15005 int a[N], b[N], n, s1, s2; char s[N], t[N]; long long solve(int t) { long long as = 0; int fg = 0; if (t < 0) { t = -t; fg = 1; for (int i = 1; i <= n; i++) a[i] ^= b[i] ^= a[i] ^= b[i]; s1 ^= s2 ^= s1 ^= s2; } int l1 = 1, r1 = 1 - t...
replace
2
3
2
3
0
p03190
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; const int N = 5e3 + 5; char S[N], T[N]; int n, ans = 1e9, cnt1, cnt2, A[N], B[N], tmpA[N], tmpB[N]; template <typename _Tp> inline void IN(_Tp &x) { char ch; bool flag = 0; x = 0; while (ch = g...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; const int N = 1e5 + 5; char S[N], T[N]; int n, ans = 1e9, cnt1, cnt2, A[N], B[N], tmpA[N], tmpB[N]; template <typename _Tp> inline void IN(_Tp &x) { char ch; bool flag = 0; x = 0; while (ch = g...
replace
7
8
7
8
0
p03190
C++
Runtime Error
/* _|_| _| _| _| _| _| _| _|_| _|_|_|_| _| _| _| _| _| _|_| _| _| _|_| _| _| _| _| _| _| _| _| _|_| _| _|_|_|_| _|_| _| _| */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> ...
/* _|_| _| _| _| _| _| _| _|_| _|_|_|_| _| _| _| _| _| _|_| _| _| _|_| _| _| _| _| _| _| _| _| _|_| _| _|_|_|_| _|_| _| _| */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> ...
replace
28
29
28
29
0
p03191
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long ll; const int N = 310, mod = 1e9 + 7; int n, a[N], t[N], c[N], cnt, CNT; void pls(int &x, int y) { x += y; x >= mod ? x -= mod : 0; } int dp[N << 1][N][N]; int main() { scanf("%d", &n); for (int i = ...
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long ll; const int N = 310, mod = 1e9 + 7; int n, a[N << 1], t[N << 1], c[N << 1], cnt, CNT; void pls(int &x, int y) { x += y; x >= mod ? x -= mod : 0; } int dp[N << 1][N][N]; int main() { scanf("%d", &n); ...
replace
7
8
7
8
-11
p03191
C++
Runtime Error
using namespace std; #include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #define N 310 #define mo 1000000007 #define ll long long int n; int bz[N]; int f[N * 2][N][N]; inline void add(int &a, ll b) { a = (a + b) % mo; } int main() { // freopen("in.txt","r",stdin); // freopen("out.txt","w",s...
using namespace std; #include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #define N 310 #define mo 1000000007 #define ll long long int n; int bz[N * 2]; int f[N * 2][N][N]; inline void add(int &a, ll b) { a = (a + b) % mo; } int main() { // freopen("in.txt","r",stdin); // freopen("out.txt","...
replace
9
10
9
10
-11
p03191
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define re register const int mod = 1e9 + 7; struct par { int x, tp; } c[1010]; int a[610], b[610], qq[610], f[310][610], g[310][610]; inline bool cmp(const par &A, const par &B) { return A.x < B.x; } int main() { re int n, nm1 = 0, tt = 0; scanf("%d", &n); for (re ...
#include <bits/stdc++.h> using namespace std; #define re register const int mod = 1e9 + 7; struct par { int x, tp; } c[1010]; int a[610], b[610], qq[610], f[610][310], g[610][310]; inline bool cmp(const par &A, const par &B) { return A.x < B.x; } int main() { re int n, nm1 = 0, tt = 0; scanf("%d", &n); for (re ...
replace
7
8
7
8
0
p03191
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 605, mo = 1e9 + 7; int a[N], ty[N], n, cnt, _; ll f[2][N][N]; void move(ll &a, ll b) { a = (a + b) % mo; } int main() { cin >> n; for (int i = 1; i <= 2 * n; i++) scanf("%d", &a[i]); for (int i = 1; i <= 2 * n; i += 2) { if ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 605, mo = 1e9 + 7; int a[N], ty[N], n, cnt, _; ll f[2][N][N]; void move(ll &a, ll b) { a = (a + b) % mo; } int main() { cin >> n; for (int i = 1; i <= 2 * n; i++) scanf("%d", &a[i]); for (int i = 1; i <= 2 * n; i += 2) { if ...
replace
25
30
25
37
0
p03191
C++
Runtime Error
// minamoto #include <bits/stdc++.h> #define R register #define fp(i, a, b) for (R int i = (a), I = (b) + 1; i < I; ++i) #define fd(i, a, b) for (R int i = (a), I = (b)-1; i > I; --i) #define go(u) for (int i = head[u], v = e[i].v; i; i = e[i].nx, v = e[i].v) template <class T> inline bool cmax(T &a, const T &b) { re...
// minamoto #include <bits/stdc++.h> #define R register #define fp(i, a, b) for (R int i = (a), I = (b) + 1; i < I; ++i) #define fd(i, a, b) for (R int i = (a), I = (b)-1; i > I; --i) #define go(u) for (int i = head[u], v = e[i].v; i; i = e[i].nx, v = e[i].v) template <class T> inline bool cmax(T &a, const T &b) { re...
replace
25
27
25
27
-11
p03191
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> inline T read() { T f = 0, x = 0; char c = getchar(); while (!isdigit(c)) f = c == '-', c = getchar(); while (isdigit(c)) x = x * 10 + c - 48, c = getchar(); return f ? -x : x; } namespace run { const int N = 309, mod = 1e9 + 7; inlin...
#include <bits/stdc++.h> using namespace std; template <typename T> inline T read() { T f = 0, x = 0; char c = getchar(); while (!isdigit(c)) f = c == '-', c = getchar(); while (isdigit(c)) x = x * 10 + c - 48, c = getchar(); return f ? -x : x; } namespace run { const int N = 309, mod = 1e9 + 7; inlin...
replace
25
26
25
26
-11
p03191
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 700; const int MOD = 1e9 + 7; int n; int F[N][N][N], flg[N], fac = 1, rua; void ADD(int &t, int d) { t += d; if (t >= MOD) t -= MOD; } int main() { cin >> n; for (int i = 1; i <= n; ++i) { int a, b; scanf("%d%d", &a, &b); if ((a != -1)...
#include <bits/stdc++.h> using namespace std; const int N = 610; const int MOD = 1e9 + 7; int n; int F[N][N][N], flg[N], fac = 1, rua; void ADD(int &t, int d) { t += d; if (t >= MOD) t -= MOD; } int main() { cin >> n; for (int i = 1; i <= n; ++i) { int a, b; scanf("%d%d", &a, &b); if ((a != -1)...
replace
3
4
3
4
MLE
p03191
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = a; i <= b; i++) #define fd(i, a, b) for (int i = a; i >= b; i--) using namespace std; typedef long long LL; typedef double db; int get() { char ch; while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-') ; if (ch == '-') { int s = 0; wh...
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = a; i <= b; i++) #define fd(i, a, b) for (int i = a; i >= b; i--) using namespace std; typedef long long LL; typedef double db; int get() { char ch; while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-') ; if (ch == '-') { int s = 0; wh...
replace
33
34
33
34
MLE
p03191
C++
Runtime Error
#include <cstdio> const int mod = 1000000007; int N, A[610], c[610], f[610][310][310]; bool del[610]; int main() { scanf("%d", &N); for (int i = 0; i < N * 2; i++) scanf("%d", A + i), c[A[i]]++; int m = 0; for (int i = 0; i < N * 2; i++) { if (A[i * 2] != -1 && A[i * 2 + 1] != -1) del[A[i * 2]] = ...
#include <cstdio> const int mod = 1000000007; int N, A[610], c[610], f[610][310][310]; bool del[610]; int main() { scanf("%d", &N); for (int i = 0; i < N * 2; i++) scanf("%d", A + i), c[A[i]]++; int m = 0; for (int i = 0; i < N; i++) { if (A[i * 2] != -1 && A[i * 2 + 1] != -1) del[A[i * 2]] = del[...
replace
9
10
9
10
-11
p03191
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int maxn = 333, mod = 1000000007; #define MP make_pair #define PB push_back #define lson o << 1, l, mid #define rson o << 1 | 1, mid + 1, r #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define ROF(i, a, b) for...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; const int maxn = 333, mod = 1000000007; #define MP make_pair #define PB push_back #define lson o << 1, l, mid #define rson o << 1 | 1, mid + 1, r #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define ROF(i, a, b) for...
replace
22
23
22
23
-11
p03191
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 300, mod = 1000000007; int n, m, f[N][N], g[N][N]; bool fix[N], banned[N]; int main() { scanf("%d", &n); int t = 1; for (int i = 1, x, y; i <= n; i++) { scanf("%d%d", &x, &y); if (~x && ~y) { fix[x] = fix[y] = true; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 666, mod = 1000000007; int n, m, f[N][N], g[N][N]; bool fix[N], banned[N]; int main() { scanf("%d", &n); int t = 1; for (int i = 1, x, y; i <= n; i++) { scanf("%d%d", &x, &y); if (~x && ~y) { fix[x] = fix[y] = true; ...
replace
4
5
4
5
0
p03191
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #inclu...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #inclu...
replace
177
179
177
179
-11
p03191
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> #define P 1000000007 using namespace std; typedef long long ll; int n, A[777], B[777]; ll F[2][333][333], Fac[777], Rev[777], bra[777]; void add(ll &x, ll y) { x = (x + y) % P; } ll powmod(ll x, ll y = P - 2, ll p = P) { ll ans = 1; w...
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> #define P 1000000007 using namespace std; typedef long long ll; int n, A[777], B[777]; ll F[2][333][333], Fac[777], Rev[777], bra[777]; void add(ll &x, ll y) { x = (x + y) % P; } ll powmod(ll x, ll y = P - 2, ll p = P) { ll ans = 1; w...
replace
52
54
52
54
0
p03191
C++
Runtime Error
#include <bits/stdc++.h> #define LL long long #define pii pair<int, int> using namespace std; const int inf = 2147483647; const int mod = 1e9 + 7; const int N = 301; int _max(int x, int y) { return x > y ? x : y; } int _min(int x, int y) { return x < y ? x : y; } inline int read() { int x = 0, f = 1; char ch = ge...
#include <bits/stdc++.h> #define LL long long #define pii pair<int, int> using namespace std; const int inf = 2147483647; const int mod = 1e9 + 7; const int N = 301; int _max(int x, int y) { return x > y ? x : y; } int _min(int x, int y) { return x < y ? x : y; } inline int read() { int x = 0, f = 1; char ch = ge...
replace
60
62
60
62
0
p03191
C++
Runtime Error
#include <algorithm>/*{{{*/ #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef pair<int, int> pii; #define fi first #define se sec...
#include <algorithm>/*{{{*/ #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef pair<int, int> pii; #define fi first #define se sec...
replace
28
29
28
29
-11
p03192
C++
Runtime Error
#include <algorithm> #include <math.h> #include <stdio.h> #include <stdlib.h> using namespace std; int main(int argc, char const *argv[]) { char s[4] = {'\0'}; int n, count = 0, ret; ret = scanf("%d", &n); sprintf(s, "%d", n); for (int i = 0; i < 4; i++) { if (s[i] == '2') count++; } printf("...
#include <algorithm> #include <math.h> #include <stdio.h> #include <stdlib.h> using namespace std; int main(int argc, char const *argv[]) { char s[5]; int n, count = 0, ret; ret = scanf("%d", &n); sprintf(s, "%d", n); for (int i = 0; i < 4; i++) { if (s[i] == '2') count++; } printf("%d\n", co...
replace
8
9
8
9
0
p03192
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, m, n) for (int i = m; i < n; i++) #define co(n) cout << n << endl using namespace std; int main() { string s; int c = 0; rep(i, 0, 4) if (s.at(i) == '2') c++; co(c); return 0; }
#include <bits/stdc++.h> #define rep(i, m, n) for (int i = m; i < n; i++) #define co(n) cout << n << endl using namespace std; int main() { string s; cin >> s; int c = 0; rep(i, 0, 4) if (s.at(i) == '2') c++; co(c); return 0; }
insert
6
6
6
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
p03192
Python
Runtime Error
def main(n): print(str(n).count("2")) if __name__ == "__main__": n = int(input()) main()
def main(n): print(str(n).count("2")) if __name__ == "__main__": n = int(input()) main(n)
replace
6
7
6
7
TypeError: main() missing 1 required positional argument: 'n'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03192/Python/s987134769.py", line 7, in <module> main() TypeError: main() missing 1 required positional argument: 'n'
p03192
C++
Runtime Error
#include <algorithm> #include <math.h> #include <stdio.h> #include <stdlib.h> using namespace std; int main(int argc, char const *argv[]) { char s[4]; int n, count = 0, ret; ret = scanf("%d", &n); sprintf(s, "%d", n); for (int i = 0; i < 4; i++) { if (s[i] == '2') count++; } printf("%d\n", co...
#include <algorithm> #include <math.h> #include <stdio.h> #include <stdlib.h> using namespace std; int main(int argc, char const *argv[]) { char s[5]; int n, count = 0, ret; ret = scanf("%d", &n); sprintf(s, "%d", n); for (int i = 0; i < 4; i++) { if (s[i] == '2') count++; } printf("%d\n", co...
replace
8
9
8
9
0
p03193
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long N, H, W; cin >> N >> H >> W; vector<vector<long long>> vec(H, vector<long long>(W)); for (int i = 0; i < N; i++) { for (int j = 0; j < 2; j++) { cin >> vec.at(i).at(j); } } int ans = 0; for (int k = 0; k < N; k++) { if...
#include <bits/stdc++.h> using namespace std; int main() { long long N, H, W; cin >> N >> H >> W; vector<vector<long long>> vec(N, vector<long long>(2)); for (int i = 0; i < N; i++) { for (int j = 0; j < 2; j++) { cin >> vec.at(i).at(j); } } int ans = 0; for (int k = 0; k < N; k++) { if...
replace
5
6
5
6
0
p03193
Python
Runtime Error
def read(): N, H, W = list(map(int, input().strip().split())) A = [] B = [] for i in range(N): a, b = list(map(int, input().strip().split())) A.append(a) B.append(b) return N, H, W, A, B def solve(N, H, W, A, B): count = 0 for i in range(N): if A[i] >= H and...
def read(): N, H, W = list(map(int, input().strip().split())) A = [] B = [] for i in range(N): a, b = list(map(int, input().strip().split())) A.append(a) B.append(b) return N, H, W, A, B def solve(N, H, W, A, B): count = 0 for i in range(N): if A[i] >= H and...
replace
21
22
21
22
TypeError: solve() missing 4 required positional arguments: 'H', 'W', 'A', and 'B'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03193/Python/s433009043.py", line 22, in <module> print(solve(inputs)) TypeError: solve() missing 4 required positional arguments: 'H', 'W', 'A', and 'B'
p03193
C++
Runtime Error
#include <cstdio> #include <ctype.h> #include <iostream> #include <string> using namespace std; int main() { int N, count = 0; int H, W; cin >> N >> H >> W; long int A[H], B[W]; for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; if (A[i] >= H && B[i] >= W) { count++; } } cout << count <<...
#include <cstdio> #include <ctype.h> #include <iostream> #include <string> using namespace std; int main() { int N, count = 0; int H, W; cin >> N >> H >> W; long int A[N], B[N]; for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; if (A[i] >= H && B[i] >= W) { count++; } } cout << count <<...
replace
9
10
9
10
0
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #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...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #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...
replace
31
32
31
32
TLE
p03194
C++
Time Limit Exceeded
// Created by sz #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { #ifdef LOCAL freopen("./input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); ll N, P; cin >> N >> P; if (N == 1) { cout << P << endl; return 0; } ll p = P; ll divis...
// Created by sz #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { #ifdef LOCAL freopen("./input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); ll N, P; cin >> N >> P; if (N == 1) { cout << P << endl; return 0; } ll p = P; ll divis...
replace
23
24
23
24
TLE
p03194
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[1005], b[1005]; ll zyou(ll i, ll n) { ll k = 1; while (n > 0) { if (n & 1) k = k * i; i = i * i; n >>= 1; } return k; } int main(void) { ll n, p; cin >> n >> p; ll ans = 1; if (n == 1) { cout << p << endl; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[1005], b[1005]; ll zyou(ll i, ll n) { ll k = 1; while (n > 0) { if (n & 1) k = k * i; i = i * i; n >>= 1; } return k; } int main(void) { ll n, p; cin >> n >> p; ll ans = 1; if (n == 1) { cout << p << endl; ...
insert
22
22
22
26
0
p03194
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll N, P; cin >> N >> P; ll i = 2, l = 1; while (P != 1) { if (P % i == 0) { ll ni = 0; while (P % i == 0) { ni++; P /= i; } l *= pow(i, ni / N); } else { i++; } } cout...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll N, P; cin >> N >> P; ll i = 2, l = 1; while (P != 1) { if (P % i == 0) { ll ni = 0; while (P % i == 0) { ni++; P /= i; } l *= pow(i, ni / N); } else if (i * i > P) { if (N ...
insert
17
17
17
21
TLE
p03194
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long ll; vector<pair<ll, ll>> v; int main() { ll n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } ll ans = 1; for (ll i = 2;;) { ll po = pow(i, n); if (po > p) { ...
#include <cmath> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long ll; vector<pair<ll, ll>> v; int main() { ll n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } if (n >= 40) { cout << 1 << endl; return 0; } ll ans = 1; for (...
insert
16
16
16
21
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <random> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll N, P, kN; cin >> N >> P; ll k = 2; ll ans = 1; while (P >= pow(k, N)) { kN = pow(k, N); if (P ...
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <random> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll N, P, kN; cin >> N >> P; ll k = 2; ll ans = 1; if (N == 1) ans = P; else { while (P >= pow(k...
replace
19
26
19
30
TLE
p03194
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long...
insert
44
44
44
49
0
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> #define INF 1000000007 using namespace std; int main(void) { long long n, p, temp, ans = 1; int count = 0; cin >> n >> p; if (n >= 40) { cout << 1 << endl; ...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> #define INF 1000000007 using namespace std; int main(void) { long long n, p, temp, ans = 1; int count = 0; cin >> n >> p; if (n >= 40) { cout << 1 << endl; ...
insert
19
19
19
23
TLE
p03194
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; int main() { long n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } else if (n >= 40) { cout << 1 << endl; return 0; } int cnt = 0; int ans = 1; for (int i = 2; i <= p; i++) { // cout << "A" << i << endl; ...
#include <cmath> #include <iostream> using namespace std; int main() { long n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } else if (n >= 40) { cout << 1 << endl; return 0; } int cnt = 0; int ans = 1; for (int i = 2; i <= p && i <= 1000000; i++) { // cout << "A" ...
replace
16
17
16
17
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <cstddef> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <locale> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <sta...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <cstddef> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <locale> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <sta...
insert
59
59
59
64
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <time.h> #include <vector> // #include "bits/stdc++.h" using namespace std; // using namespace std::...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <sstream> #include <string> #include <time.h> #include <vector> // #include "bits/stdc++.h" using namespace std; // using namespace std::...
insert
135
135
135
138
TLE
p03194
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const int mod = 1e9 + 7; int main() { ll n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } ll ans = 1; for (int i = 2; i * i <= p; i++) { ll cnt = 0; while (...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const int mod = 1e9 + 7; int main() { ll n, p; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } ll ans = 1; for (int i = 2; pow(i, n) <= p; i++) { while (p % (ll)pow(...
replace
18
25
18
22
TLE
p03194
C++
Runtime Error
#ifdef _WIN32 #include "stdc++.h" #else #include <bits/stdc++.h> #endif // 継承可能な型 template <class Type> struct IN : Type { IN() { std::cin >> *this; } }; // 継承不可能な型 template <class Type> struct IN_ { Type val; IN_() { std::cin >> val; } operator Type &() { return val; } IN_<Type> &operator=(const Type &_...
#ifdef _WIN32 #include "stdc++.h" #else #include <bits/stdc++.h> #endif // 継承可能な型 template <class Type> struct IN : Type { IN() { std::cin >> *this; } }; // 継承不可能な型 template <class Type> struct IN_ { Type val; IN_() { std::cin >> val; } operator Type &() { return val; } IN_<Type> &operator=(const Type &_...
replace
227
228
227
228
0
p03194
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; typedef vector<ll> vel; typedef vector<int> vei; typedef vector<char> vec; typedef vector<bool> veb; typedef vector<string> ves; typedef vector<vector<ll>> ve_vel; typedef ve...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; typedef vector<ll> vel; typedef vector<int> vei; typedef vector<char> vec; typedef vector<bool> veb; typedef vector<string> ves; typedef vector<vector<ll>> ve_vel; typedef ve...
insert
70
70
70
74
0
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ll fastPow(ll i, ll x) { if (x == 0) return 1LL; if (x % 2 == 1) return i * fastPow(i, x - 1); else { ll ret = fas...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ll fastPow(ll i, ll x) { if (x == 0) return 1LL; if (x % 2 == 1) return i * fastPow(i, x - 1); else { ll ret = fas...
insert
27
27
27
35
TLE
p03194
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { long long n, p; cin >> n >> p; long long ans = 1; if (n == 1) { cout << p << endl; return 0; } for (int i = 2; i * i <= p; ++i) { int cnt = 0; while (p % i == 0) { cnt++; p /= i; if (cnt == n) { ans *= i; ...
#include <iostream> using namespace std; int main() { long long n, p; cin >> n >> p; long long ans = 1; if (n == 1) { cout << p << endl; return 0; } for (long long i = 2; i * i <= p; ++i) { int cnt = 0; while (p % i == 0) { cnt++; p /= i; if (cnt == n) { ans *= i; ...
replace
10
11
10
11
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0;...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0;...
insert
33
33
33
37
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define INF 1000000000 #de...
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define INF 1000000000 #de...
replace
36
37
36
37
TLE
p03194
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; unsigned long long p; unsigned long long quick(unsigned long long a, unsigned long long b) { if (b == 1) return a; unsigned long long ret = quick(a, b / 2); if (b % 2 == 1) return ret * ret * a; return ret * ret; } int main() { int n; unsigned long long ...
#include <bits/stdc++.h> using namespace std; unsigned long long p; unsigned long long quick(unsigned long long a, unsigned long long b) { if (b == 1) return a; unsigned long long ret = quick(a, b / 2); if (b % 2 == 1) return ret * ret * a; return ret * ret; } int main() { int n; unsigned long long ...
replace
21
22
21
22
0
p03194
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; int main(void) { ll n, p, a = 1, ans; cin >> n >> p; while (pow(a, n) <= p) { if (p % (ll)pow(a, n) == 0) { ans = a; } a++; } cout << ans << endl; }
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; int main(void) { ll n, p, a = 1, ans; cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } while (pow(a, n) <= p) { if (p % (ll)pow(a, n) == 0) { ans = a; } a++; } cout << ans << endl; ...
insert
7
7
7
11
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <vector> typedef unsigned long long ull; typedef long long ll; #define MAX 1000000000001 using namespace std; int main() { ull n, p; cin >> n >> p; ull max = 1, i = 2; while (pow(i, n) <= p) { if (p % (u...
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <vector> typedef unsigned long long ull; typedef long long ll; #define MAX 1000000000001 using namespace std; int main() { ull n, p; cin >> n >> p; ull max = 1, i = 2, x; if (n == 1) { cout << p << endl;...
replace
14
17
14
21
TLE
p03194
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; ll n, p, i = 1, ans = 0; int main(void) { cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } while (p >= (ll)pow(i, n)) { if (p % (ll)pow(i, n) == 0) { ans = i; } i++; } cout << ans << ...
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; ll n, p, i = 1, ans = 0; int main(void) { cin >> n >> p; if (n == 1) { cout << p << endl; return 0; } if (n > 40) { cout << 1 << endl; return 0; } while (p >= (ll)pow(i, n)) { if (p % (ll)pow(i, n) ==...
insert
11
11
11
15
TLE
p03194
C++
Time Limit Exceeded
/* ID: anonymo14 TASK: wormhole LANG: C++ */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pair<int, int>> vpii; #define F first #define S second #define PU push #define PUF push_front #define PUB pus...
/* ID: anonymo14 TASK: wormhole LANG: C++ */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pair<int, int>> vpii; #define F first #define S second #define PU push #define PUF push_front #define PUB pus...
insert
35
35
35
39
TLE
p03194
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n, k; cin >> n >> k; if (n == 1) { cout << k; return 0; } double c = 1; for (double i = 1;; i++) { if (k % (ll)pow(i, (double)n) == 0) { c = i; } if (k < (ll)pow(i, (double)n)) break; } cou...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll n, k; cin >> n >> k; if (n == 1) { cout << k; return 0; } if (n > 1000000) { cout << 1; return 0; } double c = 1; for (double i = 1;; i++) { if (k % (ll)pow(i, (double)n) == 0) { c = i; } ...
insert
8
8
8
12
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using ll = long long; using namespace std; constexpr int MOD = 1e9 + 7; constexpr ll ...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using ll = long long; using namespace std; constexpr int MOD = 1e9 + 7; constexpr ll ...
replace
23
24
23
24
TLE
p03194
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { long long int n, p, ans = 1; cin >> n >> p; long long int i = 1; long long int a = pow(2, n); long long int min = 2; int l = 2; while (pow(i, n) <= p) { long long int tmp = pow(i, n); if (p % tmp == 0) { ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { long long int n, p, ans = 1; cin >> n >> p; long long int i = 1; long long int a = pow(2, n); long long int min = 2; int l = 2; if (n == 1) { cout << p << endl; return 0; } while (pow(i, n) <= p) { ...
insert
12
12
12
16
TLE
p03194
C++
Time Limit Exceeded
#include <iostream> #include <math.h> using namespace std; int main(void) { long long N, P; cin >> N; cin >> P; long long ans = 1; int i; if (N == 1) { ans = P; } else { for (i = 1; i < 100000000; i++) { long long kn = pow(i, N); if ((P % kn) == 0) { ans = i; } ...
#include <iostream> #include <math.h> using namespace std; int main(void) { long long N, P; cin >> N; cin >> P; long long ans = 1; int i; if (N == 1) { ans = P; } else { for (i = 2; i <= 1000010; i++) { long long kn = pow(i, N); if ((P % kn) == 0) { ans = i; } ...
replace
17
18
17
18
TLE