제출 #789408

#제출 시각아이디문제언어결과실행 시간메모리
789408Joibangla사이버랜드 (APIO23_cyberland)C++17
컴파일 에러
0 ms0 KiB
#include<cyberland.h> #include<bits/stdc++.h> #include<algorithm> using namespace std; int main(){ double solve(int n,int m,int h,int k,std::vector<int>x, std::vector<int>y, std::vector<int>c, std::vector<int>arr); int ans=0; for(i=0 ; i<n , i++){ if(n/i){ int ans+=i; } else{ int ans=-1; } } } }

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

cyberland.cpp: In function 'int main()':
cyberland.cpp:11:5: error: 'i' was not declared in this scope
   11 | for(i=0 ; i<n , i++){
      |     ^
cyberland.cpp:11:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 | for(i=0 ; i<n , i++){
      |             ^
      |             yn
cyberland.cpp:11:20: error: expected ';' before ')' token
   11 | for(i=0 ; i<n , i++){
      |                    ^
      |                    ;
cyberland.cpp:13:8: error: expected initializer before '+=' token
   13 | int ans+=i;
      |        ^~
cyberland.cpp:16:5: warning: unused variable 'ans' [-Wunused-variable]
   16 | int ans=-1;
      |     ^~~
cyberland.cpp:9:5: warning: unused variable 'ans' [-Wunused-variable]
    9 | int ans=0;
      |     ^~~
cyberland.cpp: At global scope:
cyberland.cpp:20:1: error: expected declaration before '}' token
   20 | }
      | ^