Submission #232042

# Submission time Handle Problem Language Result Execution time Memory
232042 2020-05-15T19:15:42 Z Blerargh Go, Gopher! (GCJ18Q_gogopher) C++17
30 / 30
111 ms 256 KB
#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 time Memory Grader output
1 Correct 19 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 111 ms 256 KB Output is correct