Submission #797558

#TimeUsernameProblemLanguageResultExecution timeMemory
797558XJP12Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
bool 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; } } int a[7]; if(ban==false && ban1>1){ a[7]={0,1,0,1,0,1,0}; return make_pair(true,a); }else{ return make_pair(false,a); } }

Compilation message (stderr)

islands.cpp:1:39: error: expected ',' or '...' before 'u'
    1 | bool find_journey(int n, int m, int[] u, int[] v){
      |                                       ^
islands.cpp: In function 'bool 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:22: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
   13 |   a[7]={0,1,0,1,0,1,0};
      |                      ^
islands.cpp:14:10: error: 'make_pair' was not declared in this scope
   14 |   return make_pair(true,a);
      |          ^~~~~~~~~
islands.cpp:16:10: error: 'make_pair' was not declared in this scope
   16 |   return make_pair(false,a);
      |          ^~~~~~~~~