제출 #386232

#제출 시각아이디문제언어결과실행 시간메모리
386232ismoilov동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define all(x) (x).begin(), (x).end() #define rall(x) (x).begin(), (x).end() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fv(c) for(int (a) = (1); (a) <= (c); (a)++) #define fz(c) for(int (a) = (0); (a) < (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) #define pb push_back #define in insert #define ss second #define ff first void exploreCave(int n) { vector <int> v(n, 0); vector <int> a(n, -1); int x = 0; fp(i,0,n){ fp(j,0,n) if(a[j] == -1) v[j] = x; int y = tryCombination(v); if(y == i) x = (x+1)%2; y = i; int g; while(y == i) { fp(j,0,n) if(a[j] == -1 || a[j] == n) v[j] = (x+1)%2; fp(j,0,n){ if(a[j] == -1){ v[j] = x, g = j; break; } } y = tryCombination(v); if(y == i) a[g] = n; } fp(j,0,n) if(a[j] == n) a[j] = -1; a[g] = i; } answer(v, a); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:10:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   10 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
cave.cpp:25:2: note: in expansion of macro 'fp'
   25 |  fp(i,0,n){
      |  ^~
cave.cpp:10:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   10 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
cave.cpp:26:3: note: in expansion of macro 'fp'
   26 |   fp(j,0,n)
      |   ^~
cave.cpp:29:26: error: cannot convert 'std::vector<int>' to 'int*'
   29 |   int y = tryCombination(v);
      |                          ^
      |                          |
      |                          std::vector<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:10:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   10 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
cave.cpp:36:4: note: in expansion of macro 'fp'
   36 |    fp(j,0,n)
      |    ^~
cave.cpp:10:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   10 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
cave.cpp:39:4: note: in expansion of macro 'fp'
   39 |    fp(j,0,n){
      |    ^~
cave.cpp:45:23: error: cannot convert 'std::vector<int>' to 'int*'
   45 |    y = tryCombination(v);
      |                       ^
      |                       |
      |                       std::vector<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:10:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   10 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
cave.cpp:49:3: note: in expansion of macro 'fp'
   49 |   fp(j,0,n)
      |   ^~
cave.cpp:54:9: error: cannot convert 'std::vector<int>' to 'int*'
   54 |  answer(v, a);
      |         ^
      |         |
      |         std::vector<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[]);
      |             ~~~~^~~