Submission #1129482

#TimeUsernameProblemLanguageResultExecution timeMemory
1129482AgageldiWorm Worries (BOI18_worm)C++17
0 / 100
3 ms1044 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 400005 #define ff first #define ss second #define pb push_back #define sz(s) (int)s.size() int n, p, k, answer, q, a[2][300][300], x1, x2, x3; vector <tuple<int,int,int>> v; string s, g, h; int b[] = {1,-1,0,0,0,0,0}; int c[] = {0,0,1,-1,0,0,0}; int d[] = {0,0,0,0,1,-1,0}; int main () { ios::sync_with_stdio(0);cin.tie(0); cin >> n >> p >> k >> q; x1 = x2 = x3 = 1; for(int i = 1;i<=n;i++) { for(int j = 1;j<=p;j++) { for(int l = 1; l <= k; l++) { for(int m = 0; m < 7; m++) { if(i + b[m] == 0 || j + c[m] == 0 || l + d[m] == 0) continue; if(i + b[m] > n || j + c[m] > p || l + d[m] > k) continue; if(!a[b[m] + i][j + c[m]][l + d[m]]) { cout <<"? " <<b[m] + i<< " " << j+c[m] << " " << l + d[m] << endl; int x; cin >> x; a[b[m] + i][j + c[m]][l + d[m]] = x; } } int mx = 0, ans = a[i][j][l]; for(int m = 0; m < 6; m++) { if(i + b[m] == 0 || j + c[m] == 0 || l + d[m] == 0) continue; if(i + b[m] > n || j + c[m] > p || l + d[m] > k) continue; mx = max(mx,a[b[m] + i][j + c[m]][l + d[m]]); } if(ans >= mx && answer > ans) { x1 = i; x2 = j; x3 = l; answer = mx; } } } } cout << "! " << x1 << " "<< x2 << " " << x3 << endl; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...