Submission #719930

#TimeUsernameProblemLanguageResultExecution timeMemory
719930ismayilDigital Circuit (IOI22_circuit)C++17
2 / 100
12 ms1080 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...