Submission #797568

#TimeUsernameProblemLanguageResultExecution timeMemory
797568jakobrsDigital Circuit (IOI22_circuit)C++17
2 / 100
2138 ms1360 KiB
#include <iostream> #include <vector> using i64 = int64_t; int n, m; std::vector<int> p, a; void init(int N, int M, std::vector<int> P, std::vector<int> A) { n = N; m = M; p = P; a = A; } int count_ways(int l, int r) { r += 1; l -= n; r -= n; int c = 0; for (i64 i = 0; i < m; i++) { if (l <= i && i < r) { a[i] = !a[i]; } c += a[i]; } return c; }
#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...