답안 #910766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
910766 2024-01-18T07:54:43 Z tnun 디지털 회로 (IOI22_circuit) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int n,m,p[100060],a[100060];
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];
}
}
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;
}

Compilation message

circuit.cpp:6:30: error: expected ',' or '...' before 'P'
    6 | void init(int N,int M, int []P,int []A){
      |                              ^
circuit.cpp: In function 'void init(int, int, int*)':
circuit.cpp:10:6: error: 'P' was not declared in this scope
   10 | p[i]=P[i];
      |      ^
circuit.cpp:13:6: error: 'A' was not declared in this scope
   13 | a[i]=A[i];
      |      ^