Submission #1216657

#TimeUsernameProblemLanguageResultExecution timeMemory
1216657lizi14Cave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include "cave.h"
using namespace std;

void exploreCave(int N) {
    int x[N];
    int s[N];
    fill(s,s+N,0);
    fill(x,x+N,0);
    int an=0;
    while(true){
        int a=tryCombination(x[N]);
        if(a==-1){
            break;
        }
        if(a>an){
            for(int i=0; i<an; i++){
                if(s[i]!=x[i]){
                    s[i]=x[i];
                }
            }
            a=an-1;
        }
        else x[a]=1-x[a];
    }
    int c[N];
    for(int i=0; i<N; i++)c[i]=i;
    return answer(x[N],c[N]);
}

Compilation message (stderr)

cave.cpp:11:35: warning: `\U0000037e' is not in NFC [-Wnormalized=]
   11 |         int a=tryCombination(x[N]);
      |                                   ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:7:5: error: 'fill' was not declared in this scope
    7 |     fill(s,s+N,0);
      |     ^~~~
cave.cpp:11:33: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |         int a=tryCombination(x[N]);
      |                              ~~~^
      |                                 |
      |                                 int
In file included from cave.cpp:1:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:11:35: error: expected ',' or ';' before '\U0000037e'
   11 |         int a=tryCombination(x[N]);
      |                                   ^
cave.cpp:27:22: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   27 |     return answer(x[N],c[N]);
      |                   ~~~^
      |                      |
      |                      int
In file included from cave.cpp:1:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~
cave.cpp:27:27: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   27 |     return answer(x[N],c[N]);
      |                        ~~~^
      |                           |
      |                           int
In file included from cave.cpp:1:
cave.h:9:26: note:   initializing argument 2 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |                      ~~~~^~~