Submission #789408

#TimeUsernameProblemLanguageResultExecution timeMemory
789408JoibanglaCyberland (APIO23_cyberland)C++17
Compilation error
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; } } } }

Compilation message (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 | }
      | ^