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>
#define ll long long
#define endl '\n'
using namespace std;
const int MAX = 1e3;
vector<int> input(MAX);
int cnt = 0, n, m;
void init(int N, int M, vector<int> P, vector<int> A) {
n = N, m = M;
for(int i = 0; i < M; i++){
input[i] = A[i];
if(A[i]) cnt++;
}
}
int count_ways(int L, int R) {
for(int i = L - n; i <= R - n; i++){
if(input[i]){
cnt--;
input[i] = 0;
}else{
cnt++;
input[i] = 1;
}
}
return cnt;
}
# | 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... |