#include "circuit.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
int N,M;
const int MOD=1e9+2022;
vector<vector<int>> tree;
vector<int> p;
vector<vector<bool>> toChange;
vector<int> state;
vector<int> depth;
vector<int> poss;
vector<vector<int>> memo;
void init(signed n, signed m, std::vector<signed> P, std::vector<signed> A) {
N=n; M=m;
p.resize(N+M);
for (int i = 0; i < N+M; i++) p[i]=P[i];
tree.resize(N+M); state.resize(N+M);
toChange.resize(N+M,vector<bool>(2, false));
memo.resize(N+M, vector<int>(2,-1));
for (int i = 1; i < N+M; i++) tree[P[i]].push_back(i);
for (int i = N; i < N+M; i++) state[i] = A[i-N];
}
signed count_ways(signed L, signed R) {
for (int i = L; i <= R; i++) state[i] = 1-state[i];
int d=0;
for (int i = N; i < N+M; i++) d+=state[i];
return d;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
600 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
496 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 1st token, expected: '52130940', found: '128' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
600 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
496 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 1st token, expected: '52130940', found: '128' |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1333 ms |
12864 KB |
1st lines differ - on the 1st token, expected: '431985922', found: '16402' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1333 ms |
12864 KB |
1st lines differ - on the 1st token, expected: '431985922', found: '16402' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 1st token, expected: '52130940', found: '128' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
600 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
496 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 1st token, expected: '52130940', found: '128' |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
600 KB |
Output is correct |
6 |
Correct |
1 ms |
600 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
496 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 1st token, expected: '52130940', found: '128' |
11 |
Halted |
0 ms |
0 KB |
- |