//#include "circuit.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(i,m,n) for(int i=(m); i<=(n); i++)
#define reb(i,m,n) for(int i=(m); i>=(n); i--)
#define iter(id, v) for(auto id : v)
#define fs first
#define se second
#define MP make_pair
#define pb push_back
#define bit(msk, i) ((msk >> i) & 1)
#define SZ(v) (ll)v.size()
#define ALL(v) v.begin(),v.end()
using namespace std;
mt19937_64 rd(chrono :: steady_clock :: now ().time_since_epoch().count());
ll Rand (ll l, ll r) { return uniform_int_distribution<ll> (l, r) (rd); }
const int N = 2e5 + 7;
const int Mod = 1e9 + 2022;
const int INF = 1e9;
const ll BASE = 137;
const int szBL = 350;
int n, m, Q;
int P[N], a[N];
vector<int> ke[N];
pii qr[N];
bool sub4c = 0, sub5c;
namespace sub3 {
const int N1 = 2e3 + 7;
ll dp[N1][2], f[N1][N1];
void dfs (int u, int p) {
iter (&v, ke[u]) {
if (v != p) {///aware!!!!!!!!
dfs(v, u);
}
}
int m = SZ(ke[u]);
rep (i, 0, m)
rep (j, 0, m) f[i][j] = 0;
f[0][0] = 1;
rep (i, 1, m) {
int v = ke[u][i - 1];
rep (j, 0, m ) {
f[i][j] = f[i - 1][j] * dp[v][0] % Mod;
if (j) (f[i][j] += f[i - 1][j - 1] * dp[v][1] % Mod) %= Mod;
}
}
ll pre = f[m][0];
rep (i, 1, m) {
(dp[u][0] += pre) %= Mod;
(pre += f[m][i]) %= Mod;
}
ll suf = 0;
reb (i, m, 1) {
(suf += f[m][i]) %= Mod;
(dp[u][1] += suf) %= Mod;
}
// cout << u<<" "<<dp[u][0]<<","<<dp[u][1] <<"\n";
}
ll solution(int L, int R) {
rep (i, L, R) a[i] ^= 1;
rep (i, 1, n + m) rep (j, 0, 1) dp[i][j] = 0;
rep (i, n + 1, n + m) dp[i][a[i]] = 1;
dfs(1, 0);
return dp[1][1];
}
}
namespace sub4 {
ll dp[N][2];
int pa[N];
bool check () {
int K = 1; while (K < m) K *= 2;
if (K == m && m == n + 1) {
rep (i, 1, n + m - 1) if (P[i + 1] != (i - 1) / 2) return 0;
return 1;
}
return 0;
}
void update (int u) {
if (SZ(ke[u]) == 0) {
dp[u][a[u]] = 1;
dp[u][a[u] ^ 1] = 0;
return;
}
int v1 = ke[u][0], v2 = ke[u][1];
ll delta = (dp[v1][0] * dp[v2][1] % Mod + dp[v1][1] * dp[v2][0] % Mod) % Mod;
dp[u][0] = (delta + 2LL * dp[v1][0] * dp[v2][0] % Mod) % Mod;
dp[u][1] = (delta + 2LL * dp[v1][1] * dp[v2][1] % Mod) % Mod;
}
void dfs (int u, int p) {
pa[u] = p;
iter (&v, ke[u]) {
dfs(v, u);
}
update (u);
}
void init () {
dfs(1, 0);
}
int solution(int u) {
while (u != 0) {
update(u);
u = pa[u];
}
return dp[1][1];
}
}
namespace sub6 {
struct Segment_Tree_0 {
int m;
ll lz[N << 2];
void init (int n ) {
m = n;
rep (i, 1, n << 2) lz[i] = 1;
}
void down (int id) {
rep (i, id << 1, id << 1 | 1) {
(lz[i] *= lz[id]) %= Mod;
}
lz[id] = 1;
}
void update (int id, int l, int r, int u, int v, ll val) {
if (l > v || r < u) return;
if (l >= u && r <= v){
(lz[id] *= val) %= Mod;
return;
}
int mid = l + r >> 1;
down(id);
update (id << 1, l, mid, u, v, val);
update (id << 1 | 1, mid + 1, r, u, v, val);
}
ll get (int id, int l, int r, int pos) {
if (l > pos || r < pos) return -1;
if (l == r) return lz[id];
down(id);
int mid = l + r >> 1;
return max (get (id << 1, l, mid, pos),
get (id << 1 | 1, mid + 1, r, pos));
}
void update (int u, int v, ll val) {
update (1, 1, m, u, v, val);
}
ll get (int pos) {
return get (1, 1, m, pos);
}
}ST0;
int ein[N], eout[N], szC[N];
ll pre[N], suf[N], tot[N];
struct Segment_Tree_1 {
int m;
ll st[N << 2][2];
bool lz[N << 2];
void build (int id, int l, int r) {
if (l == r) {
ll curV = ST0.get(ein[l + n]);
// cout << l + n <<" "<<curV<<"\n";
st[id][a[l + n]] = curV;
return;
}
int mid = l + r >> 1;
build (id << 1, l, mid);
build (id << 1 | 1, mid + 1, r);
rep (i, 0, 1) st[id][i] = (st[id << 1][i] + st[id << 1 | 1][i]) % Mod;
}
void down (int id) {
if (lz[id]) {
rep (i, id << 1, id << 1 | 1) {
swap(st[i][0], st[i][1]);
lz[i] ^= 1;
}
lz[id] = 0;
}
}
void flip (int id, int l, int r, int u, int v) {
if (l > v || r < u) return;
if (l >= u && r <= v) {
swap(st[id][0], st[id][1]);
lz[id] ^= 1;
return;
}
int mid = l + r >> 1;
down(id);
flip (id << 1, l, mid, u, v);
flip (id << 1 | 1, mid + 1, r, u, v);
rep (i, 0, 1) st[id][i] = (st[id << 1][i] + st[id << 1 | 1][i]) % Mod;
}
void init (int n) {
m = n;
build(1, 1, m);
}
void flip (int u, int v) {
flip (1, 1, m, u, v);
}
}ST1;
void pdfs (int u) {
static int time_dfs = 0;
szC[u] = 1;
ein[u] = ++time_dfs;
iter (&v, ke[u]) {
pdfs(v);
szC[u] += szC[v];
}
eout[u] = time_dfs;
int K = SZ(ke[u]);
tot[u] = max(1, K);
iter (&v, ke[u]) tot[u] = tot[u] * tot[v] % Mod;
pre[0] = 1;
rep (i, 1, K) pre[i] = pre[i - 1] * tot[ke[u][i - 1]] % Mod;
suf[K + 1] = 1;
reb (i, K, 1) suf[i] = suf[i + 1] * tot[ke[u][i - 1]] % Mod;
rep (i, 1, K) {
int v = ke[u][i - 1];
ST0.update (ein[v], eout[v], pre[i - 1] * suf[i + 1] % Mod);
}
}
///offset ed
void init () {
ST0.init(n + m);
pdfs(1);
ST1.init(m);
}
int solution (int L, int R) {
L -= n;
R -= n;
ST1.flip(L, R);
return ST1.st[1][1];
}
}
int count_ways (int L, int R) { ///int function must have a return value
++L,++R;
// if (n <= 1000 & m <= 1000)
// return sub3 :: solution(L, R);
// else
return sub6 :: solution(L, R);
}
void init (int _n, int _m, vector<int> _P, vector<int> _a) {
n = _n;
m = _m;
rep (i, 1, n + m) P[i] = _P[i - 1];
rep (i, 1, m) a[i + n] = _a[i - 1];
rep (i, 1, n + m) {
if (i > 1) ke[P[i] + 1].pb(i);
}
sub4c = sub4 :: check();
if (sub4c) sub4 :: init();
sub6 :: init();
}
void solution() {
cin >> n >> m >> Q;
rep (i, 1, n + m) {
cin >> P[i];
if (i > 1) ke[P[i] + 1].pb(i);
}
rep (i, n + 1, n + m) cin >> a[i];
sub4c = sub4 :: check();
if (sub4c) sub4 :: init();
sub6 :: init();
rep (i, 1, Q) {
int L, R;
cin >> L >> R;
cout << count_ways(L, R) <<"\n";
}
}
//#define file(name) freopen(name".inp","r",stdin); \
//freopen(name".out","w",stdout);
//int main () {
//// file("c");
// ios_base :: sync_with_stdio(false); cin.tie(0); cout.tie(0);
// int num_Test = 1;
//// init(3, 4, {-1, 0, 1, 2, 1, 1, 0}, {1, 0, 1, 0});
//// cout << count_ways(3, 4) <<"\n";
//// cin >> num_Test;
// while (num_Test--)
// solution();
//}
/*
no bug +5
3 4 3
-1 0 1 2 1 1 0
1 0 1 0
3 4
4 5
3 6
*/
Compilation message
circuit.cpp:305:1: warning: multi-line comment [-Wcomment]
305 | //#define file(name) freopen(name".inp","r",stdin); \
| ^
circuit.cpp: In member function 'void sub6::Segment_Tree_0::update(int, int, int, int, int, long long int)':
circuit.cpp:150:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
150 | int mid = l + r >> 1;
| ~~^~~
circuit.cpp: In member function 'long long int sub6::Segment_Tree_0::get(int, int, int, int)':
circuit.cpp:160:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
160 | int mid = l + r >> 1;
| ~~^~~
circuit.cpp: In member function 'void sub6::Segment_Tree_1::build(int, int, int)':
circuit.cpp:188:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
188 | int mid = l + r >> 1;
| ~~^~~
circuit.cpp: In member function 'void sub6::Segment_Tree_1::flip(int, int, int, int, int)':
circuit.cpp:211:25: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
211 | int mid = l + r >> 1;
| ~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
7256 KB |
Output is correct |
4 |
Correct |
3 ms |
7256 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
7256 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
5208 KB |
Output is correct |
4 |
Correct |
3 ms |
5208 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
5208 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
9 |
Correct |
3 ms |
5208 KB |
Output is correct |
10 |
Correct |
4 ms |
5464 KB |
Output is correct |
11 |
Correct |
3 ms |
5464 KB |
Output is correct |
12 |
Correct |
3 ms |
7256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
7256 KB |
Output is correct |
4 |
Correct |
3 ms |
7256 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
7256 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
9 |
Correct |
3 ms |
5208 KB |
Output is correct |
10 |
Correct |
2 ms |
5208 KB |
Output is correct |
11 |
Correct |
3 ms |
5208 KB |
Output is correct |
12 |
Correct |
3 ms |
5208 KB |
Output is correct |
13 |
Correct |
3 ms |
5208 KB |
Output is correct |
14 |
Correct |
3 ms |
5208 KB |
Output is correct |
15 |
Correct |
3 ms |
5208 KB |
Output is correct |
16 |
Correct |
3 ms |
5208 KB |
Output is correct |
17 |
Correct |
3 ms |
5208 KB |
Output is correct |
18 |
Correct |
4 ms |
5464 KB |
Output is correct |
19 |
Correct |
3 ms |
5464 KB |
Output is correct |
20 |
Correct |
3 ms |
7256 KB |
Output is correct |
21 |
Correct |
3 ms |
7256 KB |
Output is correct |
22 |
Correct |
3 ms |
5208 KB |
Output is correct |
23 |
Correct |
3 ms |
5188 KB |
Output is correct |
24 |
Correct |
3 ms |
5208 KB |
Output is correct |
25 |
Correct |
4 ms |
5208 KB |
Output is correct |
26 |
Correct |
3 ms |
5208 KB |
Output is correct |
27 |
Correct |
3 ms |
7256 KB |
Output is correct |
28 |
Correct |
3 ms |
7256 KB |
Output is correct |
29 |
Correct |
3 ms |
5276 KB |
Output is correct |
30 |
Correct |
3 ms |
5208 KB |
Output is correct |
31 |
Correct |
3 ms |
7256 KB |
Output is correct |
32 |
Correct |
3 ms |
5208 KB |
Output is correct |
33 |
Correct |
3 ms |
7256 KB |
Output is correct |
34 |
Correct |
3 ms |
5208 KB |
Output is correct |
35 |
Correct |
3 ms |
5208 KB |
Output is correct |
36 |
Correct |
3 ms |
5464 KB |
Output is correct |
37 |
Correct |
3 ms |
5464 KB |
Output is correct |
38 |
Correct |
3 ms |
5464 KB |
Output is correct |
39 |
Correct |
2 ms |
5208 KB |
Output is correct |
40 |
Correct |
3 ms |
5208 KB |
Output is correct |
41 |
Correct |
3 ms |
5208 KB |
Output is correct |
42 |
Correct |
3 ms |
7416 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
462 ms |
12888 KB |
Output is correct |
2 |
Correct |
727 ms |
20840 KB |
Output is correct |
3 |
Correct |
732 ms |
22740 KB |
Output is correct |
4 |
Correct |
728 ms |
22576 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
462 ms |
12888 KB |
Output is correct |
2 |
Correct |
727 ms |
20840 KB |
Output is correct |
3 |
Correct |
732 ms |
22740 KB |
Output is correct |
4 |
Correct |
728 ms |
22576 KB |
Output is correct |
5 |
Correct |
574 ms |
14912 KB |
Output is correct |
6 |
Correct |
740 ms |
22768 KB |
Output is correct |
7 |
Correct |
762 ms |
22604 KB |
Output is correct |
8 |
Correct |
689 ms |
22608 KB |
Output is correct |
9 |
Correct |
338 ms |
7512 KB |
Output is correct |
10 |
Correct |
629 ms |
8024 KB |
Output is correct |
11 |
Correct |
656 ms |
5976 KB |
Output is correct |
12 |
Correct |
652 ms |
5976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
5208 KB |
Output is correct |
4 |
Correct |
3 ms |
5208 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
5208 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
9 |
Correct |
3 ms |
5208 KB |
Output is correct |
10 |
Correct |
4 ms |
5464 KB |
Output is correct |
11 |
Correct |
3 ms |
5464 KB |
Output is correct |
12 |
Correct |
3 ms |
7256 KB |
Output is correct |
13 |
Correct |
462 ms |
12888 KB |
Output is correct |
14 |
Correct |
727 ms |
20840 KB |
Output is correct |
15 |
Correct |
732 ms |
22740 KB |
Output is correct |
16 |
Correct |
728 ms |
22576 KB |
Output is correct |
17 |
Correct |
574 ms |
14912 KB |
Output is correct |
18 |
Correct |
740 ms |
22768 KB |
Output is correct |
19 |
Correct |
762 ms |
22604 KB |
Output is correct |
20 |
Correct |
689 ms |
22608 KB |
Output is correct |
21 |
Correct |
338 ms |
7512 KB |
Output is correct |
22 |
Correct |
629 ms |
8024 KB |
Output is correct |
23 |
Correct |
656 ms |
5976 KB |
Output is correct |
24 |
Correct |
652 ms |
5976 KB |
Output is correct |
25 |
Correct |
797 ms |
27728 KB |
Output is correct |
26 |
Correct |
778 ms |
27884 KB |
Output is correct |
27 |
Correct |
793 ms |
27984 KB |
Output is correct |
28 |
Correct |
675 ms |
27984 KB |
Output is correct |
29 |
Correct |
862 ms |
38992 KB |
Output is correct |
30 |
Correct |
761 ms |
38992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
7256 KB |
Output is correct |
4 |
Correct |
3 ms |
7256 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
7256 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
9 |
Correct |
3 ms |
5208 KB |
Output is correct |
10 |
Correct |
2 ms |
5208 KB |
Output is correct |
11 |
Correct |
3 ms |
5208 KB |
Output is correct |
12 |
Correct |
3 ms |
5208 KB |
Output is correct |
13 |
Correct |
3 ms |
5208 KB |
Output is correct |
14 |
Correct |
3 ms |
5208 KB |
Output is correct |
15 |
Correct |
3 ms |
5208 KB |
Output is correct |
16 |
Correct |
3 ms |
5208 KB |
Output is correct |
17 |
Correct |
3 ms |
5208 KB |
Output is correct |
18 |
Correct |
4 ms |
5464 KB |
Output is correct |
19 |
Correct |
3 ms |
5464 KB |
Output is correct |
20 |
Correct |
3 ms |
7256 KB |
Output is correct |
21 |
Correct |
3 ms |
7256 KB |
Output is correct |
22 |
Correct |
3 ms |
5208 KB |
Output is correct |
23 |
Correct |
3 ms |
5188 KB |
Output is correct |
24 |
Correct |
3 ms |
5208 KB |
Output is correct |
25 |
Correct |
4 ms |
5208 KB |
Output is correct |
26 |
Correct |
3 ms |
5208 KB |
Output is correct |
27 |
Correct |
3 ms |
7256 KB |
Output is correct |
28 |
Correct |
3 ms |
7256 KB |
Output is correct |
29 |
Correct |
3 ms |
5276 KB |
Output is correct |
30 |
Correct |
3 ms |
5208 KB |
Output is correct |
31 |
Correct |
3 ms |
7256 KB |
Output is correct |
32 |
Correct |
3 ms |
5208 KB |
Output is correct |
33 |
Correct |
3 ms |
7256 KB |
Output is correct |
34 |
Correct |
3 ms |
5208 KB |
Output is correct |
35 |
Correct |
3 ms |
5208 KB |
Output is correct |
36 |
Correct |
3 ms |
5464 KB |
Output is correct |
37 |
Correct |
3 ms |
5464 KB |
Output is correct |
38 |
Correct |
3 ms |
5464 KB |
Output is correct |
39 |
Correct |
2 ms |
5208 KB |
Output is correct |
40 |
Correct |
3 ms |
5208 KB |
Output is correct |
41 |
Correct |
3 ms |
5208 KB |
Output is correct |
42 |
Correct |
3 ms |
7416 KB |
Output is correct |
43 |
Correct |
437 ms |
7512 KB |
Output is correct |
44 |
Correct |
643 ms |
5720 KB |
Output is correct |
45 |
Correct |
669 ms |
8020 KB |
Output is correct |
46 |
Correct |
633 ms |
8276 KB |
Output is correct |
47 |
Correct |
695 ms |
8024 KB |
Output is correct |
48 |
Correct |
684 ms |
6232 KB |
Output is correct |
49 |
Correct |
639 ms |
8024 KB |
Output is correct |
50 |
Correct |
613 ms |
8024 KB |
Output is correct |
51 |
Correct |
560 ms |
5976 KB |
Output is correct |
52 |
Correct |
640 ms |
5976 KB |
Output is correct |
53 |
Correct |
591 ms |
5976 KB |
Output is correct |
54 |
Correct |
687 ms |
6232 KB |
Output is correct |
55 |
Correct |
667 ms |
8024 KB |
Output is correct |
56 |
Correct |
631 ms |
5976 KB |
Output is correct |
57 |
Correct |
613 ms |
5720 KB |
Output is correct |
58 |
Correct |
674 ms |
6744 KB |
Output is correct |
59 |
Correct |
702 ms |
7000 KB |
Output is correct |
60 |
Correct |
635 ms |
7000 KB |
Output is correct |
61 |
Correct |
667 ms |
7768 KB |
Output is correct |
62 |
Correct |
606 ms |
7512 KB |
Output is correct |
63 |
Correct |
648 ms |
5720 KB |
Output is correct |
64 |
Correct |
656 ms |
7768 KB |
Output is correct |
65 |
Correct |
298 ms |
5464 KB |
Output is correct |
66 |
Correct |
689 ms |
8024 KB |
Output is correct |
67 |
Correct |
678 ms |
8024 KB |
Output is correct |
68 |
Correct |
642 ms |
8024 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
5208 KB |
Output is correct |
2 |
Correct |
2 ms |
5208 KB |
Output is correct |
3 |
Correct |
3 ms |
7256 KB |
Output is correct |
4 |
Correct |
3 ms |
7256 KB |
Output is correct |
5 |
Correct |
3 ms |
5208 KB |
Output is correct |
6 |
Correct |
3 ms |
7256 KB |
Output is correct |
7 |
Correct |
3 ms |
5208 KB |
Output is correct |
8 |
Correct |
3 ms |
5208 KB |
Output is correct |
9 |
Correct |
3 ms |
5208 KB |
Output is correct |
10 |
Correct |
2 ms |
5208 KB |
Output is correct |
11 |
Correct |
3 ms |
5208 KB |
Output is correct |
12 |
Correct |
3 ms |
5208 KB |
Output is correct |
13 |
Correct |
3 ms |
5208 KB |
Output is correct |
14 |
Correct |
3 ms |
5208 KB |
Output is correct |
15 |
Correct |
3 ms |
5208 KB |
Output is correct |
16 |
Correct |
3 ms |
5208 KB |
Output is correct |
17 |
Correct |
3 ms |
5208 KB |
Output is correct |
18 |
Correct |
4 ms |
5464 KB |
Output is correct |
19 |
Correct |
3 ms |
5464 KB |
Output is correct |
20 |
Correct |
3 ms |
7256 KB |
Output is correct |
21 |
Correct |
3 ms |
7256 KB |
Output is correct |
22 |
Correct |
3 ms |
5208 KB |
Output is correct |
23 |
Correct |
3 ms |
5188 KB |
Output is correct |
24 |
Correct |
3 ms |
5208 KB |
Output is correct |
25 |
Correct |
4 ms |
5208 KB |
Output is correct |
26 |
Correct |
3 ms |
5208 KB |
Output is correct |
27 |
Correct |
3 ms |
7256 KB |
Output is correct |
28 |
Correct |
3 ms |
7256 KB |
Output is correct |
29 |
Correct |
3 ms |
5276 KB |
Output is correct |
30 |
Correct |
3 ms |
5208 KB |
Output is correct |
31 |
Correct |
3 ms |
7256 KB |
Output is correct |
32 |
Correct |
3 ms |
5208 KB |
Output is correct |
33 |
Correct |
3 ms |
7256 KB |
Output is correct |
34 |
Correct |
3 ms |
5208 KB |
Output is correct |
35 |
Correct |
3 ms |
5208 KB |
Output is correct |
36 |
Correct |
3 ms |
5464 KB |
Output is correct |
37 |
Correct |
3 ms |
5464 KB |
Output is correct |
38 |
Correct |
3 ms |
5464 KB |
Output is correct |
39 |
Correct |
2 ms |
5208 KB |
Output is correct |
40 |
Correct |
3 ms |
5208 KB |
Output is correct |
41 |
Correct |
3 ms |
5208 KB |
Output is correct |
42 |
Correct |
3 ms |
7416 KB |
Output is correct |
43 |
Correct |
462 ms |
12888 KB |
Output is correct |
44 |
Correct |
727 ms |
20840 KB |
Output is correct |
45 |
Correct |
732 ms |
22740 KB |
Output is correct |
46 |
Correct |
728 ms |
22576 KB |
Output is correct |
47 |
Correct |
574 ms |
14912 KB |
Output is correct |
48 |
Correct |
740 ms |
22768 KB |
Output is correct |
49 |
Correct |
762 ms |
22604 KB |
Output is correct |
50 |
Correct |
689 ms |
22608 KB |
Output is correct |
51 |
Correct |
338 ms |
7512 KB |
Output is correct |
52 |
Correct |
629 ms |
8024 KB |
Output is correct |
53 |
Correct |
656 ms |
5976 KB |
Output is correct |
54 |
Correct |
652 ms |
5976 KB |
Output is correct |
55 |
Correct |
797 ms |
27728 KB |
Output is correct |
56 |
Correct |
778 ms |
27884 KB |
Output is correct |
57 |
Correct |
793 ms |
27984 KB |
Output is correct |
58 |
Correct |
675 ms |
27984 KB |
Output is correct |
59 |
Correct |
862 ms |
38992 KB |
Output is correct |
60 |
Correct |
761 ms |
38992 KB |
Output is correct |
61 |
Correct |
437 ms |
7512 KB |
Output is correct |
62 |
Correct |
643 ms |
5720 KB |
Output is correct |
63 |
Correct |
669 ms |
8020 KB |
Output is correct |
64 |
Correct |
633 ms |
8276 KB |
Output is correct |
65 |
Correct |
695 ms |
8024 KB |
Output is correct |
66 |
Correct |
684 ms |
6232 KB |
Output is correct |
67 |
Correct |
639 ms |
8024 KB |
Output is correct |
68 |
Correct |
613 ms |
8024 KB |
Output is correct |
69 |
Correct |
560 ms |
5976 KB |
Output is correct |
70 |
Correct |
640 ms |
5976 KB |
Output is correct |
71 |
Correct |
591 ms |
5976 KB |
Output is correct |
72 |
Correct |
687 ms |
6232 KB |
Output is correct |
73 |
Correct |
667 ms |
8024 KB |
Output is correct |
74 |
Correct |
631 ms |
5976 KB |
Output is correct |
75 |
Correct |
613 ms |
5720 KB |
Output is correct |
76 |
Correct |
674 ms |
6744 KB |
Output is correct |
77 |
Correct |
702 ms |
7000 KB |
Output is correct |
78 |
Correct |
635 ms |
7000 KB |
Output is correct |
79 |
Correct |
667 ms |
7768 KB |
Output is correct |
80 |
Correct |
606 ms |
7512 KB |
Output is correct |
81 |
Correct |
648 ms |
5720 KB |
Output is correct |
82 |
Correct |
656 ms |
7768 KB |
Output is correct |
83 |
Correct |
298 ms |
5464 KB |
Output is correct |
84 |
Correct |
689 ms |
8024 KB |
Output is correct |
85 |
Correct |
678 ms |
8024 KB |
Output is correct |
86 |
Correct |
642 ms |
8024 KB |
Output is correct |
87 |
Correct |
2 ms |
7000 KB |
Output is correct |
88 |
Correct |
483 ms |
24084 KB |
Output is correct |
89 |
Correct |
724 ms |
18220 KB |
Output is correct |
90 |
Correct |
752 ms |
17708 KB |
Output is correct |
91 |
Correct |
753 ms |
26192 KB |
Output is correct |
92 |
Correct |
808 ms |
26192 KB |
Output is correct |
93 |
Correct |
803 ms |
26132 KB |
Output is correct |
94 |
Correct |
841 ms |
26040 KB |
Output is correct |
95 |
Correct |
777 ms |
26212 KB |
Output is correct |
96 |
Correct |
690 ms |
18600 KB |
Output is correct |
97 |
Correct |
698 ms |
20680 KB |
Output is correct |
98 |
Correct |
620 ms |
27236 KB |
Output is correct |
99 |
Correct |
812 ms |
25880 KB |
Output is correct |
100 |
Correct |
763 ms |
21432 KB |
Output is correct |
101 |
Correct |
780 ms |
19544 KB |
Output is correct |
102 |
Correct |
767 ms |
17208 KB |
Output is correct |
103 |
Correct |
834 ms |
37052 KB |
Output is correct |
104 |
Correct |
829 ms |
39120 KB |
Output is correct |
105 |
Correct |
710 ms |
40948 KB |
Output is correct |
106 |
Correct |
751 ms |
21912 KB |
Output is correct |
107 |
Correct |
762 ms |
20048 KB |
Output is correct |
108 |
Correct |
747 ms |
19888 KB |
Output is correct |
109 |
Correct |
740 ms |
19024 KB |
Output is correct |