Submission #232042

#TimeUsernameProblemLanguageResultExecution timeMemory
232042Blerargh무제 (GCJ18Q_gogopher)C++17
30 / 30
111 ms256 KiB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
#define mp make_pair

int main(){
    int tc;
    cin >> tc;
    int gridx[6] = {2, 5, 8, 11, 14, 17};
    int gridy[4] = {2, 5, 8, 11};
    while (tc--){
        int a;
        cin >> a;
        bool found=0;
        for (int i=0; i<6; i++){
            for(int j=0; j<4; j++){
                set<ii> s;
                while (s.size() != 9){
                    cout << gridx[i] << " " << gridy[j] << '\n';
                    cout.flush();
                    
                    int x, y;
                    cin >> x >> y;
                    if (x==0 && y==0){
                        found=1;
                        break;
                    } else s.insert(mp(x,y));
                }
                if (found) break;
            }
            if (found) break;
        }
        if (found) continue;
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...