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
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; vector<int> g[N]; int d[N]; int vis[N]; bool ok[N]; int a[N], b[N]; int main() { int n, m; scanf("%d %d", &n, &m); for (int i = 0; i < n; ++i) scanf("%d", d + i); for (int i = 0; i < m; ++i) { int u, v; scanf("%d %d", &u, &v);...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; vector<int> g[N]; int d[N]; int vis[N]; bool ok[N]; int a[N], b[N]; int main() { int n, m; scanf("%d %d", &n, &m); for (int i = 0; i < n; ++i) scanf("%d", d + i); for (int i = 0; i < m; ++i) { int u, v; scanf("%d %d", &u, &v);...
replace
28
30
28
31
0
p02799
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int n, m; cin >> n >> m; array<int, 2> d[n]; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; d[i] = {a[i], i}; } sort(d, d + ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int n, m; cin >> n >> m; array<int, 2> d[n]; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; d[i] = {a[i], i}; } sort(d, d + ...
insert
51
51
51
52
TLE
p02799
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i, n) rep2(i, 0, n) #define re...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i, n) rep2(i, 0, n) #define re...
delete
17
18
17
17
TLE
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template <class T> using minheap = priority_queue<T, vector<T>, greater<T>>; int main() { int N, M; cin >> N >> M; vector<int> D(N); rep(i, N) cin >> D[i]; vector<int> U(M), V(M); vector<vec...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template <class T> using minheap = priority_queue<T, vector<T>, greater<T>>; int main() { int N, M; cin >> N >> M; vector<int> D(N); rep(i, N) cin >> D[i]; vector<int> U(M), V(M); vector<vec...
replace
25
26
25
26
0
p02799
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 P pair<int, int> #define pb push_back #define lb(x) (x & (-x)) #define ALL(x) x.begin(), x.end() #define SZ(x) ((int)x.size()) using namespace std; typedef long long LL; const int M...
#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 P pair<int, int> #define pb push_back #define lb(x) (x & (-x)) #define ALL(x) x.begin(), x.end() #define SZ(x) ((int)x.size()) using namespace std; typedef long long LL; const int M...
replace
10
11
10
11
0
p02799
C++
Time Limit Exceeded
/** * author: zjsdut * created: 2020/01/19 06:10:37 **/ #include <bits/stdc++.h> using namespace std; struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); }; } fast_ios_; template <typename A, typename B> bool chkmin(A &a, const B ...
/** * author: zjsdut * created: 2020/01/19 06:10:37 **/ #include <bits/stdc++.h> using namespace std; struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); }; } fast_ios_; template <typename A, typename B> bool chkmin(A &a, const B ...
replace
177
178
177
179
TLE
p02799
C++
Runtime Error
#include <bits/stdc++.h> #define fo(i, a, b) for ((i) = (a); i <= (b); i++) #define rfo(i, a, b) for ((i) = (a); i >= (b); i--) #define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z))) #define ALL(vec) ((vec).begin(), (vec).end()) #define SOR(vec) sort(ALL(vec)) #define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()...
#include <bits/stdc++.h> #define fo(i, a, b) for ((i) = (a); i <= (b); i++) #define rfo(i, a, b) for ((i) = (a); i >= (b); i--) #define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z))) #define ALL(vec) ((vec).begin(), (vec).end()) #define SOR(vec) sort(ALL(vec)) #define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()...
replace
55
56
55
60
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define m_p make_pair const int N = 100005, INF = 1000000000; int n, m; int d[N]; vector<pair<int, int>> a[N]; char c[N]; int ans[N]; void dfs(int x) { for (int i = 0; i < a[x].size(); ++i) { int h = a[x][i].first; if (!c[h]) { if (d[h] > d[x]) { ...
#include <bits/stdc++.h> using namespace std; #define m_p make_pair const int N = 200005, INF = 1000000000; int n, m; int d[N]; vector<pair<int, int>> a[N]; char c[N]; int ans[N]; void dfs(int x) { for (int i = 0; i < a[x].size(); ++i) { int h = a[x][i].first; if (!c[h]) { if (d[h] > d[x]) { ...
replace
3
4
3
4
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int d[100005]; vector<P> G[100005]; int u[100005], v[100005]; int res[200005]; int col[100005]; int mini; P p[100005]; bool check() { for (int i = 0; i < n; i++) { p[i] = P(d[i], i); ...
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int d[100005]; vector<P> G[100005]; int u[200005], v[200005]; int res[200005]; int col[100005]; int mini; P p[100005]; bool check() { for (int i = 0; i < n; i++) { p[i] = P(d[i], i); ...
replace
9
10
9
10
0
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1000000007; void solve() { int n, m; cin >> n >> m; // pair--------------->penalty,mark if ac vector<pair<ll, bool>> answer(n + 1); for (int i = 0; i < m; i++) { int p; string s; cin >> p >> s; p--; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1000000007; void solve() { char c; cin >> c; cout << char(c + 1); } int main() { int y; y = 1; // cin>>y ; while (y--) { solve(); } }
replace
7
46
7
10
-11
p02801
C++
Runtime Error
#pragma GCC optimize("-O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; using namespace std; #define all(c) (c).begin(), (c).end() #de...
#pragma GCC optimize("-O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; using namespace std; #define all(c) (c).begin(), (c).end() #de...
replace
52
55
52
53
0
p02801
C++
Runtime Error
#pragma GCC optimize( \ "Ofast") // Comment optimisations for an interative problem/use endl #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll...
#pragma GCC optimize( \ "Ofast") // Comment optimisations for an interative problem/use endl #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll...
delete
57
61
57
57
0
p02801
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() { string c; cin >> c; vector<string> p; p.push_back("a"); p.push_back("b"); p.push_back("c"); p.push_back("d"); p.push_back("e"); p.push_back("f"); ...
#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() { string c; cin >> c; vector<string> p; p.push_back("a"); p.push_back("b"); p.push_back("c"); p.push_back("d"); p.push_back("e"); p.push_back("f"); ...
insert
39
39
39
40
0
p02801
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { char C; do { cin >> C; } while (C != 'z'); cout << C + 1 << endl; return 0; }
#include <iostream> using namespace std; int main() { char C; do { cin >> C; } while (C == 'z'); cout << char(C + 1) << endl; return 0; }
replace
6
8
6
8
TLE
p02801
Python
Runtime Error
c = input() txt = "abcdefghijklmnopqrstuvwxyz" for i in range(27): if txt[i] == c: print(txt[i + 1])
c = input() txt = "abcdefghijklmnopqrstuvwxyz" for i in range(26): if txt[i] == c: print(txt[i + 1])
replace
3
5
3
4
IndexError: string index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s227649373.py", line 6, in <module> if txt[i] == c: IndexError: string index out of range
p02801
Python
Runtime Error
import string AL = string.lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
import string AL = string.ascii_lowercase C = input() idx = AL.find(C) idy = (idx + 1) % 26 print(AL[idy])
replace
2
3
2
3
AttributeError: module 'string' has no attribute 'lowercase'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s068085135.py", line 3, in <module> AL = string.lowercase AttributeError: module 'string' has no attribute 'lowercase'
p02801
Python
Runtime Error
import sys args = sys.argv a = "abcdefghijklmnopqrstuvwxyz" c = args[1] idx = a.index(c) print(a[idx + 1])
import sys args = sys.argv a = "abcdefghijklmnopqrstuvwxyz" c = input() idx = a.index(c) print(a[idx + 1])
replace
6
7
6
7
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s556171083.py", line 7, in <module> c = args[1] IndexError: list index out of range
p02801
C++
Runtime Error
// Goodbye stupid girls & Hello L0u1Za, Codeforces and my friends(nobody) #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #includ...
// Goodbye stupid girls & Hello L0u1Za, Codeforces and my friends(nobody) #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #includ...
replace
33
34
33
34
0
p02801
C++
Runtime Error
#include <stdio.h> int main() { char c; scanf("%[^z]", &c); printf("%c", c + 1); return 0; }
#include <stdio.h> int main() { char c; scanf("%c", &c); printf("%c\n", c + 1); return 0; }
replace
4
6
4
6
-6
*** stack smashing detected ***: terminated
p02801
C++
Runtime Error
// verma_ankit484 #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> typedef long long ll; #define IOS \ ios::sync_with_stdio(0); \ cin.t...
// verma_ankit484 #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> typedef long long ll; #define IOS \ ios::sync_with_stdio(0); \ cin.t...
delete
22
26
22
22
0
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { freopen("input.txt", "r", stdin); ios_base::sync_with_stdio(false); cin.tie(NULL); char a; cin >> a; cout << char(a + 1); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { // freopen("input.txt","r",stdin); ios_base::sync_with_stdio(false); cin.tie(NULL); char a; cin >> a; cout << char(a + 1); }
replace
4
5
4
5
0
p02801
Python
Runtime Error
import sys input = sys.stdin.readline alphabets = "abcdefghijklmnopqrstuvwxyz" c = input() i = alphabets.index(c) answer = alphabets[i + 1] print(answer)
import sys input = sys.stdin.readline alphabets = "abcdefghijklmnopqrstuvwxyz" c = input().strip() i = alphabets.index(c) answer = alphabets[i + 1] print(answer)
replace
7
8
7
8
ValueError: substring not found
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s836022854.py", line 8, in <module> i = alphabets.index(c) ValueError: substring not found
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string c = "abcdefghijklmnopqrstuvwxyz"; char i; cin >> i; cout << c.at(i++) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { char c; cin >> c; c++; cout << c << endl; }
replace
4
8
4
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 97) >= this->size() (which is 26)
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; int main() { char z; cin >> z; printf("%s\n", z + 1); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; int main() { char z; cin >> z; z++; cout << z << endl; }
replace
9
10
9
11
-11
p02801
C++
Time Limit Exceeded
/* author: Tarek */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; typedef long double ld; #define mp make_pair int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n; ci...
/* author: Tarek */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; typedef long double ld; #define mp make_pair int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); char a; c...
replace
12
27
12
17
TLE
p02801
C++
Runtime Error
#include <iostream> using namespace std; int main() { char a; cin >> a; cout << char(a + 1); return 1; }
#include <iostream> using namespace std; int main() { char a; cin >> a; cout << char(a + 1); return 0; }
replace
6
7
6
7
1
p02801
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; typedef long double ld; const int inf = 1e9 + 7; const int mod = 1e9 + 7; const int maxn = 1e6 + 3; #define pb push_back #define mp make_pair #define ff first #define ss second #de...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; typedef long double ld; const int inf = 1e9 + 7; const int mod = 1e9 + 7; const int maxn = 1e6 + 3; #define pb push_back #define mp make_pair #define ff first #define ss second #de...
replace
34
38
34
35
0
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
#include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pb push_b...
replace
44
51
44
51
0
p02801
C++
Runtime Error
#include <stdio.h> int main() { char c; int i; scanf("%c", &c); i = ((int)c) + 1; printf("%c", i); return 1; }
#include <stdio.h> int main() { char a; scanf("%c", &a); printf("%c\n", a + 1); }
replace
2
8
2
5
1
p02801
Python
Runtime Error
""" author : halo2halo date : 4, Feb, 2020 """ import sys # import itertools # import math # import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines H = readline().decode("utf8") print(chr(ord(H) + 1))
""" author : halo2halo date : 4, Feb, 2020 """ import sys # import itertools # import math # import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines H = readline().decode("utf8").strip() print(chr(ord(H) + 1))
replace
16
17
16
17
TypeError: ord() expected a character, but string of length 2 found
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s126986197.py", line 18, in <module> print(chr(ord(H) + 1)) TypeError: ord() expected a character, but string of length 2 found
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { char C; cin >> C; string str = "abcdefghijklmnopqrstuvwxy"; for (int i = 0; i < 26; i++) { if (C == str.at(i)) { cout << str.at(i + 1) << endl; } } }
#include <bits/stdc++.h> using namespace std; int main() { char C; cin >> C; string str = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < 25; i++) { if (C == str.at(i)) { cout << str.at(i + 1) << endl; } } }
replace
6
8
6
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 25) >= this->size() (which is 25)
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string alfa[] = {"a", "b", "c", "d", "e"}; string c; cin >> c; int i = 0; while (i < 25) { if (alfa[i] == c) { break; } i++; } cout << alfa[i + 1] << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string alfa[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; string c; cin >> c; int i = 0; while (i < 25) { if (alfa[i] ...
replace
4
5
4
7
0
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define int lon...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define int lon...
delete
35
39
35
35
0
p02801
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <st...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <st...
replace
23
32
23
24
0
p02801
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k, m, s; cin >> n >> k >> m; vector<int> vec(n - 1); s = m * n; for (int i = 0; i < n - 1; i++) { cin >> vec.at(i); s -= vec.at(i); } if (s >= k) cout << -1 << endl; else if (s <= 0) cout << 0 << endl; else cout <<...
#include <bits/stdc++.h> using namespace std; int main() { char C; cin >> C; cout << (char)(C + 1) << endl; }
replace
4
19
4
7
-6
terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()
p02801
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; int main() { char ch[10]; while (scanf("%s", ch) != 0) { printf("%c\n", ch[0] + 1); } return 0; }
#include <cstdio> #include <iostream> using namespace std; int main() { char ch[10]; scanf("%s", ch); printf("%c\n", ch[0] + 1); return 0; }
replace
6
9
6
8
TLE
p02801
C++
Runtime Error
/* __________ | ___ __ | | | | / | | | | / | | | __ | / _______ |_______| _______ _______ |______ ________ /| / | |/ | | | \ | | | | ...
/* __________ | ___ __ | | | | / | | | | / | | | __ | / _______ |_______| _______ _______ |______ ________ /| / | |/ | | | \ | | | | ...
delete
55
59
55
55
0
p02801
Python
Runtime Error
from collections import deque import sys from copy import deepcopy input = sys.stdin.readline def bfs(table, i, j): dq = deque() if table[i][j] == "#": return -1 h = len(table) w = len(table[0]) ans = 0 dq.append((i, j, 0)) # x,y,distance while dq: x, y, dis = dq.popleft(...
c = input() print(chr(ord(c) + 1))
replace
0
49
0
2
ValueError: invalid literal for int() with base 10: 'a'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s679156096.py", line 48, in <module> main() File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s679156096.py", line 34, in main h, w = [int(i) for i in input()....
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) ll factorial(int i) { // 階乗 if (i == 0) return 1; return (factorial(i - 1)) * i; } int main() { int n, m; cin >> n >> m; vector<p...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) ll factorial(int i) { // 階乗 if (i == 0) return 1; return (factorial(i - 1)) * i; } int main() { int n, m; cin >> n >> m; vector<p...
replace
17
18
17
18
-6
double free or corruption (out)
p02802
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ll long long #define rep(i, s, n) for (ll i = (ll)(s); i < (ll...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ll long long #define rep(i, s, n) for (ll i = (ll)(s); i < (ll...
replace
171
172
171
172
0
p02802
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ll long long using namespace std; struct all_init { all_init() { cout << fixed << setprecision(12...
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define ll long long using namespace std; struct all_init { all_init() { cout << fixed << setprecision(12...
replace
21
23
21
23
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n, m) for (int i = (n); i < (m); i++) #define rep_d(i, n, m) for (int i = (n)-1; i >= (m); i--) #define sort_asc(X) sort((X).begin(), (X).end()) #define sort_desc(X) sort((X).begin(), (X).end(), greater<>()) template <class T> bool ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define rep(i, n, m) for (int i = (n); i < (m); i++) #define rep_d(i, n, m) for (int i = (n)-1; i >= (m); i--) #define sort_asc(X) sort((X).begin(), (X).end()) #define sort_desc(X) sort((X).begin(), (X).end(), greater<>()) template <class T> bool ...
replace
44
46
44
46
0
p02802
C++
Runtime Error
#pragma region include #include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #pragma endregion using namespace std; #pragma region 定数 #define INF_VAL (2147483647 - 1) #define INF_VAL_MINUS -INFVAL #pragma endregion #pragma region マクロ // 配列の長さを取得...
#pragma region include #include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #pragma endregion using namespace std; #pragma region 定数 #define INF_VAL (2147483647 - 1) #define INF_VAL_MINUS -INFVAL #pragma endregion #pragma region マクロ // 配列の長さを取得...
replace
99
100
99
100
-11
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M, p, a = 0, w = 0; string J; cin >> N >> M; vector<bool> x(N, false); vector<int> WA(N, 0); for (int i = 0; i < M; i++) { cin >> p >> J[i]; if (J == "AC") { if (!x.at(p - 1)) { a++; x.at(p - 1) = true; w...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, p, a = 0, w = 0; string J; cin >> N >> M; vector<bool> x(N, false); vector<int> WA(N, 0); for (int i = 0; i < M; i++) { cin >> p >> J; if (J == "AC") { if (!x.at(p - 1)) { a++; x.at(p - 1) = true; w +=...
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector<bool>::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
replace
48
49
48
49
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; LL mod = 1000000007; int main() { LL n, m; cin >> n >> m; vector<pair<LL, string>> d(m); for (auto &e : d) { cin >> e.first >> e.second; } vector<LL> done(n, 0); LL ac = 0; LL cnt = 0; for (LL i = 0; i < m; ++i) { LL f...
#include <bits/stdc++.h> using namespace std; typedef long long LL; LL mod = 1000000007; int main() { LL n, m; cin >> n >> m; vector<pair<LL, string>> d(m); for (auto &e : d) { cin >> e.first >> e.second; } vector<LL> done(n, 0); LL ac = 0; LL cnt = 0; for (LL i = 0; i < m; ++i) { LL f...
replace
34
35
34
35
0
p02802
Python
Runtime Error
import collections def solve(n, m, hist): cor = 0 pen = 0 for p, tries in hist.items(): for i, t in enumerate(tries): if t == "AC": cor += 1 pen += i break return f"{cor} {pen}" def input_to_int(): return [int(r) for r in input(...
import collections def solve(n, m, hist): cor = 0 pen = 0 for p, tries in hist.items(): for i, t in enumerate(tries): if t == "AC": cor += 1 pen += i break return "{0} {1}".format(cor, pen) def input_to_int(): return [int(r) for...
replace
12
13
12
13
0
p02802
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int n, m, acc = 0, pen = 0; cin >> n >> m; vector<bool> test(n); vector<int> arr(m); vector<int> p(m); vector<string> s(m); for (int i = 0; i < m; i++) { cin >> p[i]; cin >> s[i]; if (test[p[i]] == false && s[i] == "AC") {...
#include <iostream> #include <vector> using namespace std; int main() { int n, m, acc = 0, pen = 0; cin >> n >> m; vector<bool> test(n + 1); vector<int> arr(n + 1); vector<int> p(m); vector<string> s(m); for (int i = 0; i < m; i++) { cin >> p[i]; cin >> s[i]; if (test[p[i]] == false && s[i] ==...
replace
6
8
6
8
0
p02802
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; int main() { int n, m; cin >> n >> m; vector<int> p(m); vector<string> s(m); rep(i, m) cin >> p[i] >> s[i]; vector<bool> flag(n); vector<int> pn_cnt(m); int ac_cnt = 0, pn_sum = 0; rep(i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> p(m); vector<string> s(m); rep(i, m) cin >> p[i] >> s[i]; vector<bool> flag(n); vector<int> pn_cnt(n); int ac_cnt = 0, pn_sum = 0; rep(i...
replace
12
13
12
13
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define p_q priority_queue #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { int n, m; cin >> n >> m; vector<int> jud(n, 0); vector<int> was(n, 0); ll ACs = 0, WAs = 0; // 1->AC 0-> WA int p; string S; for (int i =...
#include <bits/stdc++.h> using namespace std; #define ll long long #define p_q priority_queue #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) int main() { int n, m; cin >> n >> m; vector<int> jud(n, 0); vector<int> was(n, 0); ll ACs = 0, WAs = 0; // 1->AC 0-> WA int p; string S; for (int i =...
replace
31
32
31
32
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
replace
150
151
150
151
0
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)n; i++) using namespace std; int main() { ll N, M; ll seikai = 0, pena = 0; ci...
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)n; i++) using namespace std; int main() { ll N, M; ll seikai = 0, pena = 0; ci...
replace
30
31
30
31
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; set<int> st; int fail = 0; vector<int> f(M + 1, 0); rep(i, M) { int a; string b; cin >> a >> b; if (b == "...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; set<int> st; int fail = 0; vector<int> f(N + 1, 0); rep(i, M) { int a; string b; cin >> a >> b; if (b == "...
replace
11
12
11
12
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; vector<bool> Ans(N); vector<int> pena(N); rep(i, M) { int p; string s; cin >> p >> s; if (Ans.at(p - 1)) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { int N, M; cin >> N >> M; vector<bool> Ans(N); vector<int> pena(N); rep(i, M) { int p; string s; cin >> p >> s; if (Ans.at(p - 1)) ...
replace
19
20
19
20
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#pragma GCC optimize("-O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; using namespace std; #define all(c) (c).begin(), (c).end() #de...
#pragma GCC optimize("-O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; using namespace std; #define all(c) (c).begin(), (c).end() #de...
replace
53
56
53
54
-11
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> int main() { long long N, M; std::cin >> N >> M; std::map<long long, long long> C; std::vector<long long> D(N + 1); long long wa = 0; long long ac = 0; for...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> int main() { long long N, M; std::cin >> N >> M; std::map<long long, long long> C; std::vector<long long> D(N + 1); long long wa = 0; long long ac = 0; for...
replace
30
31
30
31
0
p02802
C++
Runtime Error
#include <algorithm> #include <chrono> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long long n, m; int ans = 0, cnt = 0; cin >> n ...
#include <algorithm> #include <chrono> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long long n, m; int ans = 0, cnt = 0; cin >> n ...
replace
21
22
21
22
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; template <class F> auto recursive(F f) { return [f](auto... a) { return f(f, a...); }; } template <class I, class V = typename I::value_type> V sum_up(const I &l, co...
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; template <class F> auto recursive(F f) { return [f](auto... a) { return f(f, a...); }; } template <class I, class V = typename I::value_type> V sum_up(const I &l, co...
replace
52
53
52
53
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a, int b) { if ((a % b) * 2 >= b) { return (a / b) + 1; } return a / b; } int gcd(int a, int b) { int c; while (b != 0) { c = a...
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a, int b) { if ((a % b) * 2 >= b) { return (a / b) + 1; } return a / b; } int gcd(int a, int b) { int c; while (b != 0) { c = a...
replace
221
222
221
222
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() int main() { int N, M; cin >> N >> M; vector<int> p(M); vector<string> S(M); rep(i, M) cin >> p.at(i) >> S.at(i); vector<int> AC(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() int main() { int N, M; cin >> N >> M; vector<int> p(M); vector<string> S(M); rep(i, M) cin >> p.at(i) >> S.at(i); vector<int> AC(...
replace
24
25
24
26
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <class T> void sort(vector<T> &v) { sort(v.begin(), v.end()); } int main() { int n, m; cin >> n >> m; vector<int> p(m); vector<string> s(m); for (int i = 0; i < m; i++) cin >> p[i] >> s[i]; for (int i = 0; i < m; i++) p[i]--; vector<int> pen...
#include <bits/stdc++.h> using namespace std; template <class T> void sort(vector<T> &v) { sort(v.begin(), v.end()); } int main() { int n, m; cin >> n >> m; vector<int> p(m); vector<string> s(m); for (int i = 0; i < m; i++) cin >> p[i] >> s[i]; for (int i = 0; i < m; i++) p[i]--; vector<int> pen...
replace
14
15
14
15
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; // ll lcm(ll x, ll y){ return x*y/__gcd(x, y);} int main() { ll N, M; cin >> N >> M; bool ac[N + 1]; int wa[N + 1]; for (ll i = 1; i <= N; i++) { ac[i] = false; wa[i] = 0; } ll n_ac = 0; ll n_wa = 0; for (ll i = 0; i < M; i++)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // ll lcm(ll x, ll y){ return x*y/__gcd(x, y);} int main() { ll N, M; cin >> N >> M; bool ac[N + 1]; int wa[N + 1]; for (ll i = 1; i <= N; i++) { ac[i] = false; wa[i] = 0; } ll n_ac = 0; ll n_wa = 0; for (ll i = 0; i < M; i++)...
replace
28
29
28
29
0
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> // output #define SPBR(w, n) std::cout << (w + 1 == n ? '\n' : ' '); #define YES cout << "YES" << endl #define Yes cout << "Yes" << endl #define NO cout << "NO" ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> // output #define SPBR(w, n) std::cout << (w + 1 == n ? '\n' : ' '); #define YES cout << "YES" << endl #define Yes cout << "Yes" << endl #define NO cout << "NO" ...
replace
46
48
46
48
0
p02802
C++
Runtime Error
// // じょえチャンネル // 高評価・チャンネル登録よろしくお願いします! // https://www.youtube.com/watch?v=gPFr7q7eLL8 // #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #i...
// // じょえチャンネル // 高評価・チャンネル登録よろしくお願いします! // https://www.youtube.com/watch?v=gPFr7q7eLL8 // #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #i...
replace
239
240
239
240
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> cnt(m), b(n); int res = 0; for (int i = 0; i < m; i++) { int p; cin >> p, p--; string c; cin >> c; if (c == "AC") { if (b[p] == 0) { b[p] = 1; res += cnt[p]; } }...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> cnt(n), b(n); int res = 0; for (int i = 0; i < m; i++) { int p; cin >> p, p--; string c; cin >> c; if (c == "AC") { if (b[p] == 0) { b[p] = 1; res += cnt[p]; } }...
replace
6
7
6
7
0
p02802
C++
Runtime Error
#include <iostream> #include <string> #include <vector> int main() { int N = 0, M = 0; std::cin >> N >> M; int p; std::string S; std::vector<std::pair<bool, int>> c(N); for (int i = 0; i < N; i++) { c[i].first = false; c[i].second = 0; } std::pair<int, int> ans; for (int i = 0; i < M; i++) ...
#include <iostream> #include <string> #include <vector> int main() { int N = 0, M = 0; std::cin >> N >> M; int p; std::string S; std::vector<std::pair<bool, int>> c(N); for (int i = 0; i < N; i++) { c[i].first = false; c[i].second = 0; } std::pair<int, int> ans; for (int i = 0; i < M; i++) ...
replace
24
25
24
25
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n" #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, k, n) for (int i = (k); i < (int)(n); ++i) #define ALL(r) r.begin(), r.end() #define YES puts("YES") #define Yes puts("Yes") #define NO puts("NO")...
#include <bits/stdc++.h> using namespace std; #define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n" #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, k, n) for (int i = (k); i < (int)(n); ++i) #define ALL(r) r.begin(), r.end() #define YES puts("YES") #define Yes puts("Yes") #define NO puts("NO")...
replace
83
84
83
84
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fast_IO \ ios::sync_with_stdio(0); \ cin.tie(0); using namespace std; int wa[10500]; bool ac[10500]; int main() { int n, m...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fast_IO \ ios::sync_with_stdio(0); \ cin.tie(0); using namespace std; int wa[105000]; bool ac[105000]; int main() { int n,...
replace
8
10
8
10
0
p02802
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <unordered_map> typedef long long ll; typedef long double ld; using namespace std; int main() { ll n, m, p[100010], ac = 0, wa = 0; string s[100010]; unordered_map<ll, int> score; cin >> n >...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <unordered_map> typedef long long ll; typedef long double ld; using namespace std; int main() { ll n, m, p[100010], ac = 0, wa = 0; string s[100010]; unordered_map<ll, int> score; cin >> n >...
replace
23
29
23
30
TLE
p02802
C++
Runtime Error
#include <bits/stdc++.h> #include <cstdio> #include <fstream> #include <iostream> #include <queue> #include <stdio.h> #include <string.h> #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) print...
#include <bits/stdc++.h> #include <cstdio> #include <fstream> #include <iostream> #include <queue> #include <stdio.h> #include <string.h> #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) print...
replace
41
43
41
43
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, h) for (int i = 0; i < h; ++i) #define rep1(i, h) for (int i = 0; i <= h; ++i) #define rep2(i, k, h) for (int i = k; i < h; ++i) #define rep3(i, k, h) for (int i = k; i <= h; ++i) #define INF LLong_MAX // long long...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define rep(i, h) for (int i = 0; i < h; ++i) #define rep1(i, h) for (int i = 0; i <= h; ++i) #define rep2(i, k, h) for (int i = k; i < h; ++i) #define rep3(i, k, h) for (int i = k; i <= h; ++i) #define INF LLong_MAX // long long...
replace
33
34
33
34
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M, p, tsum = 0, bsum = 0, csum = 0; string s; cin >> N >> M; vector<bool> ac(N, false); vector<int> acn(N, 0); for (int i = 0; i < M; i++) { s = "", p = -1; cin >> p >> s; if (p == -1) break; if (!(ac.at(p - 1))) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, p, tsum = 0, bsum = 0, csum = 0; string s; cin >> N >> M; vector<bool> ac(N, false); vector<int> acn(N, 0); for (int i = 0; i < M; i++) { s = "", p = -1; cin >> p >> s; if (p == -1) break; if (!(ac.at(p - 1))) { ...
replace
25
26
25
26
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector<bool>::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> ac(n), pena(n); rep(i, m) { int p; string s; cin >> p >> s; if (ac.at(p)) continue; if (s == "WA") { pena.at(p)++; } else { ac....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, m; cin >> n >> m; vector<int> ac(n), pena(n); rep(i, m) { int p; string s; cin >> p >> s; p--; if (ac.at(p)) continue; if (s == "WA") { pena.at(p)++; } else { ...
insert
12
12
12
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cfloat> #include <climits> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <string> #include <unordered_map> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cfloat> #include <climits> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <stdio.h> #include <string> #include <unordered_map> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a(...
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 18446744073709551615) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cstdint> #include <iostream> #include <iterator> #include <vector> // lib/util.hpp #ifndef UTIL_HPP #define UTIL_HPP typedef ::std::int_fast64_t i64; typedef ::std::uint_fast64_t u64; typedef ::std::int_fast32_t i32; typedef ::std::uint_fast32_t u32; namespace ...
#include <algorithm> #include <bits/stdc++.h> #include <cstdint> #include <iostream> #include <iterator> #include <vector> // lib/util.hpp #ifndef UTIL_HPP #define UTIL_HPP typedef ::std::int_fast64_t i64; typedef ::std::uint_fast64_t u64; typedef ::std::int_fast32_t i32; typedef ::std::uint_fast32_t u32; namespace ...
replace
63
64
63
64
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> ac(n), pena(n); for (int i = 0; i < m; i++) { int p; string s; cin >> p >> s; p--; if (ac[p] == 1) continue; if (s == "AC") ac[p] = 1; else pena[p]++; } int AC =...
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; vector<int> ac(n), pena(n); for (int i = 0; i < m; i++) { int p; string s; cin >> p >> s; p--; if (ac[p] == 1) continue; if (s == "AC") ac[p] = 1; else pena[p]++; } int AC =...
replace
20
21
20
21
0
p02802
Python
Runtime Error
N, M = map(int, input().split()) accepted = [0] * N penalties = [0] * N for _ in range(M): p, ac = input().split() p, ac = int(p), ac == "AC" accepted[p] |= ac penalties[p] += not accepted[p] print(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))
N, M = map(int, input().split()) accepted = [0] * N penalties = [0] * N for _ in range(M): p, ac = input().split() p, ac = int(p) - 1, ac == "AC" accepted[p] |= ac penalties[p] += not accepted[p] print(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))
replace
5
6
5
6
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s182965476.py", line 7, in <module> accepted[p] |= ac IndexError: list index out of range
p02802
Python
Runtime Error
n, m = map(int, input().split()) scores = [[0, False] for _ in range(n)] for _ in range(m): p, S = input().split() p = int(p) if scores[p][1]: continue if S == "AC": scores[p][1] = True continue if S == "WA": scores[p][0] += 1 score = pena = 0 for count, ac in s...
n, m = map(int, input().split()) scores = [[0, False] for _ in range(n + 1)] for _ in range(m): p, S = input().split() p = int(p) if scores[p][1]: continue if S == "AC": scores[p][1] = True continue if S == "WA": scores[p][0] += 1 score = pena = 0 for count, ac ...
replace
2
3
2
3
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s650750562.py", line 9, in <module> if scores[p][1]: IndexError: list index out of range
p02802
Python
Runtime Error
N, M = map(int, input().split()) pS = {} for i in range(N): pS[i] = [0, 0, 0] # is_ac, penatly, AC for i in range(M): p, S = input().split() p = int(p) - 1 if pS[p][0] == 0 and S == "WA": pS[p][1] += 1 elif pS[p][0] == 0 and S == "AC": pS[p][0] = 1 pS[p][2] = 1 AC = 0 pena...
N, M = map(int, input().split()) pS = {} for i in range(N): pS[i] = [0, 0, 0] # is_ac, penatly, AC for i in range(M): p, S = input().split() p = int(p) - 1 if pS[p][0] == 0 and S == "WA": pS[p][1] += 1 elif pS[p][0] == 0 and S == "AC": pS[p][0] = 1 pS[p][2] = 1 AC = 0 pena...
replace
17
18
17
18
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, m; cin >> n >> m; vector<int> p(m + 1); vector<string> s(m + 1); for (int i = 1; i <= m; i++) cin >> p[i] >> s[i]; vector<int> waNum(n + 1); int acNum = 0; vector<b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int n, m; cin >> n >> m; vector<int> p(m + 1); vector<string> s(m + 1); for (int i = 1; i <= m; i++) cin >> p[i] >> s[i]; vector<int> waNum(n + 1); int acNum = 0; vector<b...
replace
16
17
16
17
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; #define rep(i, n) for (ll i = 0; i < (n); i++) #define repr(i, n) for (ll i = (n - 1); i >= 0; i--) #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define br cout << endl; using namespace std; const int INF = 1e9; const int MOD = 1e9 + 7; using...
#include <bits/stdc++.h> typedef long long ll; #define rep(i, n) for (ll i = 0; i < (n); i++) #define repr(i, n) for (ll i = (n - 1); i >= 0; i--) #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define br cout << endl; using namespace std; const int INF = 1e9; const int MOD = 1e9 + 7; using...
insert
40
40
40
41
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using p = pair<ll, ll>; constexpr ll INF = 1LL << 62; int main(void) { ll N, M; cin >> N >> M; vector<ll> wacount(N + 1, 0), account(N + 1, 0); for (ll i = 0; i < M; i++) { ll p; string S; cin >> p >> S; if (account[p] != 0) {...
#include <bits/stdc++.h> using namespace std; using ll = long long; using p = pair<ll, ll>; constexpr ll INF = 1LL << 62; int main(void) { ll N, M; cin >> N >> M; vector<ll> wacount(N + 1, 0), account(N + 1, 0); for (ll i = 0; i < M; i++) { ll p; string S; cin >> p >> S; if (account[p] != 0) {...
replace
25
26
25
26
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push_back #define all(v) v.begin(), v.end() #define fi first #define se second #define bigger (char)toupper #define smaller (char)tolower using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> v...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push_back #define all(v) v.begin(), v.end() #define fi first #define se second #define bigger (char)toupper #define smaller (char)tolower using namespace std; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> v...
replace
18
19
18
19
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define PB pop_back #define nn "\n" #define O_O \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define all(p) p.begin(), p.end() #de...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define PB pop_back #define nn "\n" #define O_O \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define all(p) p.begin(), p.end() #de...
replace
26
27
26
27
0
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> using namespace std; #define x first #define y second #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define ll long long #define ld long ...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> using namespace std; #define x first #define y second #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define ll long long #define ld long ...
replace
30
31
30
31
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define MOD 1000000007 #define el endl typedef long long ll; typedef long double ld; int main() { struct s { bool is_ac; int penalty; }; int n, m, pena = 0, ac = 0; cin >> n >> m; vector<s> sv(n); rep(i, m...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define MOD 1000000007 #define el endl typedef long long ll; typedef long double ld; int main() { struct s { bool is_ac; int penalty; }; int n, m, pena = 0, ac = 0; cin >> n >> m; vector<s> sv(n); rep(i, m...
insert
24
24
24
26
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m, ans, wa, i, b; cin >> n >> m; ll w[n]; wa = 0; ans = 0; for (i = 0; i <= m; i++) { w[i] = 0; } string c; for (i = 0; i < m; i++) { cin >> b >> c; if (w[b] != -1) { if (c == "WA") { w[b]...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m, ans, wa, i, b; cin >> n >> m; ll w[n]; wa = 0; ans = 0; for (i = 0; i <= n; i++) { w[i] = 0; } string c; for (i = 0; i < m; i++) { cin >> b >> c; if (w[b] != -1) { if (c == "WA") { w[b]...
replace
10
11
10
11
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; // #define DEBUG int main(void) { ll N, M; cin >> N >> M; vector<ll> p(M); vector<string> S(M); vector<bool> isCorrectProb(N, false); // 問題(i)が正当したか否か ll correct_ans_num = 0; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; // #define DEBUG int main(void) { ll N, M; cin >> N >> M; vector<ll> p(M); vector<string> S(M); vector<bool> isCorrectProb(N + 1, false); // 問題(i)が正当したか否か ll correct_ans_num = 0; ...
replace
13
17
13
17
0
p02802
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { while (true) { int m, n; cin >> m >> n; map<int, int> was; map<int, int> acs; int sum = 0; for (int i = 0; i < n; i++) { int a; string b; cin >> a >> b; if (b == "WA") was[a]++; else { if ...
#include <bits/stdc++.h> using namespace std; int main() { // while(true) { int m, n; cin >> m >> n; map<int, int> was; map<int, int> acs; int sum = 0; for (int i = 0; i < n; i++) { int a; string b; cin >> a >> b; if (b == "WA") was[a]++; else { ...
replace
4
5
4
6
TLE
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define I inline #define fi first #define se second #define R register #define LL long long #define mp make_pair #define reg register int #define pii pair<int, int> #define fo(i, a, b) for (reg i = a; i <= b; i++) #define fd(i, a, b) for (reg i = a; i >= b; i--) #define cr const reg & using na...
#include <bits/stdc++.h> #define I inline #define fi first #define se second #define R register #define LL long long #define mp make_pair #define reg register int #define pii pair<int, int> #define fo(i, a, b) for (reg i = a; i <= b; i++) #define fd(i, a, b) for (reg i = a; i >= b; i--) #define cr const reg & using na...
replace
15
16
15
16
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define SORT(a) sort((a).begin(), (a).end()) #define RSORT(a) reverse((a).begin(), (a).end()) #define rep(i, a, b) for (int64_t i = (a); i < (b); ++i) const int MOD = 1e9 + 7; typedef long long ll; const long long INF = 1LL << 60; using Graph = vector<vector<int>>; int ma...
#include <bits/stdc++.h> using namespace std; #define SORT(a) sort((a).begin(), (a).end()) #define RSORT(a) reverse((a).begin(), (a).end()) #define rep(i, a, b) for (int64_t i = (a); i < (b); ++i) const int MOD = 1e9 + 7; typedef long long ll; const long long INF = 1LL << 60; using Graph = vector<vector<int>>; int ma...
replace
35
36
35
36
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define PRINT(item) cout << (item) << endl; #define PRINT_VEC(V) \ for (auto v : (V)) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define PRINT(item) cout << (item) << endl; #define PRINT_VEC(V) \ for (auto v : (V)) ...
replace
22
23
22
23
0
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <stack> #include <string> #include <unordered_set> #include <vector> using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; int main() { int N,...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <stack> #include <string> #include <unordered_set> #include <vector> using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; int main() { int N,...
replace
35
36
35
36
0
p02802
C++
Runtime Error
/*---> 16 January 2020 <--- > 12:06:36 <---*/ // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC optimize("unroll-loops") // #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") // #pragma GCC target ("sse4") #include <bits/...
/*---> 16 January 2020 <--- > 12:06:36 <---*/ // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma GCC optimize("unroll-loops") // #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("O3") // #pragma GCC target ("sse4") #include <bits/...
replace
92
94
92
94
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <cmath> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF = 1001001...
#include <bits/stdc++.h> using namespace std; #include <cmath> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF = 1001001...
replace
41
42
41
42
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define _LIBCPP_DEBUG 0 using namespace std; int main() { int64_t n, m, ans, penalty; int64_t p; string s; ans = 0; penalty = 0; cin >> n >> m; vector<int> ac(n); vector<int> wa(n); for (int64_t i = 0; i < n; i++) { ac.at(i) = 0; wa.at(i) = 0; } // vector<int> ...
#include <bits/stdc++.h> #define _LIBCPP_DEBUG 0 using namespace std; int main() { int64_t n, m, ans, penalty; int64_t p; string s; ans = 0; penalty = 0; cin >> n >> m; vector<int> ac(n); vector<int> wa(n); for (int64_t i = 0; i < n; i++) { ac.at(i) = 0; wa.at(i) = 0; } // vector<int> ...
replace
39
40
39
40
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ac(N - 1, 0), wa(N - 1, 0); int num; string result; int ac_cnt = 0, wa_cnt = 0; for (int i = 0; i < M; i++) { cin >> num >> result; if (result == "AC") { if (ac[num - 1] == 1) { continue...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> ac(N, 0), wa(N, 0); int num; string result; int ac_cnt = 0, wa_cnt = 0; for (int i = 0; i < M; i++) { cin >> num >> result; if (result == "AC") { if (ac[num - 1] == 1) { continue; ...
replace
7
8
7
8
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long int #define N 200100 #define pii pair<int, int> #define rep(i, k, n) for (int i = k; i < n; i++) #define vi vector<int> #define inf 1e9 void solve() { int n, m; cin >> n >> m; map<int, int> mp; map<int, bool> ms; ll ans ...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long int #define N 200100 #define pii pair<int, int> #define rep(i, k, n) for (int i = k; i < n; i++) #define vi vector<int> #define inf 1e9 void solve() { int n, m; cin >> n >> m; map<int, int> mp; map<int, bool> ms; ll ans ...
delete
34
38
34
34
0
p02802
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> using namespace std; int main() { int n, m; cin >> n >> m; vector<P> judge(n); int ac = 0, wa = 0; rep(i, m) { int p; cin >> p; string s; cin >> s; if (s == "AC" && judge[...
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) #define P pair<int, int> using namespace std; int main() { int n, m; cin >> n >> m; vector<P> judge(n); int ac = 0, wa = 0; rep(i, m) { int p; cin >> p; p--; string s; cin >> s; if (s == "AC" ...
insert
14
14
14
15
0
p02802
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using ll = long long; #define rep(inc, bgn, end) for (int inc = bgn; inc < end; ++inc) #define repe(inc, bgn, end) for (int inc = bgn; inc <= end; ++inc) using namespace std; int digit(int n) { return (int)(log10(n) + 1); }...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using ll = long long; #define rep(inc, bgn, end) for (int inc = bgn; inc < end; ++inc) #define repe(inc, bgn, end) for (int inc = bgn; inc <= end; ++inc) using namespace std; int digit(int n) { return (int)(log10(n) + 1); }...
replace
23
25
23
25
0