Submission #521341

#TimeUsernameProblemLanguageResultExecution timeMemory
521341Yazan_AlattarWorm Worries (BOI18_worm)C++14
0 / 100
741 ms840 KiB
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <algorithm> #include <set> #include <map> #include <queue> #include <list> #include <utility> #include <cmath> #include <numeric> #include <assert.h> using namespace std; typedef long long ll; #define F first #define S second #define pb push_back //#define endl "\n" #define all(x) x.begin(), x.end() const int M = 207; const ll inf = 1e18; const ll mod = 1e9 + 7; const double pi = acos(-1); const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; int n, m, k, q, a[M][M], tot; int ask(int i, int j, int l) { if(i == 0 || j == 0 || l == 0 || i > n || j > m || l > k) return 0; cout << "? " << i << " " << j << " " << l << endl; int ret; cin >> ret; assert(ret != -1); ++tot; return ret; } int main() { cout.flush(); cin >> n >> m >> k >> q; for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) a[i][j] = ask(i, j, 1); assert(tot <= q); for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) if(a[i][j] >= a[i + 1][j] && a[i][j] >= a[i - 1][j] && a[i][j] >= a[i][j + 1] && a[i][j] >= a[i][j - 1]){ cout << "! " << i << " " << j << " " << 1 << endl; return 0; } return 0; }
#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...