This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |