Submission #789408

# Submission time Handle Problem Language Result Execution time Memory
789408 2023-07-21T10:53:58 Z Joibangla Cyberland (APIO23_cyberland) C++17
Compilation error
0 ms 0 KB
#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

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 | }
      | ^