Submission #797554

#TimeUsernameProblemLanguageResultExecution timeMemory
797554XJP12Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
find_journey(int n, int m, int[] u, int[] v){ bool ban=true; int ban1=0; for(int i=0; i<m; i++){ if(u[i]==0){ ban1++; }else{ ban=false; } } if(ban==false && ban1>1){ int a[7]={0,1,0,1,0,1,0}; return {true,a}; }else{ return false; } }

Compilation message (stderr)

islands.cpp:1:34: error: expected ',' or '...' before 'u'
    1 | find_journey(int n, int m, int[] u, int[] v){
      |                                  ^
islands.cpp:1:1: error: ISO C++ forbids declaration of 'find_journey' with no type [-fpermissive]
    1 | find_journey(int n, int m, int[] u, int[] v){
      | ^~~~~~~~~~~~
islands.cpp: In function 'int find_journey(int, int, int*)':
islands.cpp:5:6: error: 'u' was not declared in this scope
    5 |   if(u[i]==0){
      |      ^
islands.cpp:13:17: error: cannot convert '<brace-enclosed initializer list>' to 'int' in return
   13 |   return {true,a};
      |                 ^