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
p02660
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; typedef unsigned long long ull; #define FOR(i, a, b) for (int i = (a); i < (b); ++i...
// #include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> typedef long long ll; typedef unsigned long long ull; #define FOR(i, a, b) for (int i = (a); i < (b); ++i...
replace
96
97
96
97
TLE
p02660
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <numeric> #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 i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), ...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <numeric> #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 i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), ...
replace
38
39
38
39
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define fi first #define se second #define mp make_pair #define pii pair<int, int> #define fr(i, a, b) for (int i = a; i < b; i++) #define frb(i, a, b) for (int i = a; i > b; i--) #define sz(s) (i...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define fi first #define se second #define mp make_pair #define pii pair<int, int> #define fr(i, a, b) for (int i = a; i < b; i++) #define frb(i, a, b) for (int i = a; i > b; i--) #define sz(s) (i...
insert
36
36
36
37
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; #define f first #define s second #define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i) #define DEC(i, s, e) for (ll i = s; i >= ll(e); --i) #define pb push_back #define all(x) (x)....
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; #define f first #define s second #define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i) #define DEC(i, s, e) for (ll i = s; i >= ll(e); --i) #define pb push_back #define all(x) (x)....
replace
18
19
18
19
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; const int N = (int)1e5 + 7; int n; int a[N]; int b[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i <= n;...
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; const int N = (int)2e5 + 7; int n; int a[N]; int b[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i = 1; i <= n;...
replace
8
9
8
9
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 2e5 + 5; int n, a[N], b[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } sort(a, a + n); sort(b, b + n); reverse(b, b + n); if (n & 1) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 2e5 + 5; int n, a[N], b[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } sort(a, a + n); sort(b, b + n); reverse(b, b + n); if (n & 1) { ...
replace
18
19
18
21
-6
60a20911-e310-4689-aa97-7ce55aa24a1e.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02661/C++/s947088133.cpp:20: int main(): Assertion `false' failed.
p02661
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll M = 1e9 + 7; const ll INF ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll M = 1e9 + 7; const ll INF ...
replace
22
23
22
23
0
p02661
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; ll a[100005], b[100005]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i] >> b[i]; } sort(a + 1, a + n + 1); sort(b + 1, b + n + 1); if (n % 2 == 1) { cout << (ll)(b[n / 2 + 1] - a[n / 2 +...
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; ll a[200005], b[200005]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i] >> b[i]; } sort(a + 1, a + n + 1); sort(b + 1, b + n + 1); if (n % 2 == 1) { cout << (ll)(b[n / 2 + 1] - a[n / 2 +...
replace
5
6
5
6
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long N; vector<long long> A; vector<long long> B; int main() { cin >> N; for (long long i = 0; i < N; i++) { long long a, b; cin >> a >> b; A.push_back(a); B.push_back(b); } sort(A.begin(), A.end()); sort(B.begin(), B.end()); if (N % 2 == ...
#include <bits/stdc++.h> using namespace std; long long N; vector<long long> A; vector<long long> B; int main() { cin >> N; for (long long i = 0; i < N; i++) { long long a, b; cin >> a >> b; A.push_back(a); B.push_back(b); } sort(A.begin(), A.end()); sort(B.begin(), B.end()); if (N % 2 == ...
replace
35
36
35
36
255
p02661
C++
Runtime Error
#pragma GCC optimize(2) #include <bits/stdc++.h> #define ll long long #define se second #define fi first #define N 3005 #define inf 1e9 #define pb push_back #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; inline int read() { int x = 0, w = 1; ...
#pragma GCC optimize(2) #include <bits/stdc++.h> #define ll long long #define se second #define fi first #define N 1000005 #define inf 1e9 #define pb push_back #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; inline int read() { int x = 0, w = 1...
replace
5
6
5
6
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long using namespace std; int main() { int n; cin >> n; vector<int> a, b; for (int i = 0; i < n; i++) { cin >> a.at(i); cin >> b.at(i); } // debug a,b sort(a.begin(), a.end()); sort(b.begin(), b.end()); ll res;...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long using namespace std; int main() { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a.at(i); cin >> b.at(i); } // debug a,b sort(a.begin(), a.end()); sort(b.begin(), b.end()); l...
replace
10
11
10
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
p02661
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; ll l[100005], r[100005]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { cin >> l[i] >> r[i]; } sort(l, l + n); sort(r, r + n); if (n % 2 == 1) { cout << ...
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; ll l[200005], r[200005]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { cin >> l[i] >> r[i]; } sort(l, l + n); sort(r, r + n); if (n % 2 == 1) { cout << ...
replace
6
7
6
7
0
p02661
Python
Runtime Error
N = int(input()) A, B = [], [] for i in range(N): tm, p = map(int, input().split()) A.append(tm), B.append(p) A.sort(), B.sort() a = A[N // 2] * 2 if N % 2 == 1 else A[N // 2] + A[N // 2 + 1] b = B[N // 2] * 2 if N % 2 == 1 else B[N // 2] + B[N // 2 + 1] print((b - a) // 2 + 1)
N = int(input()) A, B = [], [] for i in range(N): tm, p = map(int, input().split()) A.append(tm), B.append(p) A.sort(), B.sort() a = A[N // 2] * 2 if N % 2 == 1 else A[N // 2 - 1] + A[N // 2] b = B[N // 2] * 2 if N % 2 == 1 else B[N // 2 - 1] + B[N // 2] print((b - a) // 2 + 1 if N % 2 == 1 else b - a + 1)
replace
7
10
7
11
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02661/Python/s174189740.py", line 8, in <module> a = A[N // 2] * 2 if N % 2 == 1 else A[N // 2] + A[N // 2 + 1] IndexError: list index out of range
p02661
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; #define MAX_N 100005 int N; int A[MAX_N], B[MAX_N]; void solve() { sort(A, A + N); sort(B, B + N); printf("%d\n", (N % 2 == 1 ? B[N / 2] - A[N / 2] : (B[N / 2] + B[(N - 1) / 2] - A[N / 2] - ...
#include <algorithm> #include <cstdio> using namespace std; #define MAX_N 200005 int N; int A[MAX_N], B[MAX_N]; void solve() { sort(A, A + N); sort(B, B + N); printf("%d\n", (N % 2 == 1 ? B[N / 2] - A[N / 2] : (B[N / 2] + B[(N - 1) / 2] - A[N / 2] - ...
replace
5
6
5
6
0
p02661
C++
Runtime Error
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; ll a, b; vector<pair<ll, ll>> p1(n), p2(n); rep(i, n) { cin >> a >> b; p1[i] = make_pair(a,...
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; ll a, b; vector<pair<ll, ll>> p1(n), p2(n); rep(i, n) { cin >> a >> b; p1[i] = make_pair(a,...
replace
22
23
22
23
0
p02661
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long #define pll pair<ll, ll> #define reps(i, f, n) for (int i = (f); i < (int)(n); i++) #define rep(i, n) reps(i, 0, n) const int INF = 1111111111; using namespace std; const...
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long #define pll pair<ll, ll> #define reps(i, f, n) for (int i = (f); i < (int)(n); i++) #define rep(i, n) reps(i, 0, n) const int INF = 1111111111; using namespace std; const...
replace
18
19
18
19
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++) #define FORR(i, n) for (ll i = (ll)n - 1LL; i >= 0LL; i--) #define rep(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using ll = long long; template <typename T> using V = vector<T>; constexpr ll Mod = 998244353; c...
#include <bits/stdc++.h> #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++) #define FORR(i, n) for (ll i = (ll)n - 1LL; i >= 0LL; i--) #define rep(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using ll = long long; template <typename T> using V = vector<T>; constexpr ll Mod = 998244353; c...
replace
28
29
28
29
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _Rep(i, a, b) for (int i = a; i >= b; i--) #define RepG(i, u) for (int i = head[u]; ~i; i = e[i].next) typedef long long ll; const int N = 1e5 + 5; template <typename T> void read(T &x) { x = 0; int f = 1; ...
#include <bits/stdc++.h> using namespace std; #define Rep(i, a, b) for (int i = a; i <= b; i++) #define _Rep(i, a, b) for (int i = a; i >= b; i--) #define RepG(i, u) for (int i = head[u]; ~i; i = e[i].next) typedef long long ll; const int N = 2e5 + 5; template <typename T> void read(T &x) { x = 0; int f = 1; ...
replace
9
10
9
10
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int a[100001], b[100001]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i] >> b[i]; sort(a + 1, a + n + 1); sort(b + 1, b + n + 1); long long ans; if (n % 2 == 0) ans = b[n / 2] + b[(n / 2) + 1] - a[n / 2] - a[(n / 2) + 1] + 1...
#include <bits/stdc++.h> using namespace std; int a[200001], b[200001]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i] >> b[i]; sort(a + 1, a + n + 1); sort(b + 1, b + n + 1); long long ans; if (n % 2 == 0) ans = b[n / 2] + b[(n / 2) + 1] - a[n / 2] - a[(n / 2) + 1] + 1...
replace
3
4
3
4
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int nm = 1e5; int n, a[nm], b[nm]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; sort(a, a + n); sort(b, b + n); if (n & 1) { cout << b[n / 2] - a[n / 2] + 1 << endl; } else { cout << b[n / 2 - 1] + b[n / 2] - a[n ...
#include <bits/stdc++.h> using namespace std; const int nm = 2e5; int n, a[nm], b[nm]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; sort(a, a + n); sort(b, b + n); if (n & 1) { cout << b[n / 2] - a[n / 2] + 1 << endl; } else { cout << b[n / 2 - 1] + b[n / 2] - a[n ...
replace
3
4
3
4
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 1e5 + 4; int n; int A[MAXN], B[MAXN]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &A[i], &B[i]); sort(A + 1, A + n + 1); sort(B + 1, B + n + 1); if (n & 1) { printf("%lld\n", 1LL + B[(n + 1...
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 2e5 + 4; int n; int A[MAXN], B[MAXN]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &A[i], &B[i]); sort(A + 1, A + n + 1); sort(B + 1, B + n + 1); if (n & 1) { printf("%lld\n", 1LL + B[(n + 1...
replace
3
4
3
4
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> //required // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define lb long double #define pb push_back #define loop(i, start, n) for (ll i = start; i < n; i++) #define rloop(i, n, start) for (ll i = n; i >= start; i--) #define mod 1000000...
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> //required // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define lb long double #define pb push_back #define loop(i, start, n) for (ll i = start; i < n; i++) #define rloop(i, n, start) for (ll i = n; i >= start; i--) #define mod 1000000...
delete
79
80
79
79
-6
196b38a7-576d-4cdf-85cd-932fb271d3c1.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02661/C++/s208766323.cpp:64: int main(): Assertion `0' failed.
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pqgreater(x) x, vector<x>, greater<x> #define decimal(x) cout << fixed << setprecision(x) #define dbg(x) cerr << #x << ": " << x << endl; #define gc ge...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pqgreater(x) x, vector<x>, greater<x> #define decimal(x) cout << fixed << setprecision(x) #define dbg(x) cerr << #x << ": " << x << endl; #define gc ge...
replace
191
197
191
201
0
p02661
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; int a[100001], b[100001]; for (int i = 1; i <= n; i++) { cin >> a[i] >> b...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; int a[200001], b[200001]; for (int i = 1; i <= n; i++) { cin >> a[i] >> b...
replace
16
17
16
17
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } signed main() { int n; cin >> ...
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } signed main() { int n; cin >> ...
replace
23
25
23
25
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) constexpr int MX = 100005; int n, a[MX], b[MX], ans; int main() { scanf("%d", &n); rep(i, n) scanf("%d%d", a + i, b + i); sort(a, a + n); sort(b, b + n); if (n % 2) ans = b[n / 2] - a[n / 2] + 1; else ans =...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) constexpr int MX = 200005; int n, a[MX], b[MX], ans; int main() { scanf("%d", &n); rep(i, n) scanf("%d%d", a + i, b + i); sort(a, a + n); sort(b, b + n); if (n % 2) ans = b[n / 2] - a[n / 2] + 1; else ans =...
replace
3
4
3
4
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long a[100000]; long long b[100000]; int main(void) { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lld %lld", &a[i], &b[i]); } sort(a, a + n); sort(b, b + n); if (n % 2 == 1) { printf("%lld", b[n / 2] - a[n / 2] + 1); } else {...
#include <bits/stdc++.h> using namespace std; long long a[200000]; long long b[200000]; int main(void) { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lld %lld", &a[i], &b[i]); } sort(a, a + n); sort(b, b + n); if (n % 2 == 1) { printf("%lld", b[n / 2] - a[n / 2] + 1); } else {...
replace
3
5
3
5
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (n); ++i) using ll = int_fast64_t; using pll = pair<ll, ll>; constexpr ll INF = 1LL << 60; constexpr ll MOD = 1e9 + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (n); ++i) using ll = int_fast64_t; using pll = pair<ll, ll>; constexpr ll INF = 1LL << 60; constexpr ll MOD = 1e9 + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template ...
replace
69
70
69
75
1
p02661
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <vector> #define lowbit(x) ((x) & (-(x))) #define re register #define ll long long #define ull unsigned long long #define rep(i, a, b) for (re int i = a; i <= b; ++i) #define per(i, a, b) for (re int i = a; i >= b; --i) template <typename T> inline void read(T &x) { x =...
#include <algorithm> #include <cstdio> #include <vector> #define lowbit(x) ((x) & (-(x))) #define re register #define ll long long #define ull unsigned long long #define rep(i, a, b) for (re int i = a; i <= b; ++i) #define per(i, a, b) for (re int i = a; i >= b; --i) template <typename T> inline void read(T &x) { x =...
replace
29
30
29
30
0
p02661
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; #define INF 10000000000000 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i < (ll)(n); i++) #define repN_1(i, n) for (ll i = 0; i < (ll)(n - 1); i++) #define ...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; #define INF 10000000000000 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i < (ll)(n); i++) #define repN_1(i, n) for (ll i = 0; i < (ll)(n - 1); i++) #define ...
replace
46
49
46
50
TLE
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ss second #define ff first #define N 100005 #define inf 1000000009 #define ll long long #define pii pair<int, int> #define sz(a) int(a.size()) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } int n, a[N], b[N]; int main() { scanf("%d", &...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ss second #define ff first #define N 200005 #define inf 1000000009 #define ll long long #define pii pair<int, int> #define sz(a) int(a.size()) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } int n, a[N], b[N]; int main() { scanf("%d", &...
replace
5
6
5
6
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
replace
12
13
12
13
0
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr char newl = '\n'; ll solve(int n, const vector<ll> &a, const vector<ll> &b, int num) { ll ng = 0, ok = 1e9 + 1; while (ok - ng > 1) { ll mid = (ok + ng) / 2; int le = 0, cnt = 0; for (int i = 0; i < n; i++) { if (b[...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr char newl = '\n'; ll solve(int n, const vector<ll> &a, const vector<ll> &b, int num) { ll ng = 0, ok = 1e9 + 1; while (ok - ng > 1) { ll mid = (ok + ng) / 2; int le = 0, cnt = 0; for (int i = 0; i < n; i++) { if (b[...
delete
98
99
98
98
-6
3215041b-504d-42b3-869b-1c3e93111d9b.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02661/C++/s862422443.cpp:93: int main(): Assertion `false' failed.
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long void read(int &x) { int f = 1; x = 0; char s = getchar(); while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); } while (s >= '0' && s <= '9') { x = x * 10 + s - '0'; s = getchar(); } x *= f; } #define l...
#include <bits/stdc++.h> using namespace std; #define ll long long void read(int &x) { int f = 1; x = 0; char s = getchar(); while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); } while (s >= '0' && s <= '9') { x = x * 10 + s - '0'; s = getchar(); } x *= f; } #define l...
replace
19
21
19
21
0
p02661
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using Pa = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vec<int> A(N), B(N); for (i...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using Pa = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vec<int> A(N), B(N); for (i...
replace
18
45
18
22
TLE
p02661
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; ll a[100005], b[100005]; int main() { ll n; cin >> n; for (ll i = 0; i < n; i++) { scanf("%lld%lld", &a[i], &b[i]); } sort(a, a + n); sort(b, b + n); ll low, hi; if (n & 1) { low = a[(n - 1) / 2]; hi = b[(n - 1) / 2]; } el...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll a[200005], b[200005]; int main() { ll n; cin >> n; for (ll i = 0; i < n; i++) { scanf("%lld%lld", &a[i], &b[i]); } sort(a, a + n); sort(b, b + n); ll low, hi; if (n & 1) { low = a[(n - 1) / 2]; hi = b[(n - 1) / 2]; } el...
replace
3
4
3
4
0
p02662
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> // #include"testlib.h" #define endl "\n" #define all(v) v.begin(), v.end() #define allr(s) s.rbegin(), s.rend() #define RT(s) return cout << s, 0 #define watch(x) cout << (#x) << " = " << x << endl #define sz(s) (int)(s.size()) #define PI...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> // #include"testlib.h" #define endl "\n" #define all(v) v.begin(), v.end() #define allr(s) s.rbegin(), s.rend() #define RT(s) return cout << s, 0 #define watch(x) cout << (#x) << " = " << x << endl #define sz(s) (int)(s.size()) #define PI...
replace
34
35
34
35
0
p02662
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #define REL #pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <iom...
#define _CRT_SECURE_NO_WARNINGS #define REL #pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <iom...
replace
88
89
88
89
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second...
replace
50
52
50
52
0
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define en "\n" #define INF (int)9e18 #define HELL 998244353LL #define int long long #define double long double #define uint unsigned long long #define pii pair<int, int> #define pb push_back #define fs first #define sc second #define size(a) (int)a.size() #define deb(x) c...
#include <bits/stdc++.h> using namespace std; #define en "\n" #define INF (int)9e18 #define HELL 998244353LL #define int long long #define double long double #define uint unsigned long long #define pii pair<int, int> #define pb push_back #define fs first #define sc second #define size(a) (int)a.size() #define deb(x) c...
replace
67
68
67
68
TLE
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long int dp[3123][3123], n, s, v[3123]; // dp[i][j]:sum:2^(n-k)*(i-1番目まで見てk個使って合計がjになる個数) // dp[i+1][j]=dp[i][j-v[i]]/2+dp[i][j] // 初期値はdp[0][0]=2^n const int MOD = 998244353; int pw(int n, int k) { assert(k >= 0); int res = 1; while (k) { if (k ...
#include <bits/stdc++.h> using namespace std; #define int long long int dp[3123][3123], n, s, v[3123]; // dp[i][j]:sum:2^(n-k)*(i-1番目まで見てk個使って合計がjになる個数) // dp[i+1][j]=dp[i][j-v[i]]/2+dp[i][j] // 初期値はdp[0][0]=2^n const int MOD = 998244353; int pw(int n, int k) { assert(k >= 0); int res = 1; while (k) { if (k ...
replace
27
28
27
29
TLE
p02662
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; typedef priority_queue...
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; typedef priority_queue...
replace
63
64
63
64
0
p02662
C++
Runtime Error
// Problem : F - Knapsack for All Subsets // Contest : AtCoder - AtCoder Beginner Contest 169 // URL : https://atcoder.jp/contests/abc169/tasks/abc169_f // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; // #in...
// Problem : F - Knapsack for All Subsets // Contest : AtCoder - AtCoder Beginner Contest 169 // URL : https://atcoder.jp/contests/abc169/tasks/abc169_f // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; // #in...
insert
96
96
96
98
0
p02662
Python
Time Limit Exceeded
MOD = 998244353 n, s = map(int, input().split()) a = list(map(int, input().split())) f = [0] * (s + 1) f[0] = pow(2, n, MOD) v = pow(2, MOD - 2, MOD) for i in range(n): for j in range(s, a[i] - 1, -1): f[j] += f[j - a[i]] * v for j in range(s + 1): f[j] %= MOD print(f[s])
MOD = 998244353 n, s = map(int, input().split()) a = list(map(int, input().split())) f = [0] * (s + 1) f[0] = pow(2, n, MOD) v = pow(2, MOD - 2, MOD) for x in a: for j in range(s, x - 1, -1): f[j] += f[j - x] * v for j in range(s + 1): f[j] %= MOD print(f[s])
replace
6
9
6
9
TLE
p02662
Python
Runtime Error
import numpy as np import sys input = sys.stdin.readline def main(): n, s = map(int, input().split()) A = [int(i) for i in input().split()] MOD = 998244353 dp = np.zeros(s + 1, dtype="int32") dp[0] = 1 for a in A: p = (dp * 2) % MOD p %= MOD p[a:] += dp[:a] ...
import numpy as np import sys input = sys.stdin.readline def main(): n, s = map(int, input().split()) A = [int(i) for i in input().split()] MOD = 998244353 dp = np.zeros(s + 1, dtype="int32") dp[0] = 1 for a in A: p = (dp * 2) % MOD p %= MOD p[a:] += dp[:-a] ...
replace
18
19
18
19
TLE
p02662
Python
Runtime Error
def resolve(): n, s = map(int, input().split()) a = list(map(int, input().split())) mod = 998244353 dp = [0] * (s + 1) dp[0] = 1 for i in a: for j in range(s - i, -1, -1): dp[j + i] = dp[j + i] * 2 + dp[j] dp[j + i] %= mod for j in range(min(i, s + 2)): ...
def resolve(): n, s = map(int, input().split()) a = list(map(int, input().split())) mod = 998244353 dp = [0] * (s + 1) dp[0] = 1 for i in a: for j in range(s - i, -1, -1): dp[j + i] = dp[j + i] * 2 + dp[j] dp[j + i] %= mod for j in range(min(i, s + 1)): ...
replace
10
11
10
11
0
p02662
C++
Runtime Error
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
replace
48
49
48
49
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const int N = 3e3 + 23; const int mod = 998244353; long long dp[N][N]; int a[N]; void ...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const int N = 3e3 + 23; const int mod = 998244353; long long dp[N][N]; int a[N]; void ...
replace
31
32
31
32
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; } template <class T> void chmax(T &a, const T &b) noexcep...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; } template <class T> void chmax(T &a, const T &b) noexcep...
replace
78
79
78
80
0
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; } #define REP(i, n) for (int i = 0; i < n; ++i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; } #define REP(i, n) for (int i = 0; i < n; ++i...
insert
150
150
150
152
TLE
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #if 1 // 折り畳み用 //------------------------------------------------------------ using ll = long long; #define int ll #define FOR(i, s, e) for (ll i = ll(s); i < (ll)e; ++i) #define RFOR(i, s, e) for (ll i = ll(e) - 1; i >= ll(s); --i) #define REP(i, n) for (ll i = 0, i##_si...
#include <bits/stdc++.h> using namespace std; #if 1 // 折り畳み用 //------------------------------------------------------------ using ll = long long; #define int ll #define FOR(i, s, e) for (ll i = ll(s); i < (ll)e; ++i) #define RFOR(i, s, e) for (ll i = ll(e) - 1; i >= ll(s); --i) #define REP(i, n) for (ll i = 0, i##_si...
insert
137
137
137
140
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define DEBUG(...) #endif template <class T, class Op = multiplies<T>> constexpr T power(T a, long long n, Op op = Op(), T e = {1}) { assert(n >= 0); while (n) { if (n & 1) e = op(e, a); if (n >>= 1) a = op(a, ...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define DEBUG(...) #endif template <class T, class Op = multiplies<T>> constexpr T power(T a, long long n, Op op = Op(), T e = {1}) { assert(n >= 0); while (n) { if (n & 1) e = op(e, a); if (n >>= 1) a = op(a, ...
replace
62
63
62
63
0
p02662
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll MOD = 998244353; ll DP[3000][3000]; // A の部分集合 T、Tの部分集合 U で数える int main() { int N, S; cin >> N >> S; vector<ll> A(N); REP(i, N) cin >> A[i]; DP[0][...
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll MOD = 998244353; ll DP[3001][3001]; // A の部分集合 T、Tの部分集合 U で数える int main() { int N, S; cin >> N >> S; vector<ll> A(N); REP(i, N) cin >> A[i]; DP[0][...
replace
9
10
9
10
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 3e3 + 5; const int INF = 0x7f7f7f7f; const ll p = 998244353; #define DEBUG(x) cout << x << '\n' int n, s, t, f[MAXN]; ll f_pow(ll a, ll b) { ll res = 1; for (; b; b >>= 1, a = a * a % p) if (b & 1) res = res * a % p; r...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 3e3 + 5; const int INF = 0x7f7f7f7f; const ll p = 998244353; #define DEBUG(x) cout << x << '\n' int n, s, t, f[MAXN]; ll f_pow(ll a, ll b) { ll res = 1; for (; b; b >>= 1, a = a * a % p) if (b & 1) res = res * a % p; r...
replace
27
28
27
28
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long N = 1e3 + 5, M = 998244353, OO = 0x3f3f3f3f; typedef long long ll; #define FIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); const double Pi...
#include <bits/stdc++.h> using namespace std; const long long N = 3e3 + 5, M = 998244353, OO = 0x3f3f3f3f; typedef long long ll; #define FIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); const double Pi...
replace
2
3
2
3
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(s, i, n) for (int i = s; i n; i++) typedef long long ll; const int INF = 1e9; // 1000 mb = 1e9 b = 2.5e8 intergers const int MOD = 998244353; ll dp[3000][7000] = {{0}}; // ans up to i and n = i ll dp2[3000][7000] = {{0}}; // solCnt up to i ll binPow(ll x, ll...
#include <bits/stdc++.h> using namespace std; #define FOR(s, i, n) for (int i = s; i n; i++) typedef long long ll; const int INF = 1e9; // 1000 mb = 1e9 b = 2.5e8 intergers const int MOD = 998244353; ll dp[3005][7000] = {{0}}; // ans up to i and n = i ll dp2[3005][7000] = {{0}}; // solCnt up to i ll binPow(ll x, ll...
replace
10
12
10
12
-11
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 998244353; const int MAX_N = 305; int N, S; int A[MAX_N]; ll dp[MAX_N][MAX_N]; // len, sum ll powmod(ll x, int y) { ll res = 1; while (y) { if (y & 1) (res *= x) %= MOD; (x *= x) %= MOD; y >>= 1; } return re...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 998244353; const int MAX_N = 3005; int N, S; int A[MAX_N]; ll dp[MAX_N][MAX_N]; // len, sum ll powmod(ll x, int y) { ll res = 1; while (y) { if (y & 1) (res *= x) %= MOD; (x *= x) %= MOD; y >>= 1; } return r...
replace
5
6
5
6
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define dl double #define mp make_pair #define pb push_back using namespace std; //*********************************************************************** // hash struct for unordered_map struct hash_pair { template <class T1, class T2> size_t operator()(const pair<T1, ...
#include <bits/stdc++.h> #define ll long long #define dl double #define mp make_pair #define pb push_back using namespace std; //*********************************************************************** // hash struct for unordered_map struct hash_pair { template <class T1, class T2> size_t operator()(const pair<T1, ...
replace
38
39
38
39
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using vvl = vector<vl>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define per(i, n) for (int i = (n)-1; i >= 0; --i) #define rng(i, a, b) for (int i = (a); i < (b); ++i) #define all(a) (a).begin(), (a).end() const int mod ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using vvl = vector<vl>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define per(i, n) for (int i = (n)-1; i >= 0; --i) #define rng(i, a, b) for (int i = (a); i < (b); ++i) #define all(a) (a).begin(), (a).end() const int mod ...
replace
21
22
21
22
0
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigne...
#include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigne...
replace
2,088
2,089
2,088
2,095
TLE
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define MAX (ll)(1e3 + 7) #define INF (ll)(4e18) #define MOD (ll)(998244353) using namespace std; using ll = long long; using cd = complex<double>; int dp[MAX][MAX]; int mult(int a, int b) { return (a * 1LL * b) % MOD; } int add(int a, int b) { return (a + b) % MOD; } int pw(int a, int b) {...
#include <bits/stdc++.h> #define MAX (ll)(3e3 + 7) #define INF (ll)(4e18) #define MOD (ll)(998244353) using namespace std; using ll = long long; using cd = complex<double>; int dp[MAX][MAX]; int mult(int a, int b) { return (a * 1LL * b) % MOD; } int add(int a, int b) { return (a + b) % MOD; } int pw(int a, int b) {...
replace
1
2
1
2
0
p02662
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <s...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <s...
replace
114
115
114
115
0
p02662
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<VVI> VVVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VLL; typedef vector<VLL> VVLL; typedef vector<VVLL> VVVLL; typedef pair<LL, L...
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<VVI> VVVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VLL; typedef vector<VLL> VVLL; typedef vector<VVLL> VVVLL; typedef pair<LL, L...
replace
199
200
199
200
TLE
p02662
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <vector> #define mkp make_pair #define mkt make_tuple #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const l...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <vector> #define mkp make_pair #define mkt make_tuple #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const l...
replace
92
93
92
93
0
p02662
C++
Runtime Error
#include <iostream> using namespace std; const long long INIT = -1; const long long MOD = 998244353; long long dp[3001][3001]; int _array[3005]; long long fact[3005]; long long dfs(int n, int value); int main() { int n; int sum; cin >> n >> sum; fact[0] = 1; for (int i = 1; i <= n; i++) { cin >> _array[i]...
#include <iostream> using namespace std; const long long INIT = -1; const long long MOD = 998244353; long long dp[3001][3001]; int _array[3005]; long long fact[3005]; long long dfs(int n, int value); int main() { int n; int sum; cin >> n >> sum; fact[0] = 1; for (int i = 1; i <= n; i++) { cin >> _array[i]...
replace
40
42
40
44
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) #define show(x) \ { \ for (auto i : x) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) #define show(x) \ { \ for (auto i : x) { ...
replace
75
76
75
76
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02662
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll MOD = 998244353; // あとで S+1 までループを回しているため ll DP[3000][3001]; // A の部分集合 T、Tの部分集合 U で数える int main() { int N, S; cin >> N >> S; vector<ll> A(N); REP(i, ...
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll MOD = 998244353; // あとで S+1 までループを回しているため ll DP[3001][3001]; // A の部分集合 T、Tの部分集合 U で数える int main() { int N, S; cin >> N >> S; vector<ll> A(N); REP(i, ...
replace
10
11
10
11
0
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3010; const int mod = 998244353; int n, s; ll arr[N], dp[N][N]; bool vis[N][N]; ll fun(int pos, int rem) { if (pos > n) { if (rem == 0) return 1; return 0; } ll &ret = dp[pos][rem]; if (vis[pos][rem]) return re...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3010; const int mod = 998244353; int n, s; ll arr[N], dp[N][N]; bool vis[N][N]; ll fun(int pos, int rem) { if (pos > n) { if (rem == 0) return 1; return 0; } ll &ret = dp[pos][rem]; if (vis[pos][rem]) return re...
insert
19
19
19
20
TLE
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n, s; ll a[3003], dp[3003]; const ll mod = 998244353; int main(void) { scanf("%lld%lld", &n, &s); for (ll i = 0; i < n; i++) scanf("%lld", &a[i]); dp[0] = 1; for (ll i = 0; i < n; i++) { for (ll j = s; j >= 0; j--) { dp[j + a[i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n, s; ll a[3003], dp[6003]; const ll mod = 998244353; int main(void) { scanf("%lld%lld", &n, &s); for (ll i = 0; i < n; i++) scanf("%lld", &a[i]); dp[0] = 1; for (ll i = 0; i < n; i++) { for (ll j = s; j >= 0; j--) { dp[j + a[i...
replace
4
5
4
5
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const static ll INF = 1e15; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // __uint128_t const static ll MOD = 998244353; long long modpow(long long a, long long n, long long mod = MOD) { long long res = 1; while (n > 0) { if (n & 1) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const static ll INF = 1e15; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // __uint128_t const static ll MOD = 998244353; long long modpow(long long a, long long n, long long mod = MOD) { long long res = 1; while (n > 0) { if (n & 1) ...
replace
24
25
24
25
0
p02662
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long int lli; const lli mod = 998244353; vector<lli> solve(int b, int e, lli s, vector<lli> &a) { vector<lli> res(s + 1, 0); if (e - b == 1) { res[0] = 2; if (a[b] <= s) { res[a[b]] = 1; } ...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long int lli; const lli mod = 998244353; vector<lli> solve(int b, int e, lli s, vector<lli> &a) { vector<lli> res(s + 1, 0); if (e - b == 1) { res[0] = 2; if (a[b] <= s) { res[a[b]] = 1; } ...
replace
44
46
44
59
TLE
p02662
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const ll mod = 998244353; int main() { int n, s; cin >> n >> s; vector<vector<ll>> dp(n, vector<ll>(s + 5)); vector<int> a(n); rep(i, n) cin >> a[i]; dp[0][0] = 2; d...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const ll mod = 998244353; int main() { int n, s; cin >> n >> s; vector<vector<ll>> dp(n, vector<ll>(3005)); vector<int> a(n); rep(i, n) cin >> a[i]; dp[0][0] = 2; dp...
replace
10
11
10
11
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define ld long double #define f first #define s second #define pb push_back #define eb emplace_back #define mk make_pair #define mt make_tuple #define MOD 998244353 #define fo(i, a, b) for (i = a; i < b; i++) #define foe(i, a, b) for (i = a; i <= b; i++) #define all(x)...
#include <bits/stdc++.h> #define ll long long int #define ld long double #define f first #define s second #define pb push_back #define eb emplace_back #define mk make_pair #define mt make_tuple #define MOD 998244353 #define fo(i, a, b) for (i = a; i < b; i++) #define foe(i, a, b) for (i = a; i <= b; i++) #define all(x)...
replace
54
55
54
55
0
p02662
C++
Runtime Error
// Copyright © 2020 Diego Garcia Rodriguez del Campo. All rights reserved. #include <bits/stdc++.h> #define MAX 3005 #define optimiza_io \ cin.tie(0); \ ios_base::sync_with_stdio(0); #define ...
// Copyright © 2020 Diego Garcia Rodriguez del Campo. All rights reserved. #include <bits/stdc++.h> #define MAX 3005 #define optimiza_io \ cin.tie(0); \ ios_base::sync_with_stdio(0); #define ...
insert
23
23
23
25
0
p02662
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
insert
76
76
76
80
0
p02662
C++
Runtime Error
#include <algorithm> #include <chrono> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #...
#include <algorithm> #include <chrono> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #...
replace
97
100
97
103
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("O3") #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i <= n; i++) #define ALL(obj) (obj).begin(), (obj).end()...
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("O3") #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i <= n; i++) #define ALL(obj) (obj).begin(), (obj).end()...
replace
77
78
77
79
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using llong = long long; using ldbl = long double; using lpair = pair<llong, llong>; #define ALL(x) x.begin(), x.end() template <typename T> constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7; constexpr llong mod = 99...
#include <bits/stdc++.h> using namespace std; using llong = long long; using ldbl = long double; using lpair = pair<llong, llong>; #define ALL(x) x.begin(), x.end() template <typename T> constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7; constexpr llong mod = 99...
replace
49
50
49
52
0
p02662
C++
Time Limit Exceeded
/*input 3 4 2 2 4 */ /* ______________ | ) | ) / |______/ ...
/*input 3 4 2 2 4 */ /* ______________ | ) | ) / |______/ ...
replace
134
135
134
135
TLE
p02662
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string.h> #include...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string.h> #include...
replace
188
189
188
189
0
p02662
C++
Runtime Error
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
replace
48
49
48
49
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fr(i, n) for (int i = 0; i < n; i++) #define sz(v) (v).begin(), (v).end() #define prin(a) cout << #a << " = " << a << endl #define all(v) (v).begin(), (v).end() typedef long long ll; const int N = 2e3 + 10; ll dp[2][N], v[N]; #define cur_dp dp[(i + 1) & 1] #define...
#include <bits/stdc++.h> using namespace std; #define fr(i, n) for (int i = 0; i < n; i++) #define sz(v) (v).begin(), (v).end() #define prin(a) cout << #a << " = " << a << endl #define all(v) (v).begin(), (v).end() typedef long long ll; const int N = 3e3 + 10; ll dp[2][N], v[N]; #define cur_dp dp[(i + 1) & 1] #define...
replace
9
10
9
10
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long MOD = 998244353; long long pow(long long x, long long n, long long mod) { long long ans = 1; while (n) { if (n % 2) ans *= x; x *= x; x %= mod; ans %= mod; n >>= 1; } return ans; } long long inv = pow(2, MOD - 2, MOD); l...
#include <bits/stdc++.h> using namespace std; const long long MOD = 998244353; long long pow(long long x, long long n, long long mod) { long long ans = 1; while (n) { if (n % 2) ans *= x; x *= x; x %= mod; ans %= mod; n >>= 1; } return ans; } long long inv = pow(2, MOD - 2, MOD); l...
replace
29
30
29
30
0
p02662
C++
Runtime Error
#include <bits/stdc++.h> #define FORR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (b); i >= (a); --i) #define REPP(i, a, b) for (int i = (a); i < (b); ++i) #define REPD(i, a, b) for (int i = (b); i > (a); --i) #define fi first #define se second #define mp make_pair #define pb push_back ...
#include <bits/stdc++.h> #define FORR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (b); i >= (a); --i) #define REPP(i, a, b) for (int i = (a); i < (b); ++i) #define REPD(i, a, b) for (int i = (b); i > (a); --i) #define fi first #define se second #define mp make_pair #define pb push_back ...
replace
42
43
42
43
0
p02662
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int A[3005]; long long memo[3005][3005]; const long long modConst = 998244353; long long DP(int N, int S) { if (S < 0) return 0; if (N == 0 && S == 0) return 1; if (N == 0) return 0; if (memo[N][S] != -1) return memo[N][S]; long long putToBo...
#include <bits/stdc++.h> using namespace std; int A[3005]; long long memo[3005][3005]; const long long modConst = 998244353; long long DP(int N, int S) { if (S < 0) return 0; if (N == 0 && S == 0) return 1; if (N == 0) return 0; if (memo[N][S] != -1) return memo[N][S]; long long putToBo...
replace
25
26
25
27
TLE
p02663
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int H[2], M[2], K; cin >> H[1] >> M[1] >> H[2] >> M[2] >> K; cout << 60 * (H[2] - H[1]) + M[2] - M[1] - K << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int H, M, A, B, K; cin >> H >> M >> A >> B >> K; cout << 60 * (A - H) + B - M - K << endl; }
replace
4
7
4
7
-6
*** stack smashing detected ***: terminated
p02663
C++
Runtime Error
#include <iostream> using namespace std; int main() { int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int diff = (h2 * 60 + m2) - (h1 * 60 + m1); // cout<<diff; if ((diff - k) > 0) cout << diff - k; else cout << 0; return 1; }
#include <iostream> using namespace std; int main() { int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int diff = (h2 * 60 + m2) - (h1 * 60 + m1); // cout<<diff; if ((diff - k) > 0) cout << diff - k; else cout << 0; return 0; }
replace
11
12
11
12
1
p02663
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pqgreater(x) x, vector<x>, greater<x> #define decimal(x) cout << fixed << setprecision(x) #define dbg(x) cerr << #x << ": " << x << endl; #define gc ge...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pqgreater(x) x, vector<x>, greater<x> #define decimal(x) cout << fixed << setprecision(x) #define dbg(x) cerr << #x << ": " << x << endl; #define gc ge...
insert
203
203
203
204
TLE
p02664
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { static char T[100001]; scanf("%s", T); size_t len = strlen(T); for (size_t i = 0; i < len; i++) { if (T[i] == '?') { T[i] = 'D'; } } printf("%s\n", T); return 0; }
#include <stdio.h> #include <string.h> int main() { static char T[200001]; scanf("%s", T); size_t len = strlen(T); for (size_t i = 0; i < len; i++) { if (T[i] == '?') { T[i] = 'D'; } } printf("%s\n", T); return 0; }
replace
4
5
4
5
0
p02664
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (long long i = 0; i < t.size(); i++) { if (t.at(i) == '?') { if (t.at(i - 1) == 'P') t.at(i) = 'D'; else t.at(i) = 'P'; } } cout << t << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (int i = 0; i < t.size(); i++) { if (t.at(i) == '?') t.at(i) = 'D'; } cout << t << endl; }
replace
6
13
6
9
0
p02664
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; char s[N]; int n; int main() { scanf("%s", s); n = strlen(s); for (int i = 0; i < n; ++i) if (s[i] == '?') s[i] = 'D'; printf("%s\n", s); }
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; char s[N]; int n; int main() { scanf("%s", s); n = strlen(s); for (int i = 0; i < n; ++i) if (s[i] == '?') s[i] = 'D'; printf("%s\n", s); }
replace
2
3
2
3
0
p02664
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() #define dec(x) cout << fixed << setprecision(x); using namespace std; using ll = long long; using P = pair<ll, ll>; using vl = vector<ll>; using vvl = vector<vl>; int main() { string S; ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() #define dec(x) cout << fixed << setprecision(x); using namespace std; using ll = long long; using P = pair<ll, ll>; using vl = vector<ll>; using vvl = vector<vl>; int main() { string S; ...
replace
17
22
17
18
0
p02664
C++
Runtime Error
#include <bits/stdc++.h> #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ll long long #define pb push_back #define eb emplace_back #define mp make_pair #define pii pair<ll, ll> #define vi vector<ll> #define vii vector<pi...
#include <bits/stdc++.h> #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ll long long #define pb push_back #define eb emplace_back #define mp make_pair #define pii pair<ll, ll> #define vi vector<ll> #define vii vector<pi...
replace
27
28
27
28
0
p02664
C++
Runtime Error
// #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma warning(disable : 4786) #pragma warning(disable : 4996) #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #includ...
// #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma warning(disable : 4786) #pragma warning(disable : 4996) #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #includ...
replace
69
70
69
70
0
Time = 0.000173
p02664
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; char p[200010]; char a[200010]; int main() { int i; scanf("%s", p); for (i = 0; i < strlen(p); i++) { if (p[i] == '?') a[i] = 'D'; else a[i] = p[i]; } printf("%s", a); }
#include <bits/stdc++.h> using namespace std; char p[200010]; char a[200010]; int main() { int i = 0; char ps; while (scanf("%c", &ps) != EOF) { if (ps == '?') { a[i++] = 'D'; } else a[i++] = ps; } printf("%s", a); }
replace
5
12
5
12
TLE
p02664
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string T; cin >> T; ll count = 0; for (ll i = 0; i < (int)T.size(); i++) { if (i != (int)T.size() - 1 && T.at(i) == '?' && T.at(i + 1) == '?') { count++; } } for (ll j = 0; j < count + 2; j++) { for (ll i ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string T; cin >> T; ll count = 0; for (ll i = 0; i < (int)T.size(); i++) { if (T.at(i) == '?') { T.at(i) = 'D'; } } for (ll i = 0; i < (int)T.size(); i++) { cout << T.at(i); } }
replace
10
27
10
12
TLE
p02664
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; if (t.at(0) == '?' && t.at(1) == 'P') t.at(0) = 'D'; else t.at(0) = 'P'; for (int i = 1; i < t.size() - 1; i++) { if (t.at(i) == '?') { if (t.at(i + 1) == 'D' && t.at(i - 1) == 'D') t.at(i) = 'P'; ...
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; if (t.size() == 1) { if (t.at(0) == 'P') t.at(0) = 'P'; else t.at(0) = 'D'; } if (t.at(0) == '?' && t.size() > 1) { if (t.at(1) == 'P') t.at(0) = 'D'; else t.at(0) = 'P'; } for (int i...
replace
7
11
7
20
0
p02664
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; char cc[200010]; int main() { cin >> cc; int i, j, k, l; for (i = 0; i < strlen(cc); i++) { if (cc[i] == '?') { cout << "D"; } else cout << cc[i]; } }
#include <bits/stdc++.h> using namespace std; char cc[200010]; int main() { scanf("%s", cc); int i, j, k, l = strlen(cc); for (i = 0; i < l; i++) { if (cc[i] == '?') { cout << "D"; } else cout << cc[i]; } }
replace
4
7
4
7
TLE
p02664
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string t; cin >> t; for (int i = 0; i < t.size(); i++) { if (t.at(i) == '?') { if (t.at(i + 1) == 'P') t.at(i) = 'D'; else if (t.at(i + 1) == 'D') t.at(i) = 'P'; else { t.at(i) = 'P'; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string t; cin >> t; int s = t.size(); for (int i = 0; i < s; i++) { if (t.at(i) == '?') t.at(i) = 'D'; } cout << t << endl; }
replace
7
19
7
11
0
p02664
C++
Runtime Error
#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #includ...
#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic #includ...
replace
47
48
47
48
0