Submission #386233

#TimeUsernameProblemLanguageResultExecution timeMemory
386233ismoilovCave (IOI13_cave)C++14
33 / 100
718 ms620 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) { int v[n], a[n]; fp(i,0,n) a[i] = -1, v[i] = 0; 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); }

Compilation message (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:23:2: note: in expansion of macro 'fp'
   23 |  fp(i,0,n)
      |  ^~
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:26:2: note: in expansion of macro 'fp'
   26 |  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:27:3: note: in expansion of macro 'fp'
   27 |   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:37:4: note: in expansion of macro 'fp'
   37 |    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:40:4: note: in expansion of macro 'fp'
   40 |    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:50:3: note: in expansion of macro 'fp'
   50 |   fp(j,0,n)
      |   ^~
cave.cpp:53:8: warning: 'g' may be used uninitialized in this function [-Wmaybe-uninitialized]
   53 |   a[g] = i;
      |   ~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...