제출 #249655

#제출 시각아이디문제언어결과실행 시간메모리
249655muhammad_hokimiyon동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #define fi first #define se second #define ll long long #define dl double long using namespace std; const int NN = 1e9 + 7; const int N = 2e6 + 7; const int M = 26; const ll mod = 1e9 + 7; const ll inf = 1e18 + 7; const dl rf = 1e-14; const int B = sqrt(N); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); void exploreCave(int N) { vector < pair < int , int > > ans(N , {0 , 0}); vector < int > used(N , 0); for( int i = 0; i < N; i++ ){ vector < int > s(N , 0); for( int j = 0; j < N; j++ ){ if( used[j] )s[j] = ans[j].se; } for( int j = i; j < N; j++ ){ s[j] = 0; } int x = tryCombination(s); if( x < i )x = 1; else x = 0; int l = 0 , r = N - 1; while( l < r ){ int m = (l + r) / 2; vector < int > qr(N , 0); for( int j = 0; j < N; j++ ){ if( used[j] ){ qr[j] = ans[j].se; } } for( int j = 0; j < m; j++ ){ if( !used[j] ){ qr[j] = x; } } int xx = tryCombination(qr); if( xx >= i )r = m; else l = m + 1; } ans[l] = { i , x }; } vector < int > S; vector < int > D: for( int i = 0; i < N; i++ ){ S.push_back(ans[i].se); D.push_back(ans[i].fi); } answer( S , D ); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp:16:15: error: 'sqrt' was not declared in this scope
 const int B = sqrt(N);
               ^~~~
cave.cpp:16:15: note: suggested alternative: 'short'
 const int B = sqrt(N);
               ^~~~
               short
cave.cpp:17:1: error: 'mt19937' does not name a type
 mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 ^~~~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:22:5: error: 'vector' was not declared in this scope
     vector < pair < int , int > > ans(N , {0 , 0});
     ^~~~~~
cave.cpp:22:14: error: 'pair' was not declared in this scope
     vector < pair < int , int > > ans(N , {0 , 0});
              ^~~~
cave.cpp:22:21: error: expected primary-expression before 'int'
     vector < pair < int , int > > ans(N , {0 , 0});
                     ^~~
cave.cpp:22:50: error: expected primary-expression before ')' token
     vector < pair < int , int > > ans(N , {0 , 0});
                                                  ^
cave.cpp:23:14: error: expected primary-expression before 'int'
     vector < int > used(N , 0);
              ^~~
cave.cpp:25:18: error: expected primary-expression before 'int'
         vector < int > s(N , 0);
                  ^~~
cave.cpp:27:17: error: 'used' was not declared in this scope
             if( used[j] )s[j] = ans[j].se;
                 ^~~~
cave.cpp:27:17: note: suggested alternative: 'se'
             if( used[j] )s[j] = ans[j].se;
                 ^~~~
                 se
cave.cpp:27:26: error: 's' was not declared in this scope
             if( used[j] )s[j] = ans[j].se;
                          ^
cave.cpp:27:33: error: 'ans' was not declared in this scope
             if( used[j] )s[j] = ans[j].se;
                                 ^~~
cave.cpp:30:13: error: 's' was not declared in this scope
             s[j] = 0;
             ^
cave.cpp:32:32: error: 's' was not declared in this scope
         int x = tryCombination(s);
                                ^
cave.cpp:38:22: error: expected primary-expression before 'int'
             vector < int > qr(N , 0);
                      ^~~
cave.cpp:40:21: error: 'used' was not declared in this scope
                 if( used[j] ){
                     ^~~~
cave.cpp:40:21: note: suggested alternative: 'se'
                 if( used[j] ){
                     ^~~~
                     se
cave.cpp:41:21: error: 'qr' was not declared in this scope
                     qr[j] = ans[j].se;
                     ^~
cave.cpp:41:21: note: suggested alternative: 'r'
                     qr[j] = ans[j].se;
                     ^~
                     r
cave.cpp:41:29: error: 'ans' was not declared in this scope
                     qr[j] = ans[j].se;
                             ^~~
cave.cpp:45:22: error: 'used' was not declared in this scope
                 if( !used[j] ){
                      ^~~~
cave.cpp:45:22: note: suggested alternative: 'se'
                 if( !used[j] ){
                      ^~~~
                      se
cave.cpp:46:21: error: 'qr' was not declared in this scope
                     qr[j] = x;
                     ^~
cave.cpp:46:21: note: suggested alternative: 'r'
                     qr[j] = x;
                     ^~
                     r
cave.cpp:49:37: error: 'qr' was not declared in this scope
             int xx = tryCombination(qr);
                                     ^~
cave.cpp:49:37: note: suggested alternative: 'r'
             int xx = tryCombination(qr);
                                     ^~
                                     r
cave.cpp:53:9: error: 'ans' was not declared in this scope
         ans[l] = { i , x };
         ^~~
cave.cpp:55:14: error: expected primary-expression before 'int'
     vector < int > S;
              ^~~
cave.cpp:56:14: error: expected primary-expression before 'int'
     vector < int > D:
              ^~~
cave.cpp:57:21: error: 'i' was not declared in this scope
     for( int i = 0; i < N; i++ ){
                     ^
cave.cpp:61:13: error: 'S' was not declared in this scope
     answer( S , D );
             ^
cave.cpp:61:17: error: 'D' was not declared in this scope
     answer( S , D );
                 ^