Submission #230939

#TimeUsernameProblemLanguageResultExecution timeMemory
230939jiahngUntitled (GCJ18Q_gogopher)C++14
0 / 30
10061 ms384 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pi; typedef vector <ll> vi; typedef vector <pi> vpi; #define f first #define s second #define FOR(i,s,e) for(ll i=s;i<=ll(e);++i) #define DEC(i,s,e) for(ll i=s;i>=ll(e);--i) #define pb push_back #define all(x) (x).begin(), (x).end() #define lbd(x, y) lower_bound(all(x), y) #define ubd(x, y) upper_bound(all(x), y) #define aFOR(i,x) for (auto i: x) #define mem(x,i) memset(x,i,sizeof x) #define fast ios_base::sync_with_stdio(false),cin.tie(0) int TC; int A,W,H; bool done[1000][1000]; int main(){ fast; cin>>TC; while (TC--){ cin>>A; if (A == 20){ W = 4; H = 5; }else{ W = 40; H = 5; } pi tl = pi(500,500); pi br = pi(500 + W - 1,500 + H - 1); //mem(done,0); FOR(i,tl.f,br.f){ FOR(j,tl.s,br.s){ pi qry = pi(i,j); while (qry.s + 1 > br.s) qry.s--; while (qry.f + 1 > br.f) qry.f--; while (qry.s - 1 < tl.s) qry.s++; while (qry.f - 1 < tl.f) qry.f++; while (!done[i][j]){ //cout<<i<<' '<<j<<'\n'; cout<<qry.f<<' '<<qry.s<<'\n'; cout.flush(); int a,b; cin>>a>>b; done[a][b] = 1; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...