Submission #897909

#TimeUsernameProblemLanguageResultExecution timeMemory
897909Sir_Ahmed_ImranCave (IOI13_cave)C++17
21 / 100
472 ms600 KiB
///~~~LOTA~~~/// #include "cave.h" #include <bits/stdc++.h> using namespace std; #define nl '\n' #define ff first #define ss second #define ll long long #define append push_back #define pii pair<int,int> #define all(x) (x).begin(),(x).end() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int ran(){ ll o=rng(); o%=2; o=(o+2)%2; return o; } void exploreCave(int n){ int m,o,p,q,r,s[n],t[n],d[n]; for(int i=0;i<n;i++) s[i]=d[i]=-1; m=0; while(m<n){ for(int j=0;j<1028;j++){ for(int i=0;i<n;i++) if(d[i]<0) s[i]=ran(); o=tryCombination(s); if(o>=m){ m=o; for(int i=0;i<n;i++) t[i]=s[i]; } if(o==-1){ m=n; for(int i=0;i<n;i++) t[i]=s[i]; } } for(int i=0;i<n;i++){ if(d[i]>=0) continue; s[i]=t[i]; t[i]^=1; o=tryCombination(t); if(o==-1) o=n; if(o<m) d[i]=o; t[i]^=1; } } answer(t,d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:20:13: warning: unused variable 'p' [-Wunused-variable]
   20 |     int m,o,p,q,r,s[n],t[n],d[n];
      |             ^
cave.cpp:20:15: warning: unused variable 'q' [-Wunused-variable]
   20 |     int m,o,p,q,r,s[n],t[n],d[n];
      |               ^
cave.cpp:20:17: warning: unused variable 'r' [-Wunused-variable]
   20 |     int m,o,p,q,r,s[n],t[n],d[n];
      |                 ^
#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...