#include <bits/stdc++.h>
#include "circuit.h"
#define ll int
#define all(x) x.begin(), x.end()
#define x_c first
#define y_c second
using namespace std;
ll n, m, MOD = 1000002022;
vector <ll> p, a;
vector <bool> flag(9);
vector <vector <ll>> gr;
int group_1(int l, int r)
{
for(int i = l; i <= r; i++)
{
a[i] = 1 - a[i];
}
ll col = 0;
for(int i = 0; i < m; i++)
{
col += a[i];
}
return col;
}
int count_ways(int L, int R)
{
return group_1(L, R);
}
void init(int N, int M, vector <int> P, vector <int> A)
{
n = N;
m = M;
p = P;
a = A;
gr.resize(n);
ll mx = 0;
for(int i = 1; i < n + m; i++)
{
gr[p[i]].push_back(i);
ll h = gr[p[i]].size();
mx = max(mx, h);
}
if(n == 1)
{
flag[1] = true;
}
else if(n <= 1000 && mx <= 2)
{
flag[2] = true;
}
else if(mx <= 2)
{
flag[6] = true;
}
else if(n <= 1000 && m <= 1000)
{
flag[3] = true;
}
else if(n <= 5000 && m <= 5000)
{
flag[7] = true;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1217 ms |
3388 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1217 ms |
3388 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
2nd lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |