Submission #628348

#TimeUsernameProblemLanguageResultExecution timeMemory
628348c28dnv9q3Digital Circuit (IOI22_circuit)C++17
2 / 100
10 ms1328 KiB
#include "circuit.h" #include <vector> using namespace std; // N ... num threshold gates // M ... num source gates vector<int> A; const int MOD = 1000002022; void init(int N, int M, vector<int> P, vector<int> A) { ::A = A; } // toggle state of source gates between L and R (inclusive) // return num distinctive param assignments with gate#0 = 1 int count_ways(int L, int R) { for (int i = L; i <= R; i++) A[i-1] = 1-A[i-1]; int s = 0; for (int i = 0; i < A.size(); i++) s += A[i]; return s; }

Compilation message (stderr)

circuit.cpp: In function 'int count_ways(int, int)':
circuit.cpp:23:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |   for (int i = 0; i < A.size(); i++)
      |                   ~~^~~~~~~~~~
#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...