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 "circuit.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> states;
int n, m;
void init(int N, int M, std::vector<int> P, std::vector<int> A) {
states = A;
n = N;
m = M;
}
int count_ways(int L, int R) {
for (int i = L - n; i <= R - n; i++)
{
if (states[i] == 1)
{
states[i] = 0;
}
else
{
states[i] = 1;
}
}
int ans = 0;
for (int i = 0; i < m; i++)
{
ans += states[i];
}
return ans;
}
# | 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... |