Submission #910753

#TimeUsernameProblemLanguageResultExecution timeMemory
910753tnunDigital Circuit (IOI22_circuit)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back int n,m,p[100060],a[100060]; int count_ways(int l,int r){ for(int i=l-1;i<r;i++){ A[i]=(A[i]+1)%2; } int cnt=0; for(int i=0;i<M;i++){ if(A[i]==1){ cnt++; } } return cnt; } void init(int N,int M, int P[],int A[]){ n=N; m=M; for(int i=0;i<N+M;i++){ p[i]=P[i]; } for(int i=0;i<M;i++){ a[i]=A[i]; } }

Compilation message (stderr)

circuit.cpp: In function 'int count_ways(int, int)':
circuit.cpp:8:3: error: 'A' was not declared in this scope
    8 |   A[i]=(A[i]+1)%2;
      |   ^
circuit.cpp:11:16: error: 'M' was not declared in this scope
   11 |  for(int i=0;i<M;i++){
      |                ^
circuit.cpp:12:6: error: 'A' was not declared in this scope
   12 |   if(A[i]==1){
      |      ^