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
p02959
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; #define MIN(X, Y) (((X) > (Y)) ? (Y) : (X)) int main() { int N, num = 0; vector<int> A; cin >> N; for (int i = 0; i < N + 1; i++) cin >> A[i]; for (int i = 0; i < N; i++) { int b1; cin >> b1; int left = MIN(A[i], b1); num += left...
#include <iostream> #include <vector> using namespace std; #define MIN(X, Y) (((X) > (Y)) ? (Y) : (X)) int main() { int N; long long num = 0; int A[100001]; cin >> N; for (int i = 0; i < N + 1; i++) cin >> A[i]; for (int i = 0; i < N; i++) { int b1; cin >> b1; int left = MIN(A[i], b1); ...
replace
7
9
7
10
-11
p02959
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < n; i++) int main(void) { int N; cin >> N; vi A(N), B(N - 1); rep(i, N + 1) { cin >> A[i]; } rep(i, N) { cin >> B[i]; } long count = 0; rep(i, N) { // 正面撃破 // モンスターの方が多い場合 ...
#include <iostream> #include <vector> using namespace std; typedef vector<int> vi; #define rep(i, n) for (int i = 0; i < n; i++) int main(void) { int N; cin >> N; vi A(N + 1), B(N); rep(i, N + 1) { cin >> A[i]; } rep(i, N) { cin >> B[i]; } long count = 0; rep(i, N) { // 正面撃破 // モンスターの方が多い場合 ...
replace
9
10
9
10
0
p02959
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sst...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sst...
replace
27
28
27
28
0
p02959
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; int N; ll sum_ll(vector<int> vec) { ll _sum = 0; rep(i, (int)vec.size()) _sum += vec[i]; return _sum; } void beat(int &_hero, int &_enemy) { while (_hero > 0 && _...
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; int N; ll sum_ll(vector<int> vec) { ll _sum = 0; rep(i, (int)vec.size()) _sum += vec[i]; return _sum; } void beat(int &_hero, int &_enemy) { if (_hero < _enemy) {...
replace
15
18
15
21
TLE
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; int A[20000]; int B[20000]; cin >> n; for (int i = 0; i < n + 1; i++) { cin >> A[i]; } for (int i = 0; i < n; i++) { cin >> B[i]; } long long ans = 0; int del; int sub; for (int i = 0; i < n; i++) { del = min(A[i], B[...
#include <bits/stdc++.h> using namespace std; int main() { int n; int A[200000]; int B[200000]; cin >> n; for (int i = 0; i < n + 1; i++) { cin >> A[i]; } for (int i = 0; i < n; i++) { cin >> B[i]; } long long ans = 0; int del; int sub; for (int i = 0; i < n; i++) { del = min(A[i], ...
replace
4
6
4
6
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int n, a[10005], b[10005], ans = 0; signed main() { cin >> n; for (int i = 1; i <= n + 1; cin >> a[i++]) ; for (int i = 1; i <= n; cin >> b[i++]) ; for (int i = 1; i <= n; i++) { if (b[i] >= a[i]) { ans += min(b[i], a[i] + ...
#include <bits/stdc++.h> using namespace std; #define int long long int n, a[100005], b[100005], ans = 0; signed main() { cin >> n; for (int i = 1; i <= n + 1; cin >> a[i++]) ; for (int i = 1; i <= n; cin >> b[i++]) ; for (int i = 1; i <= n; i++) { if (b[i] >= a[i]) { ans += min(b[i], a[i] ...
replace
5
6
5
6
0
p02959
C++
Runtime Error
/**************************************************** * Template for coding contests * * Author : Sanjeev Sharma * * Email : thedevelopersanjeev@gmail.com * *****************************************************/ #pragma GCC optimize("O3") #pragma GCC target...
/**************************************************** * Template for coding contests * * Author : Sanjeev Sharma * * Email : thedevelopersanjeev@gmail.com * *****************************************************/ #pragma GCC optimize("O3") #pragma GCC target...
replace
20
21
20
21
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, x) REPI(i, 0, x) #define REPI(i, a, b) for (int i = int(a); i < int(b); ++i) #define ALL(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<ll> A(N + 1); REP(i, N + 1) ...
#include <bits/stdc++.h> #define REP(i, x) REPI(i, 0, x) #define REPI(i, a, b) for (int i = int(a); i < int(b); ++i) #define ALL(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<ll> A(N + 1); REP(i, N + 1) ...
replace
22
26
22
31
-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)
p02959
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int inputValue() { int a; cin >> a; return a; }; vo...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int inputValue() { int a; cin >> a; return a; }; vo...
replace
36
69
36
44
TLE
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; #define rep(i, x, y) \ for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \ i < i##_max_for_repmacro; ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #de...
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; #define rep(i, x, y) \ for (i64 i = i64(x), i##_max_for_repmacro = i64(y); \ i < i##_max_for_repmacro; ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #de...
replace
162
165
162
167
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long n, a[100001], b[100001], ans, zero = 0; int main() { cin >> n; for (int i = 1; i <= n + 1; i++) cin >> a[i]; for (int i = 1; i <= n; i++) { cin >> b[i]; if (b[i] > a[i]) { ans += min(a[i] + a[i + 1], b[i]); a[i + 1] = max(zero, a[i] +...
#include <bits/stdc++.h> using namespace std; long long n, a[100005], b[100001], ans, zero = 0; int main() { cin >> n; for (int i = 1; i <= n + 1; i++) cin >> a[i]; for (int i = 1; i <= n; i++) { cin >> b[i]; if (b[i] > a[i]) { ans += min(a[i] + a[i + 1], b[i]); a[i + 1] = max(zero, a[i] +...
replace
2
3
2
3
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <math.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; #define rep(i, n) \ ; ...
#include <bits/stdc++.h> #include <cmath> #include <math.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; #define rep(i, n) \ ; ...
replace
69
70
69
70
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[10005]; long long ans = 0; for (int i = 1; i <= n + 1; ++i) cin >> a[i]; for (int i = 1, b; i <= n; ++i) { cin >> b; int x = max(0, a[i] - b); ans += a[i] - x; b -= a[i] - x; a[i] = x; if (b > 0) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[100005]; long long ans = 0; for (int i = 1; i <= n + 1; ++i) cin >> a[i]; for (int i = 1, b; i <= n; ++i) { cin >> b; int x = max(0, a[i] - b); ans += a[i] - x; b -= a[i] - x; a[i] = x; if (b > 0) {...
replace
5
6
5
6
0
p02959
C++
Runtime Error
#include "bits/stdc++.h" #define rep(i, b) for (ll i = 0; i < b; i++) #define ll long long using namespace std; #define vl vector<ll> #define vvl vector<vector<ll>> #define vvvl vector<vector<vector<ll>>> #define debug(x) cerr << #x << " " << x << '\n'; int main() { ll n, ans = 0; cin >> n; vl a(n + 1), b(n); ...
#include "bits/stdc++.h" #define rep(i, b) for (ll i = 0; i < b; i++) #define ll long long using namespace std; #define vl vector<ll> #define vvl vector<vector<ll>> #define vvvl vector<vector<vector<ll>>> #define debug(x) cerr << #x << " " << x << '\n'; int main() { ll n, ans = 0; cin >> n; vl a(n + 1), b(n); ...
replace
15
18
15
18
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> #define debug(x) cerr << #x << ':' << x << endl #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define ALL(c) (c).begin(), (c).end() using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<ll> A(n, 0LL), B(n, 0LL); ...
#include <bits/stdc++.h> #define debug(x) cerr << #x << ':' << x << endl #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define ALL(c) (c).begin(), (c).end() using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<ll> A(n + 1, 0LL), B(n, 0L...
replace
12
13
12
13
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; vector<int> monster(n), hero(n - 1); for (int i = 0; i < n + 1; i++) { cin >> monster[i]; } for (int i = 0; i < n; i++) { cin >> hero[i]; } ll ans = 0; int force; for (int i = 0; i < n; i++) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; vector<int> monster(n + 1), hero(n); for (int i = 0; i < n + 1; i++) { cin >> monster[i]; } for (int i = 0; i < n; i++) { cin >> hero[i]; } ll ans = 0; int force; for (int i = 0; i < n; i++) ...
replace
8
9
8
9
0
p02959
Python
Runtime Error
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) s1 = sum(a) for i in range(n + 1): if i == 0: if a[i] < b[i]: b[i] -= a[i] a[i] = 0 else: a[i] -= b[i] b[i] = 0 elif i == n: if a[i] < b[i - 1]: ...
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) s1 = sum(a) for i in range(n + 1): if i == 0: if a[i] < b[i]: b[i] -= a[i] a[i] = 0 else: a[i] -= b[i] b[i] = 0 elif i == n: if a[i] < b[i - 1]: ...
replace
18
19
18
19
IndexError: list assignment index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02959/Python/s937691477.py", line 19, in <module> b[i] = 0 IndexError: list assignment index out of range
p02959
Python
Runtime Error
# coding:utf-8 n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for i in range(n): if a[i] >= b[i]: ans += b[i] else: ans += a[i] b[i] -= a[i] if a[i + 1] >= b[i]: a[i + 1] -= b[i] ans += b[i] else:...
# coding:utf-8 n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for i in range(n): if a[i] >= b[i]: ans += b[i] else: ans += a[i] b[i] -= a[i] if a[i + 1] >= b[i]: a[i + 1] -= b[i] ans += b[i] else:...
replace
17
18
17
18
0
p02959
Python
Runtime Error
def solve(string): n, *ab = map(int, string.split()) a, b = ab[: n + 1], ab[n + 1 :] _sum = sum(a) for i, _b in enumerate(b[::-1]): if a[n - i] < _b: _b -= a[n - i] a[n - i] = 0 a[n - i - 1] = max(0, a[n - i - 1] - _b) else: a[n - i] -= _b ...
def solve(string): n, *ab = map(int, string.split()) a, b = ab[: n + 1], ab[n + 1 :] _sum = sum(a) for i, _b in enumerate(b[::-1]): if a[n - i] < _b: _b -= a[n - i] a[n - i] = 0 a[n - i - 1] = max(0, a[n - i - 1] - _b) else: a[n - i] -= _b ...
replace
16
17
16
17
0
p02959
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <string.h> #include <vector> using namespace std; #define rpt(i, n) for (i = 0; i < (n); i++) typedef long long ll; int main(void) { ll n, a[10 ^ 5 + 1], b[10 ^ 5], i, j, count = 0; cin >> n; for (i = 0; i < n + 1; i++) { cin >> a[i]; } rpt(i, n) { cin >>...
#include <iostream> #include <stdio.h> #include <string.h> #include <vector> using namespace std; #define rpt(i, n) for (i = 0; i < (n); i++) typedef long long ll; int main(void) { ll n, a[100005], b[100000], i, j, count = 0; cin >> n; for (i = 0; i < n + 1; i++) { cin >> a[i]; } rpt(i, n) { cin >> b[i...
replace
10
11
10
11
0
p02959
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++) int main() { int n; cin >> n; vector<ll> a(n), b(n); ll sum1 = 0; rep(i, n + 1) { cin >> a[i]; sum1 += a[i]; } rep(i, n) cin >> b[i]; rep(i, n) { if (b[i] <= a[i]) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; vector<ll> a(n + 1), b(n); ll sum1 = 0; rep(i, n + 1) { cin >> a[i]; sum1 += a[i]; } rep(i, n) cin >> b[i]; rep(i, n) { if (b[i] <= a[i]) ...
replace
8
9
8
9
0
p02959
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <deque> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; using Graph = vector<vector<int>>; long long larger(long long a, long long b) { if (a >= b) { return a; } else { return b; } } long lo...
#include <algorithm> #include <bits/stdc++.h> #include <deque> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; using Graph = vector<vector<int>>; long long larger(long long a, long long b) { if (a >= b) { return a; } else { return b; } } long lo...
replace
42
43
42
43
0
p02959
C++
Runtime Error
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int N; cin >> N; vector<int> A(N + 1), B(N + 1); rep(i, N + 1) cin >> A[i]; rep(i, N) cin >> B[i]; B[N + 1] = 0; long long sum = 0; rep(i, N) ...
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int N; cin >> N; int A[100001], B[100001]; rep(i, N + 1) cin >> A[i]; rep(i, N) cin >> B[i]; B[N + 1] = 0; long long sum = 0; rep(i, N) sum +=...
replace
12
13
12
13
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; int n, a[10005], b[10005], sum; signed main() { cin >> n; for (int i = 1; i <= n + 1; i++) cin >> a[i]; for (int i = 1; i <= n; i++) cin >> b[i]; for (int i = 1; i <= n; i++) { if (b[i] < a[i]) { a[i] -= b[i], sum += b[i]; ...
#include <bits/stdc++.h> #define int long long using namespace std; int n, a[100005], b[100005], sum; signed main() { cin >> n; for (int i = 1; i <= n + 1; i++) cin >> a[i]; for (int i = 1; i <= n; i++) cin >> b[i]; for (int i = 1; i <= n; i++) { if (b[i] < a[i]) { a[i] -= b[i], sum += b[i]; ...
replace
3
4
3
4
0
p02959
C++
Runtime Error
#include <algorithm> #include <bitset> #include <functional> #include <initializer_list> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long int ll; int main() { ll N; cin >> N; vector<ll> A(N + 1); vector<ll> B(N); for (ll i = 0; ...
#include <algorithm> #include <bitset> #include <functional> #include <initializer_list> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long int ll; int main() { ll N; cin >> N; vector<ll> A(N + 1); vector<ll> B(N); for (ll i = 0; ...
delete
41
46
41
41
0
p02959
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<long long> cities(n + 1); vector<long long> heros(n + 1); for (int i = 0; i < n + 1; i++) { cin >> cities[i]; } for (int i = 0; i < n; i++) { cin >> heros[i]; } heros[n + 1] =...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<long long> cities(n + 1); vector<long long> heros(n + 1); for (int i = 0; i < n + 1; i++) { cin >> cities[i]; } for (int i = 0; i < n; i++) { cin >> heros[i]; } heros[n] = 0; ...
replace
17
18
17
18
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p02959
C++
Runtime Error
#include <bits/stdc++.h> #include <string.h> // #include <queue> using namespace std; #define ll long long #define ld long double #define itvector(it, x) for (auto it : x) #define FOR(x, a, b) for (int x = a; x <= b; ++x) #define FOD(x, a, b) for (int x = a; x >= b; --x) // #define Phuong // <3 love my GF // still lea...
#include <bits/stdc++.h> #include <string.h> // #include <queue> using namespace std; #define ll long long #define ld long double #define itvector(it, x) for (auto it : x) #define FOR(x, a, b) for (int x = a; x <= b; ++x) #define FOD(x, a, b) for (int x = a; x >= b; --x) // #define Phuong // <3 love my GF // still lea...
replace
15
16
15
16
-6
terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size()
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long n, ans = 0; cin >> n; vector<long> a(n + 1); vector<long> b(n); for (int i = 0; i < n + 1; i++) cin >> a.at(i); for (int i = 0; i < n; i++) cin >> b.at(i); for (int i = 0; i < n; i++) { if (a.at(i) <= b.at(i)) { b.at(i) -= ...
#include <bits/stdc++.h> using namespace std; int main() { long n, ans = 0; cin >> n; vector<long> a(n + 1); vector<long> b(n); for (int i = 0; i < n + 1; i++) cin >> a.at(i); for (int i = 0; i < n; i++) cin >> b.at(i); for (int i = 0; i < n; i++) { if (a.at(i) <= b.at(i)) { b.at(i) -= ...
replace
21
22
21
22
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<long long> a(n + 1), b(n); for (int i = 0; i < n + 1; ++i) { cin >> a[i]; } for (int j = 0; j < n; ++j) { cin >> b[j]; } long long ans = 0; vector<long long> a2 = a, b2 = b; for (int i = 0; i < n; ++i) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<long long> a(n + 1), b(n); for (int i = 0; i < n + 1; ++i) { cin >> a[i]; } for (int j = 0; j < n; ++j) { cin >> b[j]; } long long ans = 0; vector<long long> a2 = a, b2 = b; for (int i = 0; i < n; ++i) { ...
replace
40
41
40
41
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int N; int A[10001], B[10000]; int sum = 0; cin >> N; for (int i = 0; i <= N; ++i) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; ++i) cin >> B[i]; for (int i = 0; i < N; ++i) { for (int j = 0; j <= 1; ++j) { ...
#include <bits/stdc++.h> using namespace std; int main(void) { int N; long long A[100001], B[100000]; long long sum = 0; cin >> N; for (int i = 0; i <= N; ++i) { cin >> A[i]; sum += A[i]; } for (int i = 0; i < N; ++i) cin >> B[i]; for (int i = 0; i < N; ++i) { for (int j = 0; j <= 1;...
replace
6
8
6
8
0
p02959
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const long long INF = 1e7 + 1; const long long MOD = 1000000007; const long double PI = 3.1415926; #define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i) #define RFOR(i, r, n) for (ll i = (ll)(n - 1); i >= r; --i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFO...
#include <bits/stdc++.h> using namespace std; const long long INF = 1e7 + 1; const long long MOD = 1000000007; const long double PI = 3.1415926; #define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i) #define RFOR(i, r, n) for (ll i = (ll)(n - 1); i >= r; --i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFO...
replace
42
45
42
48
TLE
p02959
C++
Runtime Error
// This code was made by Chinese_zjc_ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> #define int long long #define INF 0x3fffffffffffffff using namespace std; inline int rd(int &ddd) { char tmp = getchar(); int xxx = 1; ddd = 0; while (('0' > tmp || tmp > '9') && t...
// This code was made by Chinese_zjc_ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> #define int long long #define INF 0x3fffffffffffffff using namespace std; inline int rd(int &ddd) { char tmp = getchar(); int xxx = 1; ddd = 0; while (('0' > tmp || tmp > '9') && t...
replace
41
42
41
42
0
p02959
C++
Runtime Error
#include <algorithm> //sort() #include <iostream> #include <numeric> #include <stdlib.h> #include <tuple> #include <vector> //vector #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() // #define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << // endl;} typede...
#include <algorithm> //sort() #include <iostream> #include <numeric> #include <stdlib.h> #include <tuple> #include <vector> //vector #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() // #define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << // endl;} typede...
replace
52
55
52
56
0
p02959
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; cin >> n; vector<long> a(n + 1); rep(i, n + 1) cin >> a[i]; vector<long> b(n); rep(i, n + 1) cin >> b[i]; b[n] = 0; long c; c = 0; rep(i, n + 1) { long l = min(a[i], b[i]); ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) int main() { int n; cin >> n; vector<long> a(n + 1); rep(i, n + 1) cin >> a[i]; vector<long> b(n + 1); rep(i, n) cin >> b[i]; b[n] = 0; long c; c = 0; rep(i, n + 1) { long l = min(a[i], b[i]); ...
replace
9
11
9
11
0
p02959
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int n; long b, c, t; cin >> n; vector<long> a(n); for (int i = 0; i < n + 1; ++i) cin >> a[i]; c = 0; for (int i = 0; i < n; ++i) { cin >> b; t = min(b, a[i] + a[i + 1]); c += t; a[i + 1] -= t - min(b, a[i]); }...
#include <iostream> #include <vector> using namespace std; int main() { int n; long b, c, t; cin >> n; vector<long> a(n + 1); for (int i = 0; i < n + 1; ++i) cin >> a[i]; c = 0; for (int i = 0; i < n; ++i) { cin >> b; t = min(b, a[i] + a[i + 1]); c += t; a[i + 1] -= t - min(b, a[i]);...
replace
8
9
8
9
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; /* #pragma */ // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") /*alias*/ #define F first #define S second #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext ...
#include <bits/stdc++.h> using namespace std; /* #pragma */ // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") /*alias*/ #define F first #define S second #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext ...
replace
89
90
89
90
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(v) v.begin(), v.end() typedef long long ll; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll x, ll y) { return x * y / GCD(x, y); } int main() { int n; cin >> ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(v) v.begin(), v.end() typedef long long ll; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll x, ll y) { return x * y / GCD(x, y); } int main() { int n; cin >> ...
replace
29
30
29
30
0
p02959
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int N; cin >> N; vector<ll> A(N + 1), B(N); for (int i = 0; i < N + 1; i++) { cin >> A[i]; } for (int i = 0; i < N; i++) { cin >> B[i]; } ll ans = 0; for (int i = 0; i < N + 1; i++) { ll sub = min(A[i], B[i...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int N; cin >> N; vector<int> A(N + 1), B(N); for (int i = 0; i < N + 1; i++) { cin >> A[i]; } for (int i = 0; i < N; i++) { cin >> B[i]; } ll ans = 0; for (int i = 0; i < N + 1; i++) { ll sub = min(A[i], B[...
replace
9
10
9
10
0
p02960
C++
Runtime Error
// C #include <bits/stdc++.h> using ll = long long; using namespace std; ll mod = 1e9 + 7; int main() { string s; cin >> s; int N = s.size(); ll dp[10001][13] = {0}; if (s[0] == '?') { for (int i(0); i <= 9; i++) { dp[1][i] = 1; } } else { dp[1][s[0] - '0'] = 1; } for (int i(2); i <=...
// C #include <bits/stdc++.h> using ll = long long; using namespace std; ll mod = 1e9 + 7; int main() { string s; cin >> s; int N = s.size(); ll dp[100001][13] = {0}; if (s[0] == '?') { for (int i(0); i <= 9; i++) { dp[1][i] = 1; } } else { dp[1][s[0] - '0'] = 1; } for (int i(2); i <...
replace
11
12
11
12
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define all(a) a.begin(), a.end() #define F first #define S second #define pb push_back #define ll long long #define vi vector<int> #define pi pair<int, int> #define mp make_pair #define endl '\n' #define _ << ' ' #de...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define all(a) a.begin(), a.end() #define F first #define S second #define pb push_back #define ll long long #define vi vector<int> #define pi pair<int, int> #define mp make_pair #define endl '\n' #define _ << ' ' #de...
replace
26
27
26
27
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; typedef long long ll; ll n; char M[101010][13] = {}; ll dp[1010][1010] = {}; ll cnt = LLONG_MAX; ll B = 1000000007; int main() { string s; cin >> s; dp[0][0] = 1; rep...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; typedef long long ll; ll n; char M[101010][13] = {}; ll dp[101010][1010] = {}; ll cnt = LLONG_MAX; ll B = 1000000007; int main() { string s; cin >> s; dp[0][0] = 1; r...
replace
8
9
8
9
0
p02960
C++
Runtime Error
#include <cmath> #include <cstdlib> #include <iostream> #include <stdint.h> #include <string> #include <utility> #include <vector> using namespace std; unsigned dp[10000][13] = {0}; int main() { string S; cin >> S; if (S[0] == '?') for (int ii = 0; ii < 10; ++ii) { dp[0][ii] = 1; } else dp...
#include <cmath> #include <cstdlib> #include <iostream> #include <stdint.h> #include <string> #include <utility> #include <vector> using namespace std; unsigned dp[100000][13] = {0}; int main() { string S; cin >> S; if (S[0] == '?') for (int ii = 0; ii < 10; ++ii) { dp[0][ii] = 1; } else d...
replace
10
11
10
11
0
p02960
C++
Runtime Error
// 解説見た #include <bits/stdc++.h> typedef long long lint; using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rrep(i, n) for (int i = 1, i##_len = (n); i < i##_len; ++i) const int MOD = 1000000007; int main() { string s; cin >> s; int dp[10001][13] = {0}; dp[0][0] = 1;...
// 解説見た #include <bits/stdc++.h> typedef long long lint; using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rrep(i, n) for (int i = 1, i##_len = (n); i < i##_len; ++i) const int MOD = 1000000007; int main() { string s; cin >> s; int dp[100001][13] = {0}; dp[0][0] = 1...
replace
10
11
10
11
0
p02960
C++
Runtime Error
//------------------------------------------ // C++ templete //------------------------------------------ #include <bits/stdc++.h> #include <iomanip> using namespace std; using ll = long long; #define endl "\n" // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI;...
//------------------------------------------ // C++ templete //------------------------------------------ #include <bits/stdc++.h> #include <iomanip> using namespace std; using ll = long long; #define endl "\n" // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI;...
replace
103
104
103
104
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define fi first #define se second const ll MOD = 1000000007; int main() { char temp[10000]; scanf("%s", temp); string s = temp; vector<vector<ll>> dp(s.length(), vector<ll>(13)); if (s[0] == '?') { for (int i = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define fi first #define se second const ll MOD = 1000000007; int main() { char temp[100000]; scanf("%s", temp); string s = temp; vector<vector<ll>> dp(s.length(), vector<ll>(13)); if (s[0] == '?') { for (int i =...
replace
13
14
13
14
0
p02960
Python
Runtime Error
M = 10**9 + 7 a = [1] + [0] * 12 p = 1 for c in reversed(input()): r = (0, p * 10) if c == "?" else (int(c), int(c) + 1) a = [sum(a[(i - j) % 13] for j in range(*r, p)) % M for i in range(13)] p = p * 10 % 13 print(a[5])
M = 10**9 + 7 a = [1] + [0] * 12 p = 1 for c in reversed(input()): x, y = (0, p * 10) if c == "?" else (p * int(c), p * int(c) + 1) a = [sum(a[(i - j) % 13] for j in range(x, y, p)) % M for i in range(13)] p = p * 10 % 13 print(a[5])
replace
4
6
4
6
0
p02960
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() { string s; cin >> s; const int n = 13; vector<vector<ll>> dp(100001, vector<ll>(n)); ll mod = 1000000007; int mul = 1; dp[s.length()][0] = 1; for (int i = s.length() - 1; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { string s; cin >> s; const int n = 13; vector<vector<ll>> dp(100001, vector<ll>(n)); ll mod = 1000000007; int mul = 1; dp[s.length()][0] = 1; for (int i = s.length() - 1; ...
insert
33
33
33
34
0
p02960
Python
Runtime Error
M = 10**9 + 7 a = [1] + [0] * 12 p = 1 for c in reversed(input()): r = [x % 13 for x in range(0, p * 10, p)] if c == "?" else (p * int(c),) a = [sum(a[(i - j, i - j + 13)[i < j]] for j in r) % M for i in range(13)] p = p * 10 % 13 print(a[5])
M = 10**9 + 7 a = [1] + [0] * 12 p = 1 for c in reversed(input()): r = [x % 13 for x in range(0, p * 10, p)] if c == "?" else (p * int(c) % 13,) a = [sum(a[(i - j, i - j + 13)[i < j]] for j in r) % M for i in range(13)] p = p * 10 % 13 print(a[5])
replace
4
5
4
5
0
p02960
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <random> #include <sstream> #include <stack> #include <string> #include <typeinfo> #include <vector> using namespace std; typedef long long int ll; ll MOD = 1000000007; int main() { string S; ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <random> #include <sstream> #include <stack> #include <string> #include <typeinfo> #include <vector> using namespace std; typedef long long int ll; ll MOD = 1000000007; int main() { string S; ...
replace
27
28
27
28
-11
p02960
Python
Time Limit Exceeded
s = input() mod = 1000000007 n = 13 dp = [0] * 13 dp[0] = 1 mul = 1 for i in reversed(range(len(s))): nextDp = [0] * 13 if s[i] == "?": for k in range(10): for j in range(n): nextDp[(k * mul + j) % n] += dp[j] for j in range(n): nextDp[j] %= mod els...
s = input() mod = 1000000007 n = 13 dp = [0] * 13 dp[0] = 1 mul = 1 for i in reversed(range(len(s))): nextDp = [0] * 13 if s[i] == "?": for k in range(10): for j in range(n): nextDp[(k * mul + j) % n] += dp[j] for j in range(n): nextDp[j] %= mod els...
replace
25
26
25
26
TLE
p02960
Python
Time Limit Exceeded
import numpy as np def solve(s): MOD = 10**9 + 7 dp = np.zeros(13, dtype=np.int64) dp[0] = 1 idx = np.zeros(13, dtype=np.int8) for i in range(13): idx[i * 10 % 13] = i window = np.ones(10, dtype=np.int8) for c in s: if c == "?": dp = np.convolve(dp[idx], window)...
import numpy as np def solve(s): MOD = 10**9 + 7 dp = np.zeros(13, dtype=np.int64) dp[0] = 1 idx = np.zeros(13, dtype=np.int8) for i in range(13): idx[i * 10 % 13] = i window = np.ones(10, dtype=np.int8) for c in s: if c == "?": tdp = dp[idx] ndp = n...
replace
13
16
13
16
TLE
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #defin...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> II; typedef vector<II> VII; typedef vector<int> VI; typedef vector<VI> VVI; typedef long long int LL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #defin...
replace
122
126
122
126
0
p02960
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>; ll dp[10001][13]; const ll MOD = (ll)1e9 + 7; void solve() { string s; cin >> s; dp[0][0] = 1; int n = s.size(); s.push_back('0'); reverse(s.begin(), s.end()); l...
#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>; ll dp[100005][13]; const ll MOD = (ll)1e9 + 7; void solve() { string s; cin >> s; dp[0][0] = 1; int n = s.size(); s.push_back('0'); reverse(s.begin(), s.end()); ...
replace
6
7
6
7
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = s; i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(n) (...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = s; i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(n) (...
replace
38
39
38
39
-11
p02960
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; ll mod = 1000000007; string S; vector<vector<ll>> dp(10005, vector<ll>(13, 0)); int main() { cin >> S; int N = (int)S.size(); for (int i = 0; i < N; i++) { char c = (char)S[i]; int t = c - '0'; if (c ...
#include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; ll mod = 1000000007; string S; vector<vector<ll>> dp(100005, vector<ll>(13, 0)); int main() { cin >> S; int N = (int)S.size(); for (int i = 0; i < N; i++) { char c = (char)S[i]; int t = c - '0'; if (c...
replace
8
9
8
9
0
p02960
Python
Runtime Error
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**7) # Override `input` function because `stdin.readline()` is 10x faster than built-in `input()` input = sys.stdin.readline def read_h(typ=int): return list(map(typ, input().split())) def read_v(n, m=1, typ=int): return [read_h(typ) if m > 1 else...
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**7) # Override `input` function because `stdin.readline()` is 10x faster than built-in `input()` input = sys.stdin.readline def read_h(typ=int): return list(map(typ, input().split())) def read_v(n, m=1, typ=int): return [read_h(typ) if m > 1 else...
replace
24
25
24
25
0
p02960
Python
Runtime Error
import itertools S = input()[::-1] mod = 10**9 + 7 A = [0] * 13 N = 0 for i, v in enumerate(S): p = pow(10, i, 13) if v == "?": A[p] += 1 else: N += int(v) * p N %= 13 dp = [0] * 13 dp[N] = 1 for i, v in enumerate(A): for _ in range(v): dp_old = dp.copy() for j, ...
import itertools S = input()[::-1] mod = 10**9 + 7 A = [0] * 13 N = 0 for i, v in enumerate(S): p = pow(10, i, 13) if v == "?": A[p] += 1 else: N += int(v) * p N %= 13 dp = [0] * 13 dp[N] = 1 for i, v in enumerate(A): for _ in range(v): dp_old = dp[:] for j, k in...
replace
17
18
17
18
0
p02960
Python
Time Limit Exceeded
def main(): MOD = 10**9 + 7 S = input() N = len(S) dp = [[0 for _ in range(13)] for _ in range(N + 1)] dp[0][0] = 1 for i, c in enumerate(S): for j in range(10): if c != "?" and c != str(j): continue for k in range(13): dp[i + 1][(1...
def main(): MOD = 10**9 + 7 S = input() N = len(S) dp = [[0 for _ in range(13)] for _ in range(N + 1)] dp[0][0] = 1 for i, c in enumerate(S): for j in range(10): if c != "?" and c != str(j): continue for k in range(13): dp[i + 1][(1...
replace
12
13
12
14
TLE
p02960
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <vector> #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define REPx(x, a) for (auto x : a) #define ALL(a) a.begin(), a.end() #define SORT(a) sort(ALL(a)) #define SORTG(a) sort(ALL(a), greater<int>()) #define REVERSE(a) reverse(AL...
#include <bits/stdc++.h> #include <vector> #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define REPx(x, a) for (auto x : a) #define ALL(a) a.begin(), a.end() #define SORT(a) sort(ALL(a)) #define SORTG(a) sort(ALL(a), greater<int>()) #define REVERSE(a) reverse(AL...
replace
29
32
29
34
TLE
p02960
C++
Runtime Error
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(1e9 + 7)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i =...
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(1e9 + 7)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i =...
replace
71
72
71
72
0
p02960
Python
Time Limit Exceeded
# import sys # fin = sys.stdin.readline MOD = 10**9 + 7 S = input()[::-1] dp = [[0] * 13 for _ in range(len(S) + 1)] dp[0][0] = 1 for i, c in enumerate(S, start=1): base = 10 ** (i - 1) % 13 if c != "?": d = int(c) * base % 13 for r in range(13): c = (d + r) % 13 dp[i][...
# import sys # fin = sys.stdin.readline MOD = 10**9 + 7 S = input()[::-1] dp = [[0] * 13 for _ in range(len(S) + 1)] dp[0][0] = 1 for i, c in enumerate(S, start=1): base = pow(10, i - 1, 13) if c != "?": d = int(c) * base % 13 for r in range(13): c = (d + r) % 13 dp[i][...
replace
9
10
9
10
TLE
p02960
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define rrep...
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define rrep...
insert
49
49
49
50
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) typedef long long ll; const int Inf = 1e9 + 7; const double EPS = 1e-9; const int n = 13; int gcd(int a, int b) { if (b == 0) { return a; } else { retur...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) typedef long long ll; const int Inf = 1e9 + 7; const double EPS = 1e-9; const int n = 13; int gcd(int a, int b) { if (b == 0) { return a; } else { retur...
replace
37
39
37
39
-11
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; string s; ll dp[10005][15]; int main() { ios::sync_with_stdio(false); cin >> s; int n = s.length(); s = "*" + s; dp[0][0] = 1; for (int i = 1; i <= n; i++) { if (s[i] == '?') { for (int j = 0; j < 13; j++) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; string s; ll dp[100005][15]; int main() { ios::sync_with_stdio(false); cin >> s; int n = s.length(); s = "*" + s; dp[0][0] = 1; for (int i = 1; i <= n; i++) { if (s[i] == '?') { for (int j = 0; j < 13; j++)...
replace
5
6
5
6
0
p02960
C++
Time Limit Exceeded
#include <bits/stdc++.h> #ifdef _DEBUG #define debug(x) \ cerr << "line: " << __LINE__ << ", func: " << __func__ << " -> " << #x \ << " = " << x << endl #else #define debug(x) #endif #define all(s) begin(s), end(s) #define rall(s) rbegin(s),...
#include <bits/stdc++.h> #ifdef _DEBUG #define debug(x) \ cerr << "line: " << __LINE__ << ", func: " << __func__ << " -> " << #x \ << " = " << x << endl #else #define debug(x) #endif #define all(s) begin(s), end(s) #define rall(s) rbegin(s),...
replace
57
60
57
59
TLE
p02960
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; ll MOD = 1000000000 + 7; ll c[100050][13]; int initCount() { for (ll yi = 0; yi < 100050; yi++) { for (ll xi = 0; xi < 13; xi++) { c[yi][x...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; ll MOD = 1000000000 + 7; ll c[100050][13]; int initCount() { for (ll yi = 0; yi < 100050; yi++) { for (ll xi = 0; xi < 13; xi++) { c[yi][x...
replace
20
21
20
21
TLE
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; int main() { vector<vector<ll>> dp(100000, vector<ll>(13)); int l, i, j, k; string S; cin >> S; l = S.size(); dp.at(0).at(0) = 1; for (i = 0; i < l; i++) { int c; if (S.at(i) == '?') c = -1; els...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; int main() { vector<vector<ll>> dp(100005, vector<ll>(13, 0)); int l, i, j, k; string S; cin >> S; l = S.size(); dp.at(0).at(0) = 1; for (i = 0; i < l; i++) { int c; if (S.at(i) == '?') c = -1; ...
replace
6
7
6
7
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
replace
39
40
39
40
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int m = 1e9 + 7; vector<int> v; int p[7] = {1, 10, 100, 1000, 10000, 100000, 1000000}; int a[100000][13], r; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '?') v.push_back(s.size() - i - 1); else { r = (r +...
#include <bits/stdc++.h> using namespace std; const int m = 1e9 + 7; vector<int> v; int p[7] = {1, 10, 100, 1000, 10000, 100000, 1000000}; int a[100001][13], r; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '?') v.push_back(s.size() - i - 1); else { r = (r +...
replace
5
6
5
6
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf INT_MAX #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define PLL pair<ll, ll> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (int)m; i ...
#include <bits/stdc++.h> using namespace std; #define inf INT_MAX #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define PLL pair<ll, ll> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (int)m; i ...
replace
30
31
30
31
0
p02960
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; const int MOD = 1000000007; long long int POW(int n, int k, int m) { long long int r; if (k == 0) return 1; r = POW(n, k / 2, m) % m; r = (r * r) % m; if (k % 2) r = (n * r) % m; return r; } int main() { int N, ans[100...
#include <algorithm> #include <iostream> #include <string> using namespace std; const int MOD = 1000000007; long long int POW(int n, int k, int m) { long long int r; if (k == 0) return 1; r = POW(n, k / 2, m) % m; r = (r * r) % m; if (k % 2) r = (n * r) % m; return r; } int main() { int N, ans[100...
replace
16
17
16
17
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, \ ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, \ ...
delete
164
170
164
164
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <iostream> typedef long long ll; using namespace std; int main() { string s; cin >> s; ll mod = 1e9 + 7, sum; ll n = s.size(); ll dp[10000000][13]; dp[0][0] = 1; for (ll i = 0; i < n; i++) { ll c = 0; if (s[i]...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <iostream> typedef long long ll; using namespace std; int main() { string s; cin >> s; ll mod = 1e9 + 7, sum; ll n = s.size(); ll dp[1000000][13]; dp[0][0] = 1; for (ll i = 0; i < n; i++) { ll c = 0; if (s[i] ...
replace
11
12
11
12
-11
p02960
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define mp ma...
#define _GLIBCXX_DEBUG #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define mp ma...
replace
20
21
20
21
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define MOD 1000000007 using namespace std; char S[100]; long long dp[100001][13]; int main() { map<char, int> m = {{'1', 1}, {'2', 2}, {'3', 3}, {'4', 4}, {'5', 5}, {'6', 6}, {'7', 7}, {'8', 8}, {'9', 9}, {'?', -1}}; sca...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define MOD 1000000007 using namespace std; char S[100001]; long long dp[100001][13]; int main() { map<char, int> m = {{'1', 1}, {'2', 2}, {'3', 3}, {'4', 4}, {'5', 5}, {'6', 6}, {'7', 7}, {'8', 8}, {'9', 9}, {'?', -1}}; ...
replace
5
6
5
6
0
p02960
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <limits> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define LL long long #define MOD (1000000007) // 135 int main() { static char s[100010]; scanf("%s", s); stati...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <limits> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define LL long long #define MOD (1000000007) // 135 int main() { static char s[100010]; scanf("%s", s); stati...
replace
20
21
20
21
0
p02960
C++
Runtime Error
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author toshibablack */ #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <queue> #include <s...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author toshibablack */ #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <queue> #include <s...
replace
65
66
65
66
-11
p02960
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n); i >= 0; i--) #define FOR(i, m, n) for (int i = (m); i < (n); i++) #define ALL(obj) begin(obj), end(obj) using namespace std; using ll = long long; using ull = unsigned long long; const int INF = 2100100100; co...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n); i >= 0; i--) #define FOR(i, m, n) for (int i = (m); i < (n); i++) #define ALL(obj) begin(obj), end(obj) using namespace std; using ll = long long; using ull = unsigned long long; const int INF = 2100100100; co...
replace
32
33
32
33
0
p02960
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define mode 1000000007 #define ll long long char s[100001]; ll dp[10001][13]; // i代表前几个字符组成,j代表模13的余数 int main() { scanf("%s", s); int n = strlen(s); memset(dp, 0, sizeof(dp)); if (s[0] == '?') { for (int i = 0; i < 10; i++) ...
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define mode 1000000007 #define ll long long char s[100010]; ll dp[100001][13]; // i代表前几个字符组成,j代表模13的余数 int main() { scanf("%s", s); int n = strlen(s); memset(dp, 0, sizeof(dp)); if (s[0] == '?') { for (int i = 0; i < 10; i++) ...
replace
6
8
6
8
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX (int)1e+3 #define M 13 typedef long long ll; char S[MAX]; static const ll p = 1000000007; void solve() { ll dp[MAX + 1][M]; int base = 1; int n = strlen(S); int c; // initialize for (int i = 1; i < M; i++) dp[0][i] = 0; dp[0][0] = 1; // d...
#include <bits/stdc++.h> using namespace std; #define MAX (int)1e+5 #define M 13 typedef long long ll; char S[MAX]; static const ll p = 1000000007; void solve() { ll dp[MAX + 1][M]; int base = 1; int n = strlen(S); int c; // initialize for (int i = 1; i < M; i++) dp[0][i] = 0; dp[0][0] = 1; // d...
replace
2
3
2
3
0
p02960
C++
Runtime Error
#include <iostream> #include <stdio.h> #include <string> #include <vector> #include <cassert> #include <algorithm> #include <functional> #include <cmath> #include <iomanip> #include <bits/stdc++.h> #include <cstdint> #include <limits> #include <queue> #include <type_traits> using namespace std; int MOD = 1e9 + 7...
#include <iostream> #include <stdio.h> #include <string> #include <vector> #include <cassert> #include <algorithm> #include <functional> #include <cmath> #include <iomanip> #include <bits/stdc++.h> #include <cstdint> #include <limits> #include <queue> #include <type_traits> using namespace std; int MOD = 1e9 + 7...
replace
28
29
28
29
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define N 100005 typedef long long ll; ll MOD = 1000000007; ll dp[10005][13]; int main() { string s; cin >> s; ll n = s.size(); dp[0][0] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { ll nxt = s[i] - '0'; if (s[i] == '?') { ...
#include <bits/stdc++.h> using namespace std; #define N 100005 typedef long long ll; ll MOD = 1000000007; ll dp[100005][13]; int main() { string s; cin >> s; ll n = s.size(); dp[0][0] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j < 10; j++) { ll nxt = s[i] - '0'; if (s[i] == '?') { ...
replace
5
6
5
6
0
p02960
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <util...
#include <algorithm> #include <assert.h> #include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <util...
replace
29
30
29
30
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int maxn = 1e3 + 10, mod = 1e9 + 7; ll dp[maxn][14]; map<int, int> m; int main() { string s; cin >> s; for (int i = 0; i < 13; i++) for (int j = 0; j < 13; j++) if ((j * 10) % 13 == i) m[i] = j; for (int i = 0; i <...
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int maxn = 1e5 + 10, mod = 1e9 + 7; ll dp[maxn][14]; map<int, int> m; int main() { string s; cin >> s; for (int i = 0; i < 13; i++) for (int j = 0; j < 13; j++) if ((j * 10) % 13 == i) m[i] = j; for (int i = 0; i <...
replace
6
7
6
7
0
p02960
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define REP(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) REP(i, 0, n) const int INF = 1e9; #define Yes(n) cout << ((n) ? "Yes" : "No") << endl; #define ALL(v) v.begin(), v.end() #define dbg(x_) cerr << #x_ << ":" << x_ << endl; #define ...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define REP(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) REP(i, 0, n) const int INF = 1e9; #define Yes(n) cout << ((n) ? "Yes" : "No") << endl; #define ALL(v) v.begin(), v.end() #define dbg(x_) cerr << #x_ << ":" << x_ << endl; #define ...
replace
68
72
68
69
TLE
p02960
C++
Runtime Error
#include <algorithm> #include <algorithm> // sort #include <cmath> #include <cstring> #include <iostream> #include <map> // pair #include <set> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; ...
#include <algorithm> #include <algorithm> // sort #include <cmath> #include <cstring> #include <iostream> #include <map> // pair #include <set> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; ...
replace
44
45
44
45
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vll vector<ll> #define vi vector<int> #define MOD 1000000007 int main() { string S; cin >> S; vector<vll> dp(10005, vll(13, 0)); dp[0][0] = 1; int c; for (int i = 0; i < S.length(); i++) { if (S[i] == '?') c = -1;...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vll vector<ll> #define vi vector<int> #define MOD 1000000007 int main() { string S; cin >> S; vector<vll> dp(100005, vll(13, 0)); dp[0][0] = 1; int c; for (int i = 0; i < S.length(); i++) { if (S[i] == '?') c = -1...
replace
14
15
14
15
0
p02960
C++
Runtime Error
/*Function Template*/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = 0; i < (n); i++) #define Rep(i, n) for (ll i = 1; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define IOS ...
/*Function Template*/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = 0; i < (n); i++) #define Rep(i, n) for (ll i = 1; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define IOS ...
replace
181
183
181
183
0
p02960
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; const int mod = 1000000007; int main() { string s; cin >> s; long long dp[10010][14] = {}; dp[0][0] = 1; int buf = 0; long long n; n = (int)(s.length()); for (int i = 1; i <= n; i++) { ...
#include <algorithm> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; const int mod = 1000000007; int main() { string s; cin >> s; long long dp[100010][14] = {}; dp[0][0] = 1; int buf = 0; long long n; n = (int)(s.length()); for (int i = 1; i <= n; i++) { ...
replace
10
11
10
11
0
p02960
C++
Runtime Error
#include <iostream> #include <string> using namespace std; const long long MOD = 1000000007; int main() { string S; cin >> S; int n = S.size(), D = 13; long long dp[10001][13] = {}, num, m = 1, rest; dp[0][0] = 1; for (int k = 0; k < n; ++k) { for (int d = 0; d < D; ++d) { if (S[n - 1 - k] =...
#include <iostream> #include <string> using namespace std; const long long MOD = 1000000007; int main() { string S; cin >> S; int n = S.size(), D = 13; long long dp[100001][13] = {}, num, m = 1, rest; dp[0][0] = 1; for (int k = 0; k < n; ++k) { for (int d = 0; d < D; ++d) { if (S[n - 1 - k] ...
replace
12
13
12
13
0
p02960
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array...
replace
29
30
29
30
0
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; #define ll long long const ll md = 1e9 + 7; ll dp[N][15]; string s; int n; ll solve(int idx, int val) { ll &ret = dp[idx][val]; if (ret >= 0) return ret; ret = 0; if (idx == n) { ret = (val == 5); } if (s[idx] == '?') { int tmp...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; #define ll long long const ll md = 1e9 + 7; ll dp[N][15]; string s; int n; ll solve(int idx, int val) { ll &ret = dp[idx][val]; if (ret >= 0) return ret; ret = 0; if (idx == n) { ret = (val == 5); return ret; } if (s[idx] == '?...
insert
15
15
15
16
-11
p02960
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < n; ++i) #define MOD 1000000007 int main() { string s; cin >> s; ll dp[15][11000] = {}; dp[0][0] = 1; rep(i, s.size()) { if (s[i] == '?') { rep(j, 13) { rep(nu...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < n; ++i) #define MOD 1000000007 int main() { string s; cin >> s; ll dp[15][110000] = {}; dp[0][0] = 1; rep(i, s.size()) { if (s[i] == '?') { rep(j, 13) { rep(n...
replace
10
11
10
11
0
p02962
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (ll i = (a); i < (b); i++) typedef uint64_t ull; typedef int64_t ll; typedef std::pair<ll, ll> PLL; using namespace std; const int MAX = 500000, MS = 2; const long long mod[] = {999999937LL, 1000000007LL}, base = 9973; struct rolling_hash { int n; vector<long lon...
#include <bits/stdc++.h> #define rep(i, a, b) for (ll i = (a); i < (b); i++) typedef uint64_t ull; typedef int64_t ll; typedef std::pair<ll, ll> PLL; using namespace std; const int MAX = 500000, MS = 2; const long long mod[] = {999999937LL, 1000000007LL}, base = 9973; struct rolling_hash { int n; vector<long lon...
replace
94
95
94
95
0
p02962
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
replace
54
55
54
55
0
p02962
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 5e5 + 10; char laz[maxn]; int pi[10 * maxn]; bool prefix_function(const string &s, const string &t) { /// search t on s int m = (int)t.length(); string ss = t + '#' + s; int n = (int)ss.length(); pi[0] = 0; for (int i = 1; i < n; i++) { int ...
#include <bits/stdc++.h> using namespace std; const int maxn = 5e5 + 10; char laz[maxn]; int pi[16 * maxn]; bool prefix_function(const string &s, const string &t) { /// search t on s int m = (int)t.length(); string ss = t + '#' + s; int n = (int)ss.length(); pi[0] = 0; for (int i = 1; i < n; i++) { int ...
replace
4
5
4
5
0
p02962
C++
Time Limit Exceeded
#include <algorithm> // minmax, sort, swap #include <climits> // INT_MIN, LLONG_MIN #include <cmath> // long, trig, pow #include <cstdio> // printf, scanf #include <deque> // deque #include <functional> // std::function<void(int)> #include <iomanip> // cout<<setprecision(n) #in...
#include <algorithm> // minmax, sort, swap #include <climits> // INT_MIN, LLONG_MIN #include <cmath> // long, trig, pow #include <cstdio> // printf, scanf #include <deque> // deque #include <functional> // std::function<void(int)> #include <iomanip> // cout<<setprecision(n) #in...
replace
89
90
89
90
TLE
p02962
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 5e5 + 10; char laz[maxn]; int pi[8 * maxn], dp[8 * maxn]; int prefix_function(const string &s, const string &t) { /// search t on s int m = (int)t.length(); int n = t.length() + s.length() + 1; auto ss = [&](int idx) { if (idx == m) return...
#include <bits/stdc++.h> using namespace std; const int maxn = 5e5 + 10; char laz[maxn]; int pi[12 * maxn], dp[12 * maxn]; int prefix_function(const string &s, const string &t) { /// search t on s int m = (int)t.length(); int n = t.length() + s.length() + 1; auto ss = [&](int idx) { if (idx == m) retu...
replace
4
5
4
5
0
p02962
C++
Runtime Error
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x), end(x) #define debug(x) cerr << #x << " " << x << '\n' using namespace std; using ll = long long; using pii = pair<int, int>; using pli = pair<ll, int>; const int INF = 0x3f3f3f3f, N = 5e5 + 5; const ...
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x), end(x) #define debug(x) cerr << #x << " " << x << '\n' using namespace std; using ll = long long; using pii = pair<int, int>; using pli = pair<ll, int>; const int INF = 0x3f3f3f3f, N = 2e6 + 5; const ...
replace
10
11
10
11
0
p02962
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; vector<int> table, res, v[500000], u[500000]; int ch[500000], ans, cnt, tmp, L; string s, t, S; map<int, int> mp; vector<int> pre_kmp(string s) { vector<int> v(s.size() + 1); int k; v[0] = -1; for (int i = 1; i <= s.size(); i++) { k = v[i - 1...
#include <bits/stdc++.h> #include <iostream> using namespace std; vector<int> table, res, v[1000000], u[1000000]; int ch[1000000], ans, cnt, tmp, L; string s, t, S; map<int, int> mp; vector<int> pre_kmp(string s) { vector<int> v(s.size() + 1); int k; v[0] = -1; for (int i = 1; i <= s.size(); i++) { k = v[i ...
replace
3
5
3
5
0