Submission #107081

#TimeUsernameProblemLanguageResultExecution timeMemory
107081stefdasca동굴 (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> void exploreCave(int n) { int S[N+2], D[N+2]; memset(S, 0, sizeof(S)); memset(D, 0, sizeof(D)); int P[N+2], pus[N+2]; memset(P, 0, sizeof(P)); for(int i = 0; i < n; ++i) { int st = 0; int dr = n-1; for(int j = 0; j < n; ++j) if(pus[j]) P[j] = S[j]; else P[j] = 1; int ans = tryCombination(P); bool ce = 0; if(ans > i) ce = 1; while(st < dr) { int mid = (st + dr) / 2; for(int j = 0; j < n; ++j) { if(pus[j]) P[j] = S[j]; else if(st <= j && j <= mid) P[j] = ce; else P[j] = ce ^ 1; } ans = tryCombination(P); if(ans > i) dr = mid; else st = mid + 1; } pus[st] = 1; S[st] = i; D[st] = ce; } answer(S, D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:5:11: error: 'N' was not declared in this scope
     int S[N+2], D[N+2];
           ^
cave.cpp:6:12: error: 'S' was not declared in this scope
     memset(S, 0, sizeof(S));
            ^
cave.cpp:7:12: error: 'D' was not declared in this scope
     memset(D, 0, sizeof(D));
            ^
cave.cpp:9:12: error: 'P' was not declared in this scope
     memset(P, 0, sizeof(P));
            ^
cave.cpp:15:16: error: 'pus' was not declared in this scope
             if(pus[j])
                ^~~
cave.cpp:15:16: note: suggested alternative: 'puts'
             if(pus[j])
                ^~~
                puts
cave.cpp:28:20: error: 'pus' was not declared in this scope
                 if(pus[j])
                    ^~~
cave.cpp:28:20: note: suggested alternative: 'puts'
                 if(pus[j])
                    ^~~
                    puts
cave.cpp:42:9: error: 'pus' was not declared in this scope
         pus[st] = 1;
         ^~~
cave.cpp:42:9: note: suggested alternative: 'puts'
         pus[st] = 1;
         ^~~
         puts