제출 #878907

#제출 시각아이디문제언어결과실행 시간메모리
878907raul2008487동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" #define ll int #define pb push_back #define eb emplace_back #define vl vector<ll> #define fi first #define se second #define in insert #define mpr make_pair #define lg(x) __lg(x) #define bpc(x) __builtin_popcount(x) #define all(v) v.begin(), v.end() #define endl "\n" using namespace std; const int sz = 5005; bool used[sz]; void exploreCave(int N) { ll n, i, j, low, high, mid, a1, a2; ll ans1[n], ans2[n]; for(i=0;i<n;i++){ ans1[i] = ans2[i] = 0; } for(i=0;i<n;i++){ a1 = tryCombination(ans1); low = 0, high = n-1; while(low < high){ mid = (#include <bits/stdc++.h> #include "cave.h" #define ll int #define pb push_back #define eb emplace_back #define vl vector<ll> #define fi first #define se second #define in insert #define mpr make_pair #define lg(x) __lg(x) #define bpc(x) __builtin_popcount(x) #define all(v) v.begin(), v.end() #define endl "\n" using namespace std; const int sz = 5005; bool used[sz]; void exploreCave(int N) { ll n, i, j, low, high, mid, a1, a2; ll ans1[n], ans2[n]; for(i=0;i<n;i++){ ans1[i] = ans2[i] = 0; } for(i=0;i<n;i++){ a1 = tryCombination(ans1); low = 0, high = n-1; while(low < high){ mid = (low + high)>>1; for(j=low;j<=mid;j++){ if(used[j]){continue;} ans1[j] = (1 - ans1[j]); } a2 = tryCombination(ans1); for(j=low;j<=mid;j++){ if(used[j]){continue;} ans1[j] = (1 - ans1[j]); } if(a1 == -1){ if(a2 == i){high = mid;} else{ low = mid + 1; } } else if(a1 == i){ if(a2 != a1 || a2 == -1){ high = mid; } else{ low = mid + 1; } } else{ if(a2 == i){ high = mid; } else{ low = mid + 1; } } } used[low] = 1; ans2[low] = i; ans1[low] = (a1 == i); } answer(ans1, ans2); }

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

cave.cpp:29:20: error: stray '#' in program
   29 |             mid = (#include <bits/stdc++.h>
      |                    ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:29:21: error: 'include' was not declared in this scope
   29 |             mid = (#include <bits/stdc++.h>
      |                     ^~~~~~~
cave.cpp:29:30: error: 'bits' was not declared in this scope
   29 |             mid = (#include <bits/stdc++.h>
      |                              ^~~~
cave.cpp:29:35: error: 'stdc' was not declared in this scope; did you mean 'std'?
   29 |             mid = (#include <bits/stdc++.h>
      |                                   ^~~~
      |                                   std
cave.cpp:44:1: error: expected primary-expression before 'using'
   44 | using namespace std;
      | ^~~~~
cave.cpp:29:44: error: expected ')' before 'using'
   29 |             mid = (#include <bits/stdc++.h>
      |                   ~                        ^
      |                                            )
......
   44 | using namespace std;
      | ~~~~~                                       
cave.cpp:47:25: error: a function-definition is not allowed here before '{' token
   47 | void exploreCave(int N) {
      |                         ^
cave.cpp:95:1: error: expected '}' at end of input
   95 | }
      | ^
cave.cpp:28:26: note: to match this '{'
   28 |         while(low < high){
      |                          ^
cave.cpp:46:6: warning: unused variable 'used' [-Wunused-variable]
   46 | bool used[sz];
      |      ^~~~
cave.cpp:95:1: error: expected '}' at end of input
   95 | }
      | ^
cave.cpp:25:21: note: to match this '{'
   25 |     for(i=0;i<n;i++){
      |                     ^
cave.cpp:20:14: warning: unused variable 'j' [-Wunused-variable]
   20 |     ll n, i, j, low, high, mid, a1, a2;
      |              ^
cave.cpp:20:37: warning: unused variable 'a2' [-Wunused-variable]
   20 |     ll n, i, j, low, high, mid, a1, a2;
      |                                     ^~
cave.cpp:95:1: error: expected '}' at end of input
   95 | }
      | ^
cave.cpp:19:25: note: to match this '{'
   19 | void exploreCave(int N) {
      |                         ^