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
p02757
C++
Runtime Error
#include <bits/stdc++.h> #define per(i, a, n) for (int i = a; i <= n; i++) #define ls l + mid >> 1 #define rs mid + 1 + r >> 1 using namespace std; typedef long long ll; int vp[10010]; char s[10010]; int main() { int n, p; cin >> n >> p; ll ans = 0; scanf("%s", s + 1); ll kk = 1, an = 0; vp[0] = 1; if (p ...
#include <bits/stdc++.h> #define per(i, a, n) for (int i = a; i <= n; i++) #define ls l + mid >> 1 #define rs mid + 1 + r >> 1 using namespace std; typedef long long ll; int vp[10010]; char s[200010]; int main() { int n, p; cin >> n >> p; ll ans = 0; scanf("%s", s + 1); ll kk = 1, an = 0; vp[0] = 1; if (p...
replace
7
8
7
8
0
p02757
C++
Runtime Error
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
replace
77
78
77
78
0
p02757
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long n, p; char s[100010]; map<long, long> mp; int main() { cin >> n >> p; cin >> s; long long ans = 0; if (10 % p == 0) { for (int i = 0; i < n; i++) { if ((s[i] - '0') % p == 0) ans += i + 1; } } else { // 从低位往上搞 long long res ...
#include <bits/stdc++.h> using namespace std; long long n, p; char s[200010]; map<long, long> mp; int main() { cin >> n >> p; cin >> s; long long ans = 0; if (10 % p == 0) { for (int i = 0; i < n; i++) { if ((s[i] - '0') % p == 0) ans += i + 1; } } else { // 从低位往上搞 long long res ...
replace
3
4
3
4
0
p02757
C++
Runtime Error
#include <stdlib.h> #include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using default_counter_t = int; // macro #define let auto const & #define overload4(a, b, c, d, name, ...) name #define rep1(n) \ for (...
#include <stdlib.h> #include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using default_counter_t = int; // macro #define let auto const & #define overload4(a, b, c, d, name, ...) name #define rep1(n) \ for (...
replace
163
164
163
164
0
p02757
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; // P と 10が互いに素でない場合, // つまりP=2 または P=5の場合、フェルマーの小定理や、 // その他逆元を高速に演算する手法が使えなさそうなので注意 // https://twitter.com/satanic0258/status/1236285593677520896 int N; ll P; const int MAX_N = 200; string S; ll C[MAX_N]; void solve_2() { ll res = 0; for (int i ...
#include <bits/stdc++.h> using namespace std; using ll = long long; // P と 10が互いに素でない場合, // つまりP=2 または P=5の場合、フェルマーの小定理や、 // その他逆元を高速に演算する手法が使えなさそうなので注意 // https://twitter.com/satanic0258/status/1236285593677520896 int N; ll P; const int MAX_N = 200100; string S; ll C[MAX_N]; void solve_2() { ll res = 0; for (int...
replace
10
11
10
11
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define pb push_back #define vi vector<ll int> #define all(a) (a).begin(), (a).end() #define F first #define S second #define rs(v, n) v.resize(n) #define hell 998244...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define pb push_back #define vi vector<ll int> #define all(a) (a).begin(), (a).end() #define F first #define S second #define rs(v, n) v.resize(n) #define hell 998244...
replace
50
51
50
51
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; int n; pair<int, int> p[1000001]; int t[100001 * 4]; int far[100001]; int dp[100001]; void update(int x, int st, int ed, int pos, int ind) { if (st == ed) { t[x] = ind; return; } int mid = (st + ed) / 2; if (p...
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; int n; pair<int, int> p[200001]; int t[200001 * 4]; int far[200001]; int dp[200001]; void update(int x, int st, int ed, int pos, int ind) { if (st == ed) { t[x] = ind; return; } int mid = (st + ed) / 2; if (po...
replace
5
9
5
9
0
p02758
C++
Runtime Error
#include <algorithm> #include <cassert> #include <chrono> #include <cstring> #include <iostream> #include <map> #include <random> #include <set> #include <string> using namespace std; typedef long long ll; const ll mod = 998244353; int t[500000]; int Max(int v, int tl, int tr, int l, int r) { if (l > r) retur...
#include <algorithm> #include <cassert> #include <chrono> #include <cstring> #include <iostream> #include <map> #include <random> #include <set> #include <string> using namespace std; typedef long long ll; const ll mod = 998244353; int t[200 * 1001 * 4]; int Max(int v, int tl, int tr, int l, int r) { if (l > r) ...
replace
15
16
15
16
0
p02758
C++
Time Limit Exceeded
// ----------------------------------- // Author : MatsuTaku // Affiliation: Tokushima University // Country : Japan // Date : 07/03/2020 // ----------------------------------- #include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> class max_segment_tree { size_t mpt...
// ----------------------------------- // Author : MatsuTaku // Affiliation: Tokushima University // Country : Japan // Date : 07/03/2020 // ----------------------------------- #include <bits/stdc++.h> using namespace std; using ll = long long; template <typename T> class max_segment_tree { size_t mpt...
delete
29
30
29
29
TLE
p02758
C++
Runtime Error
#include <bits/stdc++.h> #define maxn 100001 #define maxa 2000005 #define MOD 998244353 // 1000000007 #define INF 1000000000000000000 using namespace std; #define ll long long #define pii pair<ll, ll> #define piii pair<pii, ll> #define ft first #define sd second #define pb push_back #define rep(i, n) for (ll i = 0; i...
#include <bits/stdc++.h> #define maxn 100001 #define maxa 2000005 #define MOD 998244353 // 1000000007 #define INF 1000000000000000000 using namespace std; #define ll long long #define pii pair<ll, ll> #define piii pair<pii, ll> #define ft first #define sd second #define pb push_back #define rep(i, n) for (ll i = 0; i...
replace
73
74
73
74
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = (a); i <= (b); ++i) #define rv(i, a, b) for (int i = (a); i >= (b); --i) #define ls (rt << 1) #define rs (rt << 1 | 1) using namespace std; const int M = 220000; typedef long long ll; int n, m, k; char s[M]; int c[M] = {0}; int nx[M]; struct node { int x, d; ...
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = (a); i <= (b); ++i) #define rv(i, a, b) for (int i = (a); i >= (b); --i) #define ls (rt << 1) #define rs (rt << 1 | 1) using namespace std; const int M = 220000; typedef long long ll; int n, m, k; char s[M]; int c[M] = {0}; int nx[M]; struct node { int x, d; ...
replace
16
17
16
17
0
p02758
C++
Time Limit Exceeded
#include <bits/stdc++.h> using ll = long long int; using P = std::pair<int, int>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rag(con) std::begin(con), std::end(con) constexpr ll mod = 998244353; ll pow(ll x, ll m) { ll re = 1, y = 1; for (int i = 0; i < 60; ++i) { if (m & y) re = re * x...
#include <bits/stdc++.h> using ll = long long int; using P = std::pair<int, int>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rag(con) std::begin(con), std::end(con) constexpr ll mod = 998244353; ll pow(ll x, ll m) { ll re = 1, y = 1; for (int i = 0; i < 60; ++i) { if (m & y) re = re * x...
insert
64
64
64
66
TLE
p02758
C++
Runtime Error
#include <algorithm> #include <cstdio> #define mod 998244353LL #define N (20 + 5) typedef long long ll; struct robot { int l, d; friend bool operator<(robot a, robot b) { return a.l < b.l || (a.l == b.l && a.d > b.d); } } a[N]; int p[N], fir[N], nxt[N]; ll f[N]; void dfs(int x) { f[x] = 1LL; for (int i...
#include <algorithm> #include <cstdio> #define mod 998244353LL #define N (200000 + 5) typedef long long ll; struct robot { int l, d; friend bool operator<(robot a, robot b) { return a.l < b.l || (a.l == b.l && a.d > b.d); } } a[N]; int p[N], fir[N], nxt[N]; ll f[N]; void dfs(int x) { f[x] = 1LL; for (i...
replace
4
5
4
5
0
p02758
C++
Runtime Error
/* DATE: 2020-03-11 11:08:25 NAME: PROBLEM: ABC158F */ #include <bits/stdc++.h> using namespace std; const int MAXN = 1e5; int x[MAXN + 7]; int d[MAXN + 7]; int xd[MAXN + 7]; int dp[MAXN + 7]; const int MOD = 998244353; int add(long long x, long long y) { return ((x % MOD) + (y % MOD)) % M...
/* DATE: 2020-03-11 11:08:25 NAME: PROBLEM: ABC158F */ #include <bits/stdc++.h> using namespace std; const int MAXN = 2e5; int x[MAXN + 7]; int d[MAXN + 7]; int xd[MAXN + 7]; int dp[MAXN + 7]; const int MOD = 998244353; int add(long long x, long long y) { return ((x % MOD) + (y % MOD)) % M...
replace
9
10
9
10
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second #define mkp make_pair #define pii pair<int, int> typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 2e5 + 5; const int mod = 998244353; ll tree[maxn]; void build(int o, int l, int r) { tree[o] = 0; if...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second #define mkp make_pair #define pii pair<int, int> typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 2e5 + 5; const int mod = 998244353; ll tree[maxn << 2]; void build(int o, int l, int r) { tree[o] = 0;...
replace
11
12
11
12
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; typedef vector<ll> vll; typedef vector<ld> vld; typedef vector<pll> vpl; #define ALL(a) a.begin(), a.end() #define SZ(a) ((int)a.size()) #define F...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; typedef vector<ll> vll; typedef vector<ld> vld; typedef vector<pll> vpl; #define ALL(a) a.begin(), a.end() #define SZ(a) ((int)a.size()) #define F...
replace
37
38
37
38
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1LL...
#include <bits/stdc++.h> using namespace std; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1LL...
replace
102
103
102
103
0
p02758
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vs = ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vs = ...
replace
116
117
116
121
TLE
p02758
C++
Runtime Error
#include "bits/stdc++.h" #define FI first.first #define SE first.second #define TH second #define fi first #define se second #define th second using namespace std; void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_...
#include "bits/stdc++.h" #define FI first.first #define SE first.second #define TH second #define fi first #define se second #define th second using namespace std; void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_...
replace
37
38
37
38
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> #define f(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> #define F first #define S second #define int long long #define mod 1000000007 #define mmod 998244353 #define all(v) v.begin(), v.end() using namespace std; int mypow(int a, int b, int c) { if (b == 0) return 1; if (b %...
#include <bits/stdc++.h> #define f(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> #define F first #define S second #define int long long #define mod 1000000007 #define mmod 998244353 #define all(v) v.begin(), v.end() using namespace std; int mypow(int a, int b, int c) { if (b == 0) return 1; if (b %...
replace
18
20
18
20
0
p02758
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> using namespace std; typedef long long LL; const int SIZEN = 200010; const int mod = 998244353; struct Robot { int x, d; } r[SIZEN]; int R[SIZEN]; int N; int tmp[SIZEN]; int cnt = 0; int mx[SIZEN] = {0}; void chan...
#include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <queue> #include <set> using namespace std; typedef long long LL; const int SIZEN = 200010; const int mod = 998244353; struct Robot { int x, d; } r[SIZEN]; int R[SIZEN]; int N; int tmp[SIZEN]; int cnt = 0; int mx[SIZEN << 2] = {0}; void...
replace
17
18
17
18
0
p02758
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #inc...
#include <algorithm> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #inc...
replace
31
32
31
32
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 998244353 pair<int, int> arr[100005]; int dp[100005]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d %d", &arr[i].first, &arr[i].second); sort(arr, arr + n); dp[n] = 1; stack<pair<int, int>> s; s.push({2e9, n}); fo...
#include <bits/stdc++.h> using namespace std; #define mod 998244353 pair<int, int> arr[200005]; int dp[200005]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d %d", &arr[i].first, &arr[i].second); sort(arr, arr + n); dp[n] = 1; stack<pair<int, int>> s; s.push({2e9, n}); fo...
replace
3
5
3
5
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = a; i <= b; i++) #define repr(i, a, b) for (ll i = a; i >= b; i--) const long long mod = 998244353; // Range_Minimum_Query //(0-indexed) const int max_n = 1 << 17; const long long int_max = 1e9 + 7; int nn; long long dat...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = a; i <= b; i++) #define repr(i, a, b) for (ll i = a; i >= b; i--) const long long mod = 998244353; // Range_Minimum_Query //(0-indexed) const int max_n = 300000; const long long int_max = 1e9 + 7; int nn; long long dat[...
replace
8
9
8
9
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define FORR(i, m, n) for (int i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n); #define VSORT(v) sort(v.begin(), v.end()...
replace
18
19
18
19
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 998244353; typedef pair<int, int> P; int dp[123456]; // dp[i]:v[i+1]に干渉しv[i+2]以降に干渉しない通り int a[123456]; // a[i]:v[i]を起動した時に干渉する右端 template <typename T> void chmax(T &a, T b) { if (a < b) a = b; } template <typename T> struct Segm...
#include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 998244353; typedef pair<int, int> P; int dp[223456]; // dp[i]:v[i+1]に干渉しv[i+2]以降に干渉しない通り int a[223456]; // a[i]:v[i]を起動した時に干渉する右端 template <typename T> void chmax(T &a, T b) { if (a < b) a = b; } template <typename T> struct Segm...
replace
5
7
5
7
0
p02758
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
17
15
17
0
p02758
C++
Runtime Error
// Date: 2020-03-08 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef vector<int> VI; typedef pair<LL, LL> pll; typedef pair<int, int> pii; #define FIO \ ios::sync_with_stdio(false); ...
// Date: 2020-03-08 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef vector<int> VI; typedef pair<LL, LL> pll; typedef pair<int, int> pii; #define FIO \ ios::sync_with_stdio(false); ...
replace
24
25
24
25
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define elif else if #define sp setprecision #define pb(x) push_back(x) typedef long long ll; typedef long double ld; typedef ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (int i = x; i <= n; i++) #define rep3(i, x, n) for (int i = x; i >= n; i--) #define elif else if #define sp setprecision #define pb(x) push_back(x) typedef long long ll; typedef long double ld; typedef ...
replace
22
23
22
23
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 100010, P = 998244353; struct Ro { int x, d; } rb[MAXN]; int n, mx, eg, r[MAXN], hd[MAXN], ver[2 * MAXN], nx[2 * MAXN], dp[MAXN], fa[MAXN], val[MAXN * 4]; bool cmp(Ro a, Ro b) { return a.x < b.x; } void modify(int p, int l, int r, int pos, int v) { ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 200010, P = 998244353; struct Ro { int x, d; } rb[MAXN]; int n, mx, eg, r[MAXN], hd[MAXN], ver[2 * MAXN], nx[2 * MAXN], dp[MAXN], fa[MAXN], val[MAXN * 4]; bool cmp(Ro a, Ro b) { return a.x < b.x; } void modify(int p, int l, int r, int pos, int v) { ...
replace
2
3
2
3
0
p02758
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <utility> #include <vector> template <int64_t p> struct Fp { Fp(int64_t n) : n(n % p) {} Fp operator+(const Fp &rhs) { return Fp(n + rhs.n); } Fp operator*(const Fp &rhs) { return Fp(n * rhs.n); } int64_t n; }; constexpr int64_t P = 998244353...
#include <algorithm> #include <cstdio> #include <iostream> #include <utility> #include <vector> template <int64_t p> struct Fp { Fp(int64_t n) : n(n % p) {} Fp operator+(const Fp &rhs) { return Fp(n + rhs.n); } Fp operator*(const Fp &rhs) { return Fp(n * rhs.n); } int64_t n; }; constexpr int64_t P = 998244353...
replace
26
27
26
27
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct dor { dor *l, *r; int sd; void pp() { if (l == NULL && r == NULL) ; else if (l == NULL) sd = r->sd; else if (r == NULL) sd = l->sd; else sd = max(l->sd, r->sd); } } *rt; const int LN = -1e9, NR = 1e9, mod = 998244353...
#include <bits/stdc++.h> using namespace std; struct dor { dor *l, *r; int sd; void pp() { if (l == NULL && r == NULL) ; else if (l == NULL) sd = r->sd; else if (r == NULL) sd = l->sd; else sd = max(l->sd, r->sd); } } *rt; const int LN = -1e9, NR = 1e9, mod = 998244353...
delete
68
69
68
68
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; // const ll mod=1e9+7; const ll mod = 998244353; const ll inf = 5e15; struct query { ll type; // 0=empty, 1=add-sum ,2=set-max ll value; query(ll a = 0, ll b = 0) : type(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll, ll> pll; // const ll mod=1e9+7; const ll mod = 998244353; const ll inf = 5e15; struct query { ll type; // 0=empty, 1=add-sum ,2=set-max ll value; query(ll a = 0, ll b = 0) : type(...
replace
124
125
124
125
-11
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 500001 #define MOD 998244353 int n, m, t[N], mx[N], fa[N], cur, f[N]; map<int, int> id; vector<int> d[N]; struct rua { int d, x, r; void read() { scanf("%d%d", &d, &x); id[d] = id[d + x - 1] = 1; r = d + x - 1; } bool operator<(const rua &t) { ...
#include <bits/stdc++.h> using namespace std; #define N 2000001 #define MOD 998244353 int n, m, t[N], mx[N], fa[N], cur, f[N]; map<int, int> id; vector<int> d[N]; struct rua { int d, x, r; void read() { scanf("%d%d", &d, &x); id[d] = id[d + x - 1] = 1; r = d + x - 1; } bool operator<(const rua &t) {...
replace
2
3
2
3
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<ll>; using vvi = vector<vector<int>>; using vvl = vector<vector<ll>>; int n; vector<pair<ll, ll>> ps; map<ll, int> mp; ll P = 998244353; template <typename T> class tRMQ { vector<T> data; T unit; publ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<ll>; using vvi = vector<vector<int>>; using vvl = vector<vector<ll>>; int n; vector<pair<ll, ll>> ps; map<ll, int> mp; ll P = 998244353; template <typename T> class tRMQ { vector<T> data; T unit; publ...
replace
99
100
99
100
0
p02758
C++
Runtime Error
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; typedef pair<int, int> pii; const int mod = 998244353; pii a[200010]; int nxt[200010]; int dp[200010]; struct Segment_tree { int maxj[200010]; Segment_tree() { memset(maxj, 0, sizeof(maxj)); } void Update(int...
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; typedef pair<int, int> pii; const int mod = 998244353; pii a[200010]; int nxt[200010]; int dp[200010]; struct Segment_tree { int maxj[800010]; Segment_tree() { memset(maxj, 0, sizeof(maxj)); } void Update(int...
replace
15
16
15
16
0
p02758
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; vector<pair<ll, ll>> v; vector<int> x, d; ll dp1[200010], dp[200010], sum = 0, mod = 998244353; ll n, seg[200010], mx = 100000000000000; void built() { for (int i = n - 1; i > 0; i--) { seg[i] = max(seg[i << 1], ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; vector<pair<ll, ll>> v; vector<int> x, d; ll dp1[200010], dp[200010], sum = 0, mod = 998244353; ll n, seg[400010], mx = 100000000000000; void built() { for (int i = n - 1; i > 0; i--) { seg[i] = max(seg[i << 1], ...
replace
8
9
8
9
0
p02758
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
insert
195
195
195
196
TLE
p02758
C++
Runtime Error
// F. #include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; typedef long long LL; const LL MOD = 998244353; struct modll { long long x; modll() {} modll(int _x) : x(_x) {} operator int() const { return (int)x; } modll operator+(int y) { return (x + y + MOD) % M...
// F. #include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; typedef long long LL; const LL MOD = 998244353; struct modll { long long x; modll() {} modll(int _x) : x(_x) {} operator int() const { return (int)x; } modll operator+(int y) { return (x + y + MOD) % M...
replace
69
71
69
71
0
p02758
C++
Runtime Error
// by szh #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define SZ(x) (int((x).size())) #define se second #define ll long long #define pq priority_queue #define MP make_pair #define pii pair<int, int> #define mod 998244353 #define debug(x) cerr << #x << "=" << x << '\n' const int...
// by szh #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define SZ(x) (int((x).size())) #define se second #define ll long long #define pq priority_queue #define MP make_pair #define pii pair<int, int> #define mod 998244353 #define debug(x) cerr << #x << "=" << x << '\n' const int...
replace
15
16
15
16
0
p02758
C++
Time Limit Exceeded
#include <algorithm> #include <stdio.h> int n; long long p = 998244353; long long e = 1000000005; long long x[200000]; long long d[200000]; long long h[200000]; long long m[200000]; long long dp[200001]; long long t[500]; long long y, l, r, lr; long long rmq(long long ll, long long rr) { long long f = 0; long long ...
#include <algorithm> #include <stdio.h> int n; long long p = 998244353; long long e = 1000000005; long long x[200000]; long long d[200000]; long long h[200000]; long long m[200000]; long long dp[200001]; long long t[500]; long long y, l, r, lr; long long rmq(long long ll, long long rr) { long long f = 0; long long ...
insert
31
31
31
32
TLE
p02758
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <vector> #define int long long #define REP(i, n) for (int i = 0; i < n; i++) #define pb push_back #define mp make_pair #define MOD 998244353 #define IDE -1 using namespace std; const int MAX_N = 1 << 17; int n_max, n, d...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <vector> #define int long long #define REP(i, n) for (int i = 0; i < n; i++) #define pb push_back #define mp make_pair #define MOD 998244353 #define IDE -1 using namespace std; const int MAX_N = 1 << 20; int n_max, n, d...
replace
15
16
15
16
0
p02759
C++
Runtime Error
#pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long int ll; typedef long double ld; type...
#pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long int ll; typedef long double ld; type...
delete
121
126
121
121
0
Time elapsed: 0.000304
p02759
Python
Runtime Error
#!/usr/bin/env python3 def main(): N = map(int, open(0).read().split()) print(-(-N // 2)) main()
#!/usr/bin/env python3 def main(): N = int(input()) print(-(-N // 2)) main()
replace
4
5
4
5
TypeError: bad operand type for unary -: 'map'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02759/Python/s289619736.py", line 9, in <module> main() File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02759/Python/s289619736.py", line 6, in main print(-(-N // 2)) TypeError: bad o...
p02759
Python
Runtime Error
n = input() paper = 0 if n % 2 == 0: paper = n / 2 else: paper = n / 2 + 1 print(paper)
n = int(input()) print((n + 1) // 2)
replace
0
7
0
2
TypeError: not all arguments converted during string formatting
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02759/Python/s809156396.py", line 3, in <module> if n % 2 == 0: TypeError: not all arguments converted during string formatting
p02759
Python
Runtime Error
import sys import os def main(): if os.getenv("LOCAL"): sys.stdin = open("input.txt", "r") a = int(sys.stdin.readline().rstrip()) print(int(a // 2 if a % 2 == 0 else a // 2 + 1)) if __name__ == "__main__": main()
import sys import os def main(): if os.getenv("LOCAL"): sys.stdin = open("input.txt", "r") a = int(sys.stdin.readline().rstrip()) print(a // 2 if a % 2 == 0 else a // 2 + 1) if __name__ == "__main__": main()
replace
8
11
8
10
UnboundLocalError: local variable 'a' referenced before assignment
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02759/Python/s654779229.py", line 15, in <module> main() File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02759/Python/s654779229.py", line 11, in main print(int(a // 2 if a % 2 == 0 e...
p02759
C++
Runtime Error
#include <bits/stdc++.h> // definitions #define f first #define s second #define all(x) x.begin(), x.end() #define clr(x) memset(x, 0, sizeof(x)) #define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++) #define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--) #define high(x) __builtin_popcou...
#include <bits/stdc++.h> // definitions #define f first #define s second #define all(x) x.begin(), x.end() #define clr(x) memset(x, 0, sizeof(x)) #define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++) #define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--) #define high(x) __builtin_popcou...
replace
78
82
78
82
0
p02759
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { int N, M; bool f = true; cin >> N >> M; vector<int> s(M), c(M), ans(N); rep(i, M) { cin >> s.at(i) >> c.at(i); ans.at(s.at(i) - 1) = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() int main() { int N; cin >> N; cout << (N + 1) / 2 << endl; }
replace
7
35
7
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 5)
p02759
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define lli long long int #define fr(i, a, b) for (int i = a; i < b; i++) #define bfr(i, a, b) for (int i = a; i >= b; i--) #define fio \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define fr(i, a, b) for (int i = a; i < b; i++) #define bfr(i, a, b) for (int i = a; i >= b; i--) #define fio \ ios_base::sync_with_stdio(false); ...
delete
18
23
18
18
0
p02759
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define M 1000000007 #define pb emplace_back #define f first #define s second #define rep(i, st, ed) for (ll i = st; i < ed; ++i) #define repn(i, st, ed) for (ll i = st; i <= ed; ++i) #define repb(i, ed, st) for (ll i = ed; i >= st; --i) #define all(v) v.begin(), v.end() #d...
#include <bits/stdc++.h> using namespace std; #define M 1000000007 #define pb emplace_back #define f first #define s second #define rep(i, st, ed) for (ll i = st; i < ed; ++i) #define repn(i, st, ed) for (ll i = st; i <= ed; ++i) #define repb(i, ed, st) for (ll i = ed; i >= st; --i) #define all(v) v.begin(), v.end() #d...
replace
69
73
69
73
0
p02759
C++
Runtime Error
#include <cstdio> int main() { int n; scanf("%d", n); printf("%d\n", n + 1 >> 1); return 0; }
#include <cstdio> int main() { int n; scanf("%d", &n); printf("%d\n", n + 1 >> 1); return 0; }
replace
4
5
4
5
-11
p02759
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int ans = (n + 1) / 2; return ans; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int ans = (n + 1) / 2; cout << ans << endl; }
replace
10
11
10
11
3
p02759
C++
Time Limit Exceeded
/** * “Experience is the name everyone gives to their mistakes.” – Oscar Wilde * * author : prodipdatta7 * created : Sunday 01-March, 2020 06:00:48 PM **/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // #pragma GCC optimize("Ofast") // #pragma GC...
/** * “Experience is the name everyone gives to their mistakes.” – Oscar Wilde * * author : prodipdatta7 * created : Sunday 01-March, 2020 06:00:48 PM **/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // #pragma GCC optimize("Ofast") // #pragma GC...
replace
136
137
136
137
TLE
p02759
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define rep(i, s, n) for (int i = s; i < n; i++) #define repeq(i, s, n) for (int i = s; i <= n; i++) #define MOD (int)10e9 + 7 template <typename T> void amax(T &a, T b) { a = a > b ? a : b; } template <typename T> void amin(T &...
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define rep(i, s, n) for (int i = s; i < n; i++) #define repeq(i, s, n) for (int i = s; i <= n; i++) #define MOD (int)10e9 + 7 template <typename T> void amax(T &a, T b) { a = a > b ? a : b; } template <typename T> void amin(T &...
delete
22
27
22
22
0
p02760
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int marked[3][3]; int nums[3][3]; void mark(int num) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) marked[i][j] = (marked[i][j]) | (nums[i][j] == num); } } int main() { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) scan...
#include <bits/stdc++.h> using namespace std; int marked[3][3]; int nums[3][3]; void mark(int num) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) marked[i][j] = (marked[i][j]) | (nums[i][j] == num); } } int main() { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) scan...
replace
43
44
43
44
TLE
p02760
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) cin >> A[i][j]; int M; cin >> M; for (int i = 0; i < M; ++i) { int a; cin >> a; for (int j = 0; j < 3; ++j) fo...
#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) cin >> A[i][j]; int M; cin >> M; for (int i = 0; i < M; ++i) { int a; cin >> a; for (int j = 0; j < 3; ++j) fo...
replace
17
19
17
19
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back #define mp make_pair #define f(i, a, n) for (int i = a; i < (int)n; i++) #define rf(i, n, a) for (int i = n; i >= a; i--) #define F first #define S second #define all(c) (c).begin(), (c).end() #define sz(v) (i...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back #define mp make_pair #define f(i, a, n) for (int i = a; i < (int)n; i++) #define rf(i, n, a) for (int i = n; i >= a; i--) #define F first #define S second #define all(c) (c).begin(), (c).end() #define sz(v) (i...
replace
33
37
33
37
0
p02760
C++
Runtime Error
#include <iostream> using namespace std; int main() { int A[2][2]; int B[2][2] = {0}; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { cin >> A[i][j]; } } int N; cin >> N; int b[N]; int aa, bb, cc; for (int k = 0; k < N; ++k) { aa = k; cin >> b[k]; for (int ii = 0;...
#include <iostream> using namespace std; int main() { int A[3][3]; int B[3][3] = {}; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { cin >> A[i][j]; } } int N; cin >> N; int b[N]; int aa, bb, cc; for (int k = 0; k < N; ++k) { aa = k; cin >> b[k]; for (int ii = 0; ...
replace
3
5
3
5
-6
*** stack smashing detected ***: terminated
p02760
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { vector<vector<int>> bingo; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> bingo.at(i).at(j); } } int n; cin >> n; int b; rep(i, n) { ...
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { vector<vector<int>> bingo(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> bingo.at(i).at(j); } } int n; cin >> n; int...
replace
8
9
8
9
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> vec(8); int N; for (int i = 0; i < 9; i++) { cin >> vec.at(i); } cin >> N; for (int i = 0; i < N; i++) { int x; cin >> x; for (int j = 0; j < 9; j++) { if (x == vec.at(j)) { vec.at(j) = 'a'; } } ...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> vec(9); int N; for (int i = 0; i < 9; i++) { cin >> vec.at(i); } cin >> N; for (int i = 0; i < N; i++) { int x; cin >> x; for (int j = 0; j < 9; j++) { if (x == vec.at(j)) { vec.at(j) = 'a'; } } ...
replace
4
5
4
5
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 8) >= this->size() (which is 8)
p02760
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; #define pb push_back #define popb pop_back #define popf pop_front #define pf push_front #define si size() #define mp make_pair #define mt make_tuple #define F first #define S second #define lb lower_bound...
#include <bits/stdc++.h> typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; #define pb push_back #define popb pop_back #define popf pop_front #define pf push_front #define si size() #define mp make_pair #define mt make_tuple #define F first #define S second #define lb lower_bound...
replace
84
85
84
85
0
p02760
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define PB push_back #define ll long long #define ull unsigned long long #define uint unsigned #define PIE (3.14159265358979323846) #define MOD 10000000...
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define PB push_back #define ll long long #define ull unsigned long long #define uint unsigned #define PIE (3.14159265358979323846) #define MOD 10000000...
replace
40
41
40
41
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3, 0)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } int n; cin >> n; for (int i = 0; i < n; i++) { int b; cin >> b; for (int j = 0; j < 3; j++)...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3, 0)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } int n; cin >> n; for (int i = 0; i < n; i++) { int b; cin >> b; for (int j = 0; j < 3; j++)...
replace
17
19
17
19
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02760
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a[3][3], N, b[N]; cin >> a[0][0] >> a[0][1] >> a[0][2]; cin >> a[1][0] >> a[1][1] >> a[1][2]; cin >> a[2][0] >> a[2][1] >> a[2][2]; cin >> N; for (int i = 0; i < N; i++) { cin >> b[i]; } for (int i = 0; i < N; i++) { for (int j = 0; ...
#include <iostream> using namespace std; int main() { int a[3][3], N, b[N]; cin >> a[0][0] >> a[0][1] >> a[0][2]; cin >> a[1][0] >> a[1][1] >> a[1][2]; cin >> a[2][0] >> a[2][1] >> a[2][2]; cin >> N; for (int i = 0; i < N; i++) { cin >> b[i]; } for (int i = 0; i < N; i++) { for (int j = 0; ...
replace
20
21
20
21
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int A[3][3], B[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A[i][j]; B[i][j] = 0; } } int N; cin >> N; for (int t = 0; t < N; t++) { int b; cin >> b; for (int i = 0; i < N; i++) { ...
#include <bits/stdc++.h> using namespace std; int main(void) { int A[3][3], B[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A[i][j]; B[i][j] = 0; } } int N; cin >> N; for (int t = 0; t < N; t++) { int b; cin >> b; for (int i = 0; i < 3; i++) { ...
replace
16
17
16
17
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); vector<vector<bool>> B(3, vector<bool>(3, false)); for (vector<int> &i : A) for (int &j : i) cin >> j; int N; cin >> N; for (int i = 0; i < N; i++) { int j; cin >> j; for (int k = 0; k...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); vector<vector<bool>> B(3, vector<bool>(3, false)); for (vector<int> &i : A) for (int &j : i) cin >> j; int N; cin >> N; for (int i = 0; i < N; i++) { int j; cin >> j; for (int k = 0; k...
replace
19
20
19
20
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A[i][j]; } } int N; cin >> N; int b[N]; for (int k = 0; k < N; k++) { cin >> b[k]; } for (int k = 0; k < N; k++) { ...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A[i][j]; } } int N; cin >> N; int b[N]; for (int k = 0; k < N; k++) { cin >> b[k]; } for (int k = 0; k < N; k++) { ...
replace
36
37
36
37
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3)); vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } int N; cin >> N; vector<int> b(N); for (int k = 0; k < ...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3)); vector<vector<int>> A(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } int N; cin >> N; vector<int> b(N); for (int k = 0; k < ...
replace
39
40
39
40
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int A[3][3]; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { cin >> A[i][j]; } } vector<vector<bool>> ok(3, vector<bool>(3, false)); int N; cin >> N; for (int k = 0; k < N; ++k) { int b; cin >> b; for (int ...
#include <bits/stdc++.h> using namespace std; int main() { int A[3][3]; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { cin >> A[i][j]; } } vector<vector<bool>> ok(3, vector<bool>(3, false)); int N; cin >> N; for (int k = 0; k < N; ++k) { int b; cin >> b; for (int ...
replace
28
29
28
29
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> s(9); for (int i = 0; i < 9; i++) { cin >> s.at(i); } int n; cin >> n; vector<int> m(n); for (int i = 0; i < n; i++) { cin >> m.at(i); for (int j = 0; j < 9; j++) { if (m.at(i) == s.at(j)) s.at(i) = 0; }...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> s(9); for (int i = 0; i < 9; i++) { cin >> s.at(i); } int n; cin >> n; vector<int> m(n); for (int i = 0; i < n; i++) { cin >> m.at(i); for (int j = 0; j < 9; j++) { if (m.at(i) == s.at(j)) s.at(j) = 0; }...
replace
16
17
16
17
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> A(9); for (int i = 0; i < 9; i++) cin >> A.at(i); int N; cin >> N; vector<int> B(N); for (int i = 0; i < N; i++) cin >> B.at(i); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (A.at(i) == B.at(j)) ...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> A(9); for (int i = 0; i < 9; i++) cin >> A.at(i); int N; cin >> N; vector<int> B(N); for (int i = 0; i < N; i++) cin >> B.at(i); for (int i = 0; i < 9; i++) { for (int j = 0; j < N; j++) { if (A.at(i) == B.at(j)) ...
replace
13
14
13
14
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); bool c = false; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A.at(i).at(j); } } int N; cin >> N; for (int h = 0; h < N; h++) { int b; cin >> b; for (int i = ...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3, vector<int>(3)); bool c = false; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> A.at(i).at(j); } } int N; cin >> N; for (int h = 0; h < N; h++) { int b; cin >> b; for (int i = ...
replace
33
34
33
34
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02760
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using v1 = vector<int>; using vl = vector<long long>; using v2 = vector<vector<int>>; using v3 = vector<vector<char>>; v2 a(3, v1(3)); int n; int main() { rep(i, 3) { rep(j, 3) { cin >> a[i][j]; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using v1 = vector<int>; using vl = vector<long long>; using v2 = vector<vector<int>>; using v3 = vector<vector<char>>; v2 a(3, v1(3)); int n; int main() { rep(i, 3) { rep(j, 3) { cin >> a[i][j]; ...
replace
45
46
45
46
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool Bingo(vector<vector<int>> &A) { for (int i = 0; i < 3; i++) { if (A.at(0).at(i) == A.at(1).at(i) && A.at(1).at(i) == A.at(2).at(i) && A.at(2).at(i) == 0) return true; else if (A.at(i).at(0) == A.at(i).at(1) && A.at(i).at(1) == A.at(i).at(2) && ...
#include <bits/stdc++.h> using namespace std; bool Bingo(vector<vector<int>> &A) { for (int i = 0; i < 3; i++) { if (A.at(0).at(i) == A.at(1).at(i) && A.at(1).at(i) == A.at(2).at(i) && A.at(2).at(i) == 0) return true; else if (A.at(i).at(0) == A.at(i).at(1) && A.at(i).at(1) == A.at(i).at(2) && ...
replace
14
16
14
16
0
p02760
C++
Runtime Error
// https://atcoder.jp/contests/abc157/tasks/abc157_b #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++) #if DEBUG #define DUMP(a) ...
// https://atcoder.jp/contests/abc157/tasks/abc157_b #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++) #if DEBUG #define DUMP(a) ...
replace
36
37
36
37
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> a(9); for (int i = 0; i < 9; i++) { cin >> a.at(i); } int n; cin >> n; vector<int> b(n); vector<int> c(n); for (int i = 0; i < n; i++) { cin >> b.at(i); for (int j = 0; j < 9; j++) { if (a.at(j) == b.at(i)) { ...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> a(9); for (int i = 0; i < 9; i++) { cin >> a.at(i); } int n; cin >> n; vector<int> b(n); vector<int> c(9); for (int i = 0; i < n; i++) { cin >> b.at(i); for (int j = 0; j < 9; j++) { if (a.at(j) == b.at(i)) { ...
replace
13
14
13
14
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 8) >= this->size() (which is 7)
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int a[10][10]; int m[10][10]; int ok; int main() { ios::sync_with_stdio(0); cin.tie(0); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } int n; cin >> n; for (int i = 0; i < n; i++) { int b; cin >> b; ...
#include <bits/stdc++.h> using namespace std; int a[10][10]; int m[10][10]; int ok; int main() { ios::sync_with_stdio(0); cin.tie(0); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } int n; cin >> n; for (int i = 0; i < n; i++) { int b; cin >> b; ...
replace
23
24
23
24
-11
p02760
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } int N; cin >> N; vector<int> b(N); for (int i = 0; i < N; i++) { cin >> b[i]; } vector<vector<int>> c(...
#include <bits/stdc++.h> using namespace std; int main() { vector<vector<int>> a(3, vector<int>(3)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cin >> a[i][j]; } } int N; cin >> N; vector<int> b(N); for (int i = 0; i < N; i++) { cin >> b[i]; } vector<vector<int>> c(...
replace
25
26
25
26
0
p02760
C++
Runtime Error
#include <bits/stdc++.h> #define MAXN 100005 #define mod 1000000007 #define inf LLONG_MAX / 3 using namespace std; typedef long long ll; typedef pair<ll, ll> pll; ll power(ll x, ll y, ll m = mod) { ll ans = 1; while (y > 0) { if (y & 1) { ans = (ans * x) % m; } x = (x * x) % m; y /= 2; } ...
#include <bits/stdc++.h> #define MAXN 100005 #define mod 1000000007 #define inf LLONG_MAX / 3 using namespace std; typedef long long ll; typedef pair<ll, ll> pll; ll power(ll x, ll y, ll m = mod) { ll ans = 1; while (y > 0) { if (y & 1) { ans = (ans * x) % m; } x = (x * x) % m; y /= 2; } ...
replace
60
63
60
63
TLE
p02761
C++
Runtime Error
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; int n, m; vector<int> s; vector<int> c; bool ok(string str) { if (str.length() != n) return false; for (int j = 0; j < m; j++) { if (str.at(s.at(j)) != to_string(c.at(j)).at(0)) return false; } r...
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; int n, m; vector<int> s; vector<int> c; bool ok(string str) { if (str.length() != n) return false; for (int j = 0; j < m; j++) { if (str.at(s.at(j)) != to_string(c.at(j)).at(0)) return false; } r...
replace
26
27
26
27
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define p...
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define p...
replace
190
191
190
191
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; // const ll MOD = ; ll mod(ll A, ll M) { return (A % M + M) % M; } const ll INF = 1LL << 60; template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; // const ll MOD = ; ll mod(ll A, ll M) { return (A % M + M) % M; } const ll INF = 1LL << 60; template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; ...
replace
46
47
46
47
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); vector<int> p{1}; while (p.size() < n) p.insert(p.begin(), p[0] * 10); map<int, int> s; int ans = 0; while (m--) { int a, b; scanf("%d %d", &a, &b); if (s.count(a)) { if (s[a] != b) ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); vector<int> p{1}; while (p.size() < n) p.insert(p.begin(), p[0] * 10); map<int, int> s; int ans = 0; while (m--) { int a, b; scanf("%d %d", &a, &b); if (s.count(a)) { if (s[a] != b) ...
replace
26
28
26
28
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <vector> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #defin...
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <vector> using namespace std; #define int long long #define double long double #define fo(a, b) for (int a = 0; a < b; a++) #define Sort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()) #define fi first #define se second #defin...
insert
50
50
50
62
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) int main() { int N, M; cin >> N >> M; vector<int> seq(N, 0); seq.at(0) = 1; vector<int> position(M); vector<int> change(M); rep(i, M) { cin >> position.at(i) >> change.at(i); } // 入力完了 int non = 0; rep(...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) int main() { int N, M; cin >> N >> M; vector<int> seq(N, 0); seq.at(0) = 1; vector<int> position(M + 10); vector<int> change(M + 10); rep(i, M) { cin >> position.at(i) >> change.at(i); } // 入力完了 int non =...
replace
8
10
8
10
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = (0); i < (n); i++) using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<int> s(m), c(m); rep(i, m) cin >> s[i] >> c[i]; if (n == 1) { int x = c[0]; rep(i, m) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = (0); i < (n); i++) using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; if (m == 0) { if (n == 1) { cout << 0 << endl; return 0; } if (n == 2) { cout...
insert
13
13
13
30
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
replace
40
41
40
41
-11
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> S(M); vector<char> C(M); for (int i = 0; i < M; i++) { cin >> S.at(i) >> C.at(i); } int loop_start; int loop_end; if (N == 1) { loop_start = 0; loop_end = 10; } else if (N == 2) { lo...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> S(M); vector<char> C(M); for (int i = 0; i < M; i++) { cin >> S.at(i) >> C.at(i); } int loop_start; int loop_end; if (N == 1) { loop_start = 0; loop_end = 10; } else if (N == 2) { lo...
replace
34
35
34
35
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02761
C++
Runtime Error
#include <iostream> using namespace std; #define MAX_N 3 #define MAX_M 5 int main() { int N, M, s[MAX_M], c[MAX_M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; } // N > 1のとき、先頭が0ではいけない if (N > 1) { for (int i = 0; i < M; i++) { if (s[i] == 1 && c[i] == 0) { cou...
#include <iostream> using namespace std; #define MAX_N 3 #define MAX_M 5 int main() { int N, M, s[MAX_M], c[MAX_M]; cin >> N >> M; for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; } // N > 1のとき、先頭が0ではいけない if (N > 1) { for (int i = 0; i < M; i++) { if (s[i] == 1 && c[i] == 0) { cou...
replace
40
41
40
41
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int s[10]; char c[10]; for (int i = 0; i < n; i++) { cin >> s[i] >> c[i]; } bool isok = false; int start[3] = {0, 10, 100}; int end[3] = {9, 99, 999}; int ans = -1; for (int i = start[n - 1]; i <= end[n - 1];...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int s[10]; char c[10]; for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; } bool isok = false; int start[3] = {0, 10, 100}; int end[3] = {9, 99, 999}; int ans = -1; for (int i = start[n - 1]; i <= end[n - 1];...
replace
8
9
8
9
0
p02761
C++
Runtime Error
#pragma region template #include <bits/stdc++.h> using namespace std; // -type- using str = string; using ll = int64_t; using pii = pair<int64_t, int64_t>; using pis = pair<int64_t, str>; using psi = pair<str, int64_t>; using vi = vector<int64_t>; using vvi = vector<vector<int64_t>>; using vs = vector<str>; using vp...
#pragma region template #include <bits/stdc++.h> using namespace std; // -type- using str = string; using ll = int64_t; using pii = pair<int64_t, int64_t>; using pis = pair<int64_t, str>; using psi = pair<str, int64_t>; using vi = vector<int64_t>; using vvi = vector<vector<int64_t>>; using vs = vector<str>; using vp...
insert
92
92
92
94
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M), c(M); for (int i = 0; i < N; ++i) cin >> s[i] >> c[i], s[i]--; auto ok = [&](int n) -> bool { string S = to_string(n); if (S.size() != N) return false; for (int i = 0; i < M; ++i) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M), c(M); for (int i = 0; i < M; ++i) cin >> s[i] >> c[i], s[i]--; auto ok = [&](int n) -> bool { string S = to_string(n); if (S.size() != N) return false; for (int i = 0; i < M; ++i) { ...
replace
7
8
7
8
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int64_t N, M, t = 0; cin >> N >> M; vector<int> s(M), c(M); for (int64_t i = 0; i < M; i++) { cin >> s.at(i) >> c.at(i); } if (N = 1) { for (int64_t j = 0; j < M; j++) { if (c.at(j) != 0) { t = 1; break; } } ...
#include <bits/stdc++.h> using namespace std; int main() { int64_t N, M, t = 0; cin >> N >> M; vector<int> s(M), c(M); for (int64_t i = 0; i < M; i++) { cin >> s.at(i) >> c.at(i); } if (N == 1) { for (int64_t j = 0; j < M; j++) { if (c.at(j) != 0) { t = 1; break; } }...
replace
10
11
10
11
-8
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int power(int n) { if (n == 0) return 0; int res = 1; rep(i, n) res *= 10; return res; } bool check(int n, int s, int c) { vector<int> v; while (n) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int power(int n) { if (n == 0) return 0; int res = 1; rep(i, n) res *= 10; return res; } bool check(int n, int s, int c) { vector<int> v; if (n == 0) ...
replace
16
20
16
23
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using namespace std; using vi = vector<int>; using vvi = vector<vi>; int main() { int n, m; cin >> n >> m; vi s(m); vector<char> c(m); rep(i, m) { cin >> s.at(i) >> c.at(i); } int a, b; if (n =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using namespace std; using vi = vector<int>; using vvi = vector<vi>; int main() { int n, m; cin >> n >> m; vi s(m); vector<char> c(m); rep(i, m) { cin >> s.at(i) >> c.at(i); } int a, b; if (n =...
insert
22
22
22
26
0
p02761
C++
Runtime Error
// SmartCoder #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace __gnu_pbds; using namespace std; #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define all(c) (c).begin(), (c)....
// SmartCoder #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace __gnu_pbds; using namespace std; #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define all(c) (c).begin(), (c)....
replace
63
64
63
64
0
p02761
Python
Runtime Error
def main(): N, M = map(int, input().split()) P = {tuple(map(int, input().split())) for _ in range(M)} P = sorted(P) ans = [0 for _ in range(N)] if N > 1 and (1, 0) in P: print(-1) return if N > 1 and P[0][0] != 1: ans[0] = 1 for i in range(len(P) - 1): if P...
def main(): N, M = map(int, input().split()) P = {tuple(map(int, input().split())) for _ in range(M)} P = sorted(P) ans = [0 for _ in range(N)] if N == 1 and M == 0: print(0) return if N == 2 and M == 0: print(10) return if N == 3 and M == 0: print(...
insert
5
5
5
17
0
p02761
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define r...
#define _GLIBCXX_DEBUG #include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define r...
insert
28
28
28
30
0
p02761
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define vll vector<ll> #define vi vector<int> #define vpll vector<pair<ll, ll>> #define pii pair<int, int> #define REP(i, a) for (int(i) = 0; (i) < (a); (i)++) #define RREP(i, a) for (int(i) = a - 1; (i) >= (0); (i)--) #define REP2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define MOD 10000...
#include <bits/stdc++.h> #define vll vector<ll> #define vi vector<int> #define vpll vector<pair<ll, ll>> #define pii pair<int, int> #define REP(i, a) for (int(i) = 0; (i) < (a); (i)++) #define RREP(i, a) for (int(i) = a - 1; (i) >= (0); (i)--) #define REP2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define MOD 10000...
replace
32
33
32
33
TLE
p02761
Python
Runtime Error
n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(m)] for x in range(1000): ok = True s = str(x) if len(s) != n: continue if not all([int(s[a[i][0] - 1]) == a[i][1] for i in range(m)]): continue print(x) exit(1) print(-1)
n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(m)] for x in range(1000): ok = True s = str(x) if len(s) != n: continue if not all([int(s[a[i][0] - 1]) == a[i][1] for i in range(m)]): continue print(x) exit(0) print(-1)
replace
11
12
11
12
1