제출 #800278

#제출 시각아이디문제언어결과실행 시간메모리
800278Tunglam07Radio (COCI22_radio)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t,s; memset(ck,0,sizeof(ck)); cin >> t >> s; bool ck[t+1],ckgcd=0; while(s--) { int n; char s; cin >> s; if(s == 'S') { cin >> n; if(ck[n]==1) { ck[n]=0; } else { ck[n]=1; } } else { int l,r; cin >> l >> r; ckgcd=0; for(int i=l;i<=r;i++) { for(int j=i+1;j<=r;j++) { if(ck[i]==1 && ck[j]==1 && __gcd(i,j)>1) { ckgcd=1; break; } } if(ckgcd==1) { break; } } if(ckgcd==1) { cout << "DA" << endl; } else { cout << "NE" << endl; } } } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:10:9: error: 'ck' was not declared in this scope
   10 |  memset(ck,0,sizeof(ck));
      |         ^~