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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02684 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define ll long long
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define... | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define ll long long
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define... | replace | 35 | 36 | 35 | 36 | TLE | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<long long> firstpath;
vector<long long> roop;
long long N;
long long K;
;
cin >> N >> K;
long long A[N], visited[N];
for (int i = 0; i < N; i++) {
cin >> A[i];
A[i]--;
visited[i] = 0;
}
long long now, roopstart;
now = A[... | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<long long> firstpath;
vector<long long> roop;
long long N;
long long K;
;
cin >> N >> K;
long long A[N], visited[N];
for (int i = 0; i < N; i++) {
cin >> A[i];
A[i]--;
visited[i] = 0;
}
long long now, roopstart;
now = A[... | replace | 47 | 48 | 47 | 48 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template <class T1, class T2> ostream &operator<<(ostream &s, pair<T1, T2> P) {
return s << '<' << P.first << ", " << P.second << '>';
}
template <class T> ostream &operator<<(ostream &s, dequ... | #include <bits/stdc++.h>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template <class T1, class T2> ostream &operator<<(ostream &s, pair<T1, T2> P) {
return s << '<' << P.first << ", " << P.second << '>';
}
template <class T> ostream &operator<<(ostream &s, dequ... | replace | 49 | 51 | 49 | 53 | 0 | |
p02684 | Python | Time Limit Exceeded | [n, k], [*a] = [[*map(int, t.split())] for t in open(0)]
ans = 1
for _ in range(k):
ans = a[ans - 1]
print(ans)
| [n, k], [*a] = [[*map(int, t.split())] for t in open(0)]
count = 0
visited = dict()
tmp = 1
while count < k:
visited[tmp] = count
count += 1
tmp = a[tmp - 1]
if tmp in visited:
break
if count < k:
k = (k - count) % (count - visited[tmp])
for _ in range(k):
tmp = a[tmp - 1]
print(... | replace | 1 | 5 | 1 | 15 | TLE | |
p02684 | Python | Runtime Error | N, K = map(int, input().split())
X = list(map(int, input().split()))
town = []
dic = {}
i = 0
j = 0
while i not in dic and j < K:
dic[i] = j
town.append(i)
i = X[i] - 1
j += 1
if j == K:
print(town[K] + 1)
else:
num = dic[i]
loop = j - num
print(town[((K - num) % loop) + num] + 1)
| N, K = map(int, input().split())
X = list(map(int, input().split()))
town = []
dic = {}
i = 0
j = 0
while i not in dic and j < K:
dic[i] = j
town.append(i)
i = X[i] - 1
j += 1
if j == K:
print(i + 1)
else:
num = dic[i]
loop = j - num
print(town[((K - num) % loop) + num] + 1)
| replace | 13 | 14 | 13 | 14 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
// マクロ
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#def... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
// マクロ
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#def... | replace | 74 | 75 | 74 | 80 | 0 | |
p02684 | Python | Runtime Error | n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
visited_city = {1: 0}
visited_city_inv = {0: 1}
now = 1
num = 0
while True:
next_city = arr[now - 1]
num += 1
if next_city not in visited_city:
visited_city[next_city] = num
visited_city_inv[num] = next_city
... | n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
visited_city = {1: 0}
visited_city_inv = {0: 1}
now = 1
num = 0
while True:
next_city = arr[now - 1]
num += 1
if next_city not in visited_city:
visited_city[next_city] = num
visited_city_inv[num] = next_city
... | replace | 19 | 20 | 19 | 20 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ar array
#define nl '\n'
#define AC \
ios_base::sync_with_stdio(0); \
cin.tie(NULL);
using namespace std;
const int M = 1e9 + 7;
const int N = 1e5;... | #include <bits/stdc++.h>
#define ll long long
#define ar array
#define nl '\n'
#define AC \
ios_base::sync_with_stdio(0); \
cin.tie(NULL);
using namespace std;
const int M = 1e9 + 7;
const int N = 2 * ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02684 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> g;
bool seen[200001];
vector<int> go;
int dfs(int s) {
if (seen[s])
return s;
seen[s] = t... | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> g;
bool seen[200001];
vector<int> go;
int dfs(int s) {
if (seen[s])
return s;
seen[s] = t... | replace | 19 | 20 | 19 | 20 | 0 | |
p02684 | C++ | Time Limit Exceeded | // https://codeforces.com/contest/1352/problem/C
// Author: BrownieTK
// #pragma GCC optimize("O3")
#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;
//========================Debug=================================... | // https://codeforces.com/contest/1352/problem/C
// Author: BrownieTK
// #pragma GCC optimize("O3")
#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;
//========================Debug=================================... | replace | 185 | 186 | 185 | 186 | TLE | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll, ll> P;
typedef priority_queue<P, vector<P>, greater<P>> P_queue;
#define REP(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define rep(i, n) REP(i, 0, n)
#define pb... | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll, ll> P;
typedef priority_queue<P, vector<P>, greater<P>> P_queue;
#define REP(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define rep(i, n) REP(i, 0, n)
#define pb... | replace | 59 | 67 | 59 | 60 | 0 | |
p02684 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
long n, k, cur = 1, cnt = 1;
cin >> n >> k;
vector<long> a(n);
vector<bool> flag(n, true);
rep(i, n) cin >> a.at(i);
bool f = true;
do {
k--;
f &= flag.at(cur - 1);
flag.at(cur - 1) = fals... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
long n, k, cur = 1, cnt = 1;
cin >> n >> k;
vector<long> a(n);
vector<bool> flag(n, true);
rep(i, n) cin >> a.at(i);
bool f = true;
do {
k--;
f &= flag.at(cur - 1);
flag.at(cur - 1) = fals... | replace | 18 | 19 | 18 | 19 | TLE | |
p02684 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#... | replace | 44 | 45 | 44 | 45 | 0 | |
p02684 | C++ | Runtime Error | // D_Teleporter.cpp
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define ppi pair<ll, ll>
#define fi first
#define si second
#define fastIO \
ios_base::sync_with_stdio(false); ... | // D_Teleporter.cpp
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define ppi pair<ll, ll>
#define fi first
#define si second
#define fastIO \
ios_base::sync_with_stdio(false); ... | replace | 71 | 72 | 71 | 72 | -11 | |
p02684 | C++ | Runtime Error | // WeirdBugsButOkay
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
const ll N = 100001;
ll a[N], vis[N];
ll ccs, pl;
vector<ll> seq;
void dfs(l... | // WeirdBugsButOkay
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
using namespace std;
const ll N = 200001;
ll a[N], vis[N];
ll ccs, pl;
vector<ll> seq;
void dfs(l... | replace | 15 | 16 | 15 | 16 | 0 | |
p02684 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iterator>
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
using namespace std;
#define f first
#define s second
#define pb push_back
#define pp pop_back
#define mp make_pair
#define sz(x) (int)x.size()
#define sqr(x) ((x)*1ll... | #include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iterator>
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
using namespace std;
#define f first
#define s second
#define pb push_back
#define pp pop_back
#define mp make_pair
#define sz(x) (int)x.size()
#define sqr(x) ((x)*1ll... | replace | 77 | 78 | 77 | 78 | TLE | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
cons... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
cons... | replace | 68 | 97 | 68 | 74 | -11 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve() {
ll n, k;
cin >> n >> k;
ll a[n];
for (ll i = 0; i < n; ++i) {
/* code */
cin >> a[i];
}
vector<ll> s;
ll t = n + 1;
ll i = 1;
ll l = 0;
bool flag = true;
set<ll> r;
while (t--) {
if (r.find(i) !... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve() {
ll n, k;
cin >> n >> k;
ll a[n];
for (ll i = 0; i < n; ++i) {
/* code */
cin >> a[i];
}
vector<ll> s;
ll t = n + 1;
ll i = 1;
ll l = 0;
bool flag = true;
set<ll> r;
while (t--) {
if (r.find(i) !... | replace | 23 | 26 | 23 | 28 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define endl '\n'
using namespace std;
struct custom_hash {
static unsigned long long splitmix64(unsigned long long x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31... | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define endl '\n'
using namespace std;
struct custom_hash {
static unsigned long long splitmix64(unsigned long long x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31... | replace | 50 | 51 | 50 | 51 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define BOUND 27182818284
#define MAT 2
typedef long long ll;
typedef long long int lli;
typedef pair<ll, ll> P;
ll MOD = 1000000007;
const ll INF = (1ll << 60);
const int INFint = (1 << 30);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) fo... | #include <bits/stdc++.h>
using namespace std;
#define BOUND 27182818284
#define MAT 2
typedef long long ll;
typedef long long int lli;
typedef pair<ll, ll> P;
ll MOD = 1000000007;
const ll INF = (1ll << 60);
const int INFint = (1 << 30);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) fo... | replace | 388 | 389 | 388 | 389 | 0 | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int main() {
ll n, k;
cin >> n >> k;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
cin >> a[i];
int pos = 1;
int key = 0;
vector<int> count(n + 1);
for (int i = 1; i <= k; i++) {
pos = a[pos];
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int main() {
ll n, k;
cin >> n >> k;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
cin >> a[i];
int pos = 1;
int key = 0;
vector<int> count(n + 1);
for (int i = 1; i <= k; i++) {
pos = a[pos];
... | replace | 39 | 43 | 39 | 47 | 0 | |
p02684 | Python | Time Limit Exceeded | def main():
import sys
n, k, *a = map(int, sys.stdin.read().split())
a = [0] + a
check = [0] * (n + 1)
check[1] = 1
i = 0
nw = 1
path = [1]
while 1:
nx = a[nw]
i += 1
if i == k:
print(nx)
break
if check[nx]:
j = pa... | def main():
import sys
n, k, *a = map(int, sys.stdin.read().split())
a = [0] + a
check = [0] * (n + 1)
check[1] = 1
i = 0
nw = 1
path = [1]
while 1:
nx = a[nw]
i += 1
if i == k:
print(nx)
break
if check[nx]:
j = pa... | replace | 22 | 23 | 22 | 23 | TLE | |
p02684 | Python | Runtime Error | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
N, K = map(int, input().split())
A = list(map(int, input().split()))
R = [False] * (N + 1)
D = []
p = 1
while True:
if R[p]:
break
D.append(p)
R[p] = True
p = A[p - 1]
m = D.index(p)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
N, K = map(int, input().split())
A = list(map(int, input().split()))
R = [False] * (N + 1)
D = []
p = 1
while True:
if R[p]:
break
D.append(p)
R[p] = True
p = A[p - 1]
m = D.index(p)
... | replace | 26 | 27 | 26 | 27 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02684/Python/s669353976.py", line 31, in <module>
main()
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02684/Python/s669353976.py", line 27, in main
print(D[m + K - m] % c)
IndexErr... |
p02684 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class cycle_finder {
public:
vector<vector<int>> adj;
vector<int> visit_state;
vector<int> parent;
... | #include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class cycle_finder {
public:
vector<vector<int>> adj;
vector<int> visit_state;
vector<int> parent;
... | insert | 49 | 49 | 49 | 51 | TLE | |
p02684 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
ll k;
cin >> n >> k;
vector<ll> a(n);
for (ll i = 0; i < n; i++)
cin >> a[i];
vector<ll> s;
vector<ll> ord(n + 1, -1);
ll c = 1, l = 0;
ll v = 1;
while ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
ll k;
cin >> n >> k;
vector<ll> a(n);
for (ll i = 0; i < n; i++)
cin >> a[i];
vector<ll> s;
vector<ll> ord(n + 1, -1);
ll c = 1, l = 0;
ll v = 1;
while ... | replace | 28 | 29 | 28 | 29 | 0 | |
p02684 | Python | Runtime Error | N, K = map(int, input().split())
portals = [0] + list(map(int, input().split()))
visitTowns = list()
visitTimes = [0 for _ in range(N + 1)]
curTown = 1
timeBackTo = 0
curTime = 0
while True:
if visitTimes[curTown] > 0:
timeBackTo = visitTimes[curTown]
break
visitTowns.append(curTown)
vis... | N, K = map(int, input().split())
portals = [0] + list(map(int, input().split()))
visitTowns = list()
visitTimes = [0 for _ in range(N + 1)]
curTown = 1
timeBackTo = 0
curTime = 0
while True:
if visitTimes[curTown] > 0:
timeBackTo = visitTimes[curTown]
break
visitTowns.append(curTown)
vis... | delete | 22 | 23 | 22 | 22 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ===========... | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ===========... | replace | 437 | 438 | 437 | 438 | TLE | |
p02685 | C++ | Runtime Error | #include <iostream>
using namespace std;
const int mod = 998244353;
const int MAX = 100005;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mod - inv[mod % i] * (... | #include <iostream>
using namespace std;
const int mod = 998244353;
const int MAX = 200005;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mod - inv[mod % i] * (... | replace | 6 | 7 | 6 | 7 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INX(x) (cin >> x)
#define OUTX(x) (cout << x << endl)
#define ADD emplace_back
#define MP make_pair
#define BASEP 998244353
ll powmod(ll x, ll pow, ll mod) {
ll result = 1;
while (pow > 0) {
if (pow & 1) {
result *= x;
r... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INX(x) (cin >> x)
#define OUTX(x) (cout << x << endl)
#define ADD emplace_back
#define MP make_pair
#define BASEP 998244353
ll powmod(ll x, ll pow, ll mod) {
ll result = 1;
while (pow > 0) {
if (pow & 1) {
result *= x;
r... | replace | 43 | 44 | 43 | 46 | -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)
|
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const ll MOD = 998244353;
static const int MAX = 100000;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const ll MOD = 998244353;
static const int MAX = 500000 + 100;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MO... | replace | 5 | 6 | 5 | 6 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <class T> struct rge {
T b, e;
};
template <class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
template <class T> debug &operator<<(T x) {
cerr << boolalpha << x;
return *this;
}
templa... | #include <bits/stdc++.h>
using namespace std;
template <class T> struct rge {
T b, e;
};
template <class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
template <class T> debug &operator<<(T x) {
cerr << boolalpha << x;
return *this;
}
templa... | replace | 52 | 53 | 52 | 53 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979
typedef long long i64;
typedef pair<i64, i64> P;
inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return ... | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979
typedef long long i64;
typedef pair<i64, i64> P;
inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return ... | replace | 40 | 41 | 40 | 41 | 0 | |
p02685 | C++ | Time Limit Exceeded | /**
* author: MOOONI
* hackers are welcome!
**/
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;
const int md = 998244353;
inline int add(int &a, int b) {
a += b;
while (a < 0) {
a += md;
}
a %= md;
}
inline int mul(int a, int b) { return (int)((long ... | /**
* author: MOOONI
* hackers are welcome!
**/
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;
const int md = 998244353;
inline void add(int &a, int b) {
a += b;
while (a < 0) {
a += md;
}
a %= md;
}
inline int mul(int a, int b) { return (int)((long... | replace | 12 | 13 | 12 | 13 | TLE | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
// const int MOD = 1e9+7;
const int MOD = 998244353;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの... | #include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
// const int MOD = 1e9+7;
const int MOD = 998244353;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの... | replace | 39 | 40 | 39 | 40 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
const int MAX = 1e5 + 10;
long long kai[MAX], kair[MAX], rev[MAX];
void com_p() {
kai[0] = kai[1] = 1;
kair[0] = kair[1] = 1;
rev[1] = 1;
for (int i = 2; i < MAX; i++) {
kai[i] = kai[i - 1] * i % M;
rev[i] = M - rev[M % i] * (M / ... | #include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
const int MAX = 1e5 * 2 + 5;
long long kai[MAX], kair[MAX], rev[MAX];
void com_p() {
kai[0] = kai[1] = 1;
kair[0] = kair[1] = 1;
rev[1] = 1;
for (int i = 2; i < MAX; i++) {
kai[i] = kai[i - 1] * i % M;
rev[i] = M - rev[M % i] * (M... | replace | 4 | 5 | 4 | 5 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INCANT \
cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), \
cout << fixed << setprecision(20);
#define int long long
#define double long double
const int INF = 1e18, ... | #include <bits/stdc++.h>
using namespace std;
#define INCANT \
cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), \
cout << fixed << setprecision(20);
#define int long long
#define double long double
const int INF = 1e18, ... | replace | 11 | 12 | 11 | 12 | TLE | |
p02685 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
int64_t M = 998244353;
vector<int64_t> fac(100001); // n! (mod M)
vector<int64_t> ifac(100001); // k!^{M-2} (mod M)
int64_t mpow(int64_t x, int64_t n) {
int64_t ans = 1;
while (n != 0) {
if (n & 1) {
ans = ans * x % M;
}
x = x * x % M;
n = n >> ... | #include "bits/stdc++.h"
using namespace std;
int64_t M = 998244353;
vector<int64_t> fac(200001); // n! (mod M)
vector<int64_t> ifac(200001); // k!^{M-2} (mod M)
int64_t mpow(int64_t x, int64_t n) {
int64_t ans = 1;
while (n != 0) {
if (n & 1) {
ans = ans * x % M;
}
x = x * x % M;
n = n >> ... | replace | 4 | 6 | 4 | 6 | 0 | |
p02685 | C++ | Runtime Error | /* Isn't passion overrated?*/
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll mod = 998244353;
ll power(ll a, ll x) {
if (x == 0)
return 1;
ll ans = power(a, x / 2) % mod;
... | /* Isn't passion overrated?*/
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll mod = 998244353;
ll power(ll a, ll x) {
if (x == 0)
return 1;
ll ans = power(a, x / 2) % mod;
... | replace | 24 | 25 | 24 | 25 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli M = 998244353, N = 1e5 + 5;
lli fact[N];
lli binpow(lli a, lli b) {
if (b == 0)
return 1;
lli res = binpow(a, b / 2);
res = (res * res) % M;
if (b % 2)
return (res * a) % M;
return res;
}
lli inv(ll... | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli M = 998244353, N = 2e5 + 5;
lli fact[N];
lli binpow(lli a, lli b) {
if (b == 0)
return 1;
lli res = binpow(a, b / 2);
res = (res * res) % M;
if (b % 2)
return (res * a) % M;
return res;
}
lli inv(ll... | replace | 4 | 5 | 4 | 5 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 998244353LL;
// MOD考慮power関数
template <typename type> inline type ModPow(type a, type b) {
type ret = 1;
for (type i = 0; i < b; i++) {
ret *= a;
ret %= MOD;
}
return ret;
}
// MOD考慮Combination関数使用準備関数
vector<long long> fac;
vec... | #include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 998244353LL;
// MOD考慮power関数
template <typename type> inline type ModPow(type a, type b) {
type ret = 1;
while (b > 0) {
if (b & 0x1)
ret = ret * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return ret;
}
// MOD考慮Combination関数... | replace | 9 | 12 | 9 | 14 | TLE | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(998244353))
#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 = int(n) - 1; i >= 0; --i)
#define A... | #include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(998244353))
#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 = int(n) - 1; i >= 0; --i)
#define A... | insert | 149 | 149 | 149 | 150 | -11 | |
p02685 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 998244353, INF = 1010101010;
constexp... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 998244353, INF = 1010101010;
constexp... | replace | 168 | 169 | 168 | 169 | 0 | |
p02685 | C++ | Time Limit Exceeded | // https://atcoder.jp/contests/abc167/tasks/abc167_e
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#includ... | // https://atcoder.jp/contests/abc167/tasks/abc167_e
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#includ... | replace | 306 | 315 | 306 | 322 | TLE | |
p02685 | C++ | Runtime Error | // ABC167-E
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
template <class T> ostream &operator<<(ostream &o, const vector<T> &v) {
o << "{";
for (int i = 0... | // ABC167-E
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
template <class T> ostream &operator<<(ostream &o, const vector<T> &v) {
o << "{";
for (int i = 0... | insert | 24 | 24 | 24 | 26 | 0 | |
p02685 | 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;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
int main() {
ll N, M, K, MOD = 998244353... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
int main() {
ll N, M, K, MOD = 998244353... | replace | 20 | 21 | 20 | 21 | -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)
|
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
#define vall(x) (x).begin(), (x).end()
using namespace std;
using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class... | #include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
#define vall(x) (x).begin(), (x).end()
using namespace std;
using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class... | insert | 169 | 169 | 169 | 177 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MOD 998244353
// #define INF 100000000000
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
template <class T> ostream &operator<<(ostream &o, const vector<T> &obj) {
o << "[";
for (int i = 0; i < (int)obj.size(); ++i)
o << (i > 0 ? ", " : "") << obj[... | #include <bits/stdc++.h>
#define MOD 998244353
// #define INF 100000000000
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
template <class T> ostream &operator<<(ostream &o, const vector<T> &obj) {
o << "[";
for (int i = 0; i < (int)obj.size(); ++i)
o << (i > 0 ? ", " : "") << obj[... | insert | 98 | 98 | 98 | 103 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, s, n) for (int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define outve(v) \
for (auto i : v) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, s, n) for (int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define outve(v) \
for (auto i : v) ... | replace | 126 | 127 | 126 | 127 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int mod = 998244353;
const int inf = 2e9 + 5;
const int N = 2e5 + 5;
ll n, m, k, fact[N];
ll mode... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int mod = 998244353;
const int inf = 2e9 + 5;
const int N = 2e5 + 5;
ll n, m, k, fact[N];
ll mode... | replace | 42 | 43 | 42 | 43 | 0 | |
p02685 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
/*bool compare_function(const pair<int, int> a, const pair<int, int> b) {
return a.first < b.first;
}
use case
sort(V.begin(), V.end(), com... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
/*bool compare_function(const pair<int, int> a, const pair<int, int> b) {
return a.first < b.first;
}
use case
sort(V.begin(), V.end(), com... | replace | 50 | 51 | 50 | 51 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cmath>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define mins(x, y) x = min(x, y)
#define maxs(... | #include <bits/stdc++.h>
#include <cmath>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define mins(x, y) x = min(x, y)
#define maxs(... | replace | 98 | 102 | 98 | 108 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i <= n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n)
#define MAX 100000
#define inf 1000000007
#define mod 998244353 //... | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i <= n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n)
#define MAX 100000
#define inf 1000000007
#define mod 998244353 //... | replace | 19 | 21 | 19 | 21 | 0 | |
p02685 | C++ | Runtime Error | #pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i, a, b) for (int i = (a); i <= (b); i+... | #pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i, a, b) for (int i = (a); i <= (b); i+... | replace | 111 | 112 | 111 | 112 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <chrono>
using namespace std::chrono;
using namespace std;
#define fr(x, i, n) for (int x = i; x < n; ++x)
#define fb(x, i, n) for (int x = i; x >= n; --x)
#define pr pair<int, int>
#define ll long long int
const ll mod = 998244353;
/* auto start = high_resolution_clock::now();
... | #include <bits/stdc++.h>
#include <chrono>
using namespace std::chrono;
using namespace std;
#define fr(x, i, n) for (int x = i; x < n; ++x)
#define fb(x, i, n) for (int x = i; x >= n; --x)
#define pr pair<int, int>
#define ll long long int
const ll mod = 998244353;
/* auto start = high_resolution_clock::now();
... | replace | 24 | 25 | 24 | 25 | 0 | |
p02685 | 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 < (int)(n); i++)
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 99... | #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 < (int)(n); i++)
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 99... | replace | 71 | 72 | 71 | 72 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.en... | #include <bits/stdc++.h>
using namespace std;
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.en... | replace | 104 | 105 | 104 | 105 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
// #define DEBUG 10
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const int oo = 1e9 + 7;
const ll mod = 998244353, maxn = 155, maxm = 15;
const double PI = acos(-1);
ll fat[maxn], inv[maxn];
ll mul(l... | #include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
// #define DEBUG 10
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const int oo = 1e9 + 7;
const ll mod = 998244353, maxn = 2 * 1e5 + 10, maxm = 15;
const double PI = acos(-1);
ll fat[maxn], inv[maxn];
... | replace | 11 | 12 | 11 | 12 | 0 | |
p02685 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iosfwd>
#... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iosfwd>
#... | replace | 67 | 68 | 67 | 68 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define invrepr(i, a, b) for (int i = b - 1; i >= a; i--)
#define invrep(i, n) invrepr(i, 0, n)
#define repitr(itr, a) for (auto itr = a.begin(); itr != a.e... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define invrepr(i, a, b) for (int i = b - 1; i >= a; i--)
#define invrep(i, n) invrepr(i, 0, n)
#define repitr(itr, a) for (auto itr = a.begin(); itr != a.e... | replace | 38 | 39 | 38 | 39 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 998244353;
ll pd[200005];
ll rd[200005];
ll Ep(int x, int y) {
if (y == 1)
return x;
ll r = Ep(x, y / 2);
if (y % 2 == 1)
return r * r % MOD * x % MOD;
else
return r * r % MOD;
}
ll Ftl(ll x) {
if (x == 1 || x == ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 998244353;
ll pd[200005];
ll rd[200005];
ll Ep(int x, int y) {
if (y == 0)
return 1;
if (y == 1)
return x;
ll r = Ep(x, y / 2);
if (y % 2 == 1)
return r * r % MOD * x % MOD;
else
return r * r % MOD;
}
ll Ftl(l... | insert | 8 | 8 | 8 | 10 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// constexpr long MOD = 1000000007;
constexpr long MOD = 998244353;
vector<long> fact, inv;
long mpow(long a, long b) {
long res = 1;
while (b > 0) {
if (b & 1)
res = res * a % MOD;
a = a * a % MOD;
b /= 2;
}
return res;
}
long com(long n, long ... | #include <bits/stdc++.h>
using namespace std;
// constexpr long MOD = 1000000007;
constexpr long MOD = 998244353;
vector<long> fact, inv;
long mpow(long a, long b) {
long res = 1;
while (b > 0) {
if (b & 1)
res = res * a % MOD;
a = a * a % MOD;
b /= 2;
}
return res;
}
long com(long n, long ... | replace | 44 | 45 | 44 | 45 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int64_t MOD = 998244353;
double PI = 3.141592653589793;
int64_t MAX = 500000;
vector<int64_t> fac(MAX), finv(MAX), inv(MAX);
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;... | #include <bits/stdc++.h>
using namespace std;
int64_t MOD = 998244353;
double PI = 3.141592653589793;
int64_t MAX = 500000;
vector<int64_t> fac(MAX), finv(MAX), inv(MAX);
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;... | insert | 29 | 29 | 29 | 31 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define REP(i, n, m) for (ll i = n; i < (ll)m; ++i)
#define IREP(i, n, m) for (ll i = n - 1; i >= m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#d... | replace | 34 | 35 | 34 | 35 | 0 | |
p02685 | Python | Time Limit Exceeded | import sys
from io import StringIO
import unittest
import os
# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)
def prepare(n, mod=998244353):
f = 1
factorials = [1]
for m in range(1, n + 1):
f *= m
f %= mod
factorials.append(f)
inv = pow(f, mod - 2, mod)
... | import sys
from io import StringIO
import unittest
import os
# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)
def prepare(n, mod=998244353):
f = 1
factorials = [1]
for m in range(1, n + 1):
f *= m
f %= mod
factorials.append(f)
inv = pow(f, mod - 2, mod)
... | replace | 47 | 48 | 47 | 48 | TLE | |
p02685 | Python | Runtime Error | n, m, k = [int(t) for t in open(0).read().split()]
mod = 998244353
def solve(n):
if n <= k + 1:
return pow(m, n, mod)
elif n == k + 2:
return (pow(m, n, mod) + mod - m) % mod
else:
return (m * solve(n - 1) - (m - 1) * solve(n - k - 2)) % mod
print(solve(n))
| n, m, k = [int(t) for t in open(0).read().split()]
mod = 998244353
mem = [0] * max(k + 3, n + 1)
for i in range(k + 2):
mem[i] = pow(m, i, mod)
c = 1
for i in range(k + 2, n + 1):
mem[i] = (m * mem[i - 1] - m * c * pow(m - 1, i - k - 2, mod)) % mod
c = (c * (i - 1) * pow(i - k - 1, -1, mod)) % mod
print(mem... | replace | 2 | 14 | 2 | 10 | 0 | |
p02685 | Python | Time Limit Exceeded | import sys
from math import factorial
input = sys.stdin.readline
N, M, K = map(int, input().split())
MOD = 998244353
inv = [1] * N
FAC = factorial(N - 1) % MOD
if M == 1:
print(1 if K == N - 1 else 0)
else:
res = 0
for i in range(1, N):
inv[i] = pow(factorial(i), MOD - 2, MOD)
for k in range(K ... | import sys
from math import factorial
input = sys.stdin.readline
N, M, K = map(int, input().split())
MOD = 998244353
inv = [1] * N
FAC = factorial(N - 1) % MOD
if M == 1:
print(1 if K == N - 1 else 0)
else:
res = 0
for i in range(1, N):
inv[i] = (inv[i - 1] * pow(i, MOD - 2, MOD)) % MOD
for k i... | replace | 13 | 14 | 13 | 14 | TLE | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace... | #include <bits/stdc++.h>
#define int long long
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace... | replace | 13 | 14 | 13 | 14 | 0 | |
p02685 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unorder... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unorder... | replace | 96 | 97 | 96 | 97 | 0 | |
p02685 | C++ | Runtime Error | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, x) for (ll i = 0; i < (ll)(x); i++)
#define rrep(i, x) for (ll i = (ll)(x)-1; 0 <= i; i--)
#define reps(i, x) for (ll i = 1; i < (ll)(x) + 1; i++)
#define rreps(i, x) for (ll i = (ll)(x); 1 <= i; i--)
#define debug(x) cerr << #x << ": "... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, x) for (ll i = 0; i < (ll)(x); i++)
#define rrep(i, x) for (ll i = (ll)(x)-1; 0 <= i; i--)
#define reps(i, x) for (ll i = 1; i < (ll)(x) + 1; i++)
#define rreps(i, x) for (ll i = (ll)(x); 1 <= i; i--)
#define debug(x) cerr << #x << ": "... | replace | 17 | 18 | 17 | 18 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 998244353
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 998244353
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | replace | 62 | 63 | 62 | 63 | -11 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i, s, n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#d... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i, s, n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#d... | replace | 146 | 147 | 146 | 147 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
// auto mod int
// https://... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
// auto mod int
// https://... | replace | 76 | 77 | 76 | 77 | TLE | |
p02685 | C++ | Runtime Error | // by szh
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int, int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" ... | // by szh
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int, int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" ... | replace | 17 | 18 | 17 | 18 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define f(i, l, h) for (ll i = l; i < h; i++)
#define fr(i, h, l) for (ll i = h; i >= l; i--)
using namespace std;
typedef pair<ll, ll> pll;
const ll mod = (ll)(998244353);
typedef vector<ll> vll;
ll fact[(ll)(2e5 + 1)];
ll poww... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define f(i, l, h) for (ll i = l; i < h; i++)
#define fr(i, h, l) for (ll i = h; i >= l; i--)
using namespace std;
typedef pair<ll, ll> pll;
const ll mod = (ll)(998244353);
typedef vector<ll> vll;
ll fact[(ll)(2e5 + 1)];
ll poww... | replace | 34 | 43 | 34 | 37 | TLE | |
p02685 | C++ | Runtime Error | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Gosu_Hiroo
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#define VI vector<int>
#define G(size_1) vector<vector<int>>(siz... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Gosu_Hiroo
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#define VI vector<int>
#define G(size_1) vector<vector<int>>(siz... | replace | 438 | 441 | 438 | 448 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | replace | 83 | 86 | 83 | 85 | TLE | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int mod = 998244353;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) % mod) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int mod = 998244353;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) % mod) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= ... | replace | 67 | 69 | 67 | 74 | TLE | |
p02685 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)... | replace | 164 | 165 | 164 | 165 | 0 | |
p02685 | C++ | Runtime Error | #include <iostream>
#include <vector>
uint32_t pow_mod(uint32_t base, uint32_t exp, uint32_t mod) {
if (exp == 1)
return base % mod;
uint64_t half = pow_mod(base, exp / 2, mod);
uint64_t ans = (half * half) % mod;
return (ans * (exp % 2 == 0 ? 1ll : base)) % mod;
}
uint32_t inv_mod(uint32_t x, uint32_t m... | #include <iostream>
#include <vector>
uint32_t pow_mod(uint32_t base, uint32_t exp, uint32_t mod) {
if (exp == 0)
return 1;
uint64_t half = pow_mod(base, exp / 2, mod);
uint64_t ans = (half * half) % mod;
return (ans * (exp % 2 == 0 ? 1ll : base)) % mod;
}
uint32_t inv_mod(uint32_t x, uint32_t mod) { ret... | replace | 4 | 6 | 4 | 6 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b))))
#define show(x) cout << #x << " is " << x << "\n";
typedef vector<ll> vi;
#define fi first
#define se second
const ll mod ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b))))
#define show(x) cout << #x << " is " << x << "\n";
typedef vector<ll> vi;
#define fi first
#define se second
const ll mod ... | replace | 11 | 12 | 11 | 12 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 998244353;
struct mint {
int64_t x;
mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator-... | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 998244353;
struct mint {
int64_t x;
mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x) >= MOD)
x -= MOD;
return *this;
}
mint &operator-... | replace | 66 | 67 | 66 | 67 | 0 | |
p02685 | C++ | Runtime Error | // Hail god Yato
#include <bits/stdc++.h>
using namespace std;
#define hs \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | // Hail god Yato
#include <bits/stdc++.h>
using namespace std;
#define hs \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | replace | 12 | 13 | 12 | 13 | 0 | |
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MAX 510000
#define rrep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define dcout cout << fixed << setprecision(15);
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
constexpr int MO... | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MAX 510000
#define rrep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define dcout cout << fixed << setprecision(15);
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
constexpr int MO... | replace | 112 | 113 | 112 | 117 | 0 | |
p02685 | C++ | Runtime Error | #ifdef DEBUG
#else
#pragma GCC optimize("O3,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#if __cplusplus < 201703L
#pragma GCC target("avx")
#else
#pragma GCC target("avx2")
#endif
#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINE... | #ifdef DEBUG
#else
#pragma GCC optimize("O3,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#if __cplusplus < 201703L
#pragma GCC target("avx")
#else
#pragma GCC target("avx2")
#endif
#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINE... | replace | 72 | 73 | 72 | 73 | -6 | munmap_chunk(): invalid pointer
|
p02685 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define All(v) (v).begin(), (v).end()
int dy[8] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int mod = 998244353;
const int inf = mod * mod;
const int d5 = 100100;
template <int mod> struct ModInt {
int x;
ModInt()... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define All(v) (v).begin(), (v).end()
int dy[8] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int mod = 998244353;
const int inf = mod * mod;
const int d5 = 200100;
template <int mod> struct ModInt {
int x;
ModInt()... | replace | 8 | 9 | 8 | 9 | 0 | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define so(v) sort(v.begin(), v.end())
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;
const int MAX = 510000;
const int MOD = 998244353;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
voi... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define so(v) sort(v.begin(), v.end())
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;
const int MAX = 510000;
const int MOD = 998244353;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
voi... | replace | 48 | 50 | 48 | 52 | TLE | |
p02685 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 998244353;
struct mint {
ll v;
mint(ll a = 0) : v((a % mod + mod) % mod) {}
mint operator-() const { return mint(-v); }
mint &operator+=(const mint a) {
if ((v += a.v) >= mod)
v -= mod;
return *this;
}
mint &o... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 998244353;
struct mint {
ll v;
mint(ll a = 0) : v((a % mod + mod) % mod) {}
mint operator-() const { return mint(-v); }
mint &operator+=(const mint a) {
if ((v += a.v) >= mod)
v -= mod;
return *this;
}
mint &o... | replace | 76 | 79 | 76 | 85 | TLE | |
p02686 | C++ | Runtime Error | // #include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ... | // #include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ... | replace | 46 | 47 | 46 | 47 | 0 | |
p02686 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<pair<int, int>> P(0);
vector<pair<int, int>> M(0);
int l, r, pp, pm, pos, n, b, h;
string s;
bool flgL = true, flgR = true;
for (int i = 0; i < N; i++) {
cin >> s;
b = 0, h = 0;
n = s.size();
for (int j =... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<pair<int, int>> P(0);
vector<pair<int, int>> M(0);
int l, r, pp, pm, pos, n, b, h;
string s;
bool flgL = true, flgR = true;
for (int i = 0; i < N; i++) {
cin >> s;
b = 0, h = 0;
n = s.size();
for (int j =... | replace | 16 | 17 | 16 | 17 | 0 | |
p02686 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int M = 1e5;
vector<pair<int, int>> negg, tot;
pair<int, int> seg[4 * M];
int small = -1e9;
pair<int, int> build(int l, int r, int i) {
if (l == r)
seg[i] = tot[l];
else
seg[i] = max(build(l, (l + r) / 2, i * 2 + 1),
build((l + r) / 2 +... | #include <bits/stdc++.h>
using namespace std;
const int M = 1e6;
vector<pair<int, int>> negg, tot;
pair<int, int> seg[4 * M];
int small = -1e9;
pair<int, int> build(int l, int r, int i) {
if (l == r)
seg[i] = tot[l];
else
seg[i] = max(build(l, (l + r) / 2, i * 2 + 1),
build((l + r) / 2 +... | replace | 4 | 5 | 4 | 5 | 0 | |
p02686 | 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;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | replace | 65 | 66 | 65 | 66 | 0 | |
p02686 | C++ | Time Limit Exceeded | // #include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
Dy[8] = {-1, -1, 0... | // #include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
Dy[8] = {-1, -1, 0... | replace | 106 | 107 | 106 | 108 | TLE | |
p02686 | C++ | Runtime Error | // #pragma GCC optimize(3,"Ofast","inline")
// #pragma GCC optimize(2)
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack... | // #pragma GCC optimize(3,"Ofast","inline")
// #pragma GCC optimize(2)
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack... | replace | 61 | 62 | 61 | 64 | 0 | |
p02686 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n) ... | #include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n) ... | replace | 45 | 54 | 45 | 50 | 0 | |
p02686 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
#define dump(x) cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOREACH(x, a) ... | #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
#define dump(x) cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOREACH(x, a) ... | replace | 102 | 104 | 102 | 105 | TLE | |
p02686 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <... | replace | 113 | 114 | 113 | 116 | TLE | |
p02686 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | replace | 84 | 85 | 84 | 85 | 0 | |
p02686 | C++ | Runtime Error | // by szh
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int, int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" ... | // by szh
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int, int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" ... | replace | 34 | 35 | 34 | 35 | 0 | |
p02686 | C++ | Time Limit Exceeded | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define vec vector
#define fi first
#define se second
#define eb emplace_back
#define ef emplace_front
#define pof pop_front()
#define pob pop_back()
#define Rep(i, n) for (li i = 0, nn = (li)(n); i != nn; ++i)
#define Rep1(i, n) for (li i = 1, nn = (... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define vec vector
#define fi first
#define se second
#define eb emplace_back
#define ef emplace_front
#define pof pop_front()
#define pob pop_back()
#define Rep(i, n) for (li i = 0, nn = (li)(n); i != nn; ++i)
#define Rep1(i, n) for (li i = 1, nn ... | replace | 0 | 1 | 0 | 1 | TLE | |
p02686 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, k) for (int i = (int)(j); i <= (int)(k); i++)
#define debug(x) cerr << #x << ":" << (x) << endl
#define fix cout << fixed << setprecision(20);
#define int long long
const int maxn = (int)1e6 + 5;
int a[maxn], b[maxn], idx[maxn];
bool cmp(int i, int j) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, j, k) for (int i = (int)(j); i <= (int)(k); i++)
#define debug(x) cerr << #x << ":" << (x) << endl
#define fix cout << fixed << setprecision(20);
#define int long long
const int maxn = (int)1e6 + 5;
int a[maxn], b[maxn], idx[maxn];
bool cmp(int i, int j) { //... | replace | 8 | 9 | 8 | 16 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.