Submission #789402

# Submission time Handle Problem Language Result Execution time Memory
789402 2023-07-21T10:45:00 Z Joibangla Cyberland (APIO23_cyberland) C++17
Compilation error
0 ms 0 KB
#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=1 ; i<=n , i++){ 
if(n/i){ 
int ans+=i;
}
else{ 
int ans=-1;
}
}
}

Compilation message

cyberland.cpp: In function 'int main()':
cyberland.cpp:10:5: error: 'i' was not declared in this scope
   10 | for(i=1 ; i<=n , i++){
      |     ^
cyberland.cpp:10:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 | for(i=1 ; i<=n , i++){
      |              ^
      |              yn
cyberland.cpp:10:21: error: expected ';' before ')' token
   10 | for(i=1 ; i<=n , i++){
      |                     ^
      |                     ;
cyberland.cpp:12:8: error: expected initializer before '+=' token
   12 | int ans+=i;
      |        ^~
cyberland.cpp:15:5: warning: unused variable 'ans' [-Wunused-variable]
   15 | int ans=-1;
      |     ^~~
cyberland.cpp:8:5: warning: unused variable 'ans' [-Wunused-variable]
    8 | int ans=0;
      |     ^~~