結果

問題 No.1149 色塗りゲーム
ユーザー rogi52
提出日時 2022-10-02 22:52:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 1,785 ms
コンパイル使用メモリ 193,932 KB
最終ジャッジ日時 2025-02-07 20:43:12
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    int N; cin >> N;
    if(N % 2 == 0) {
        cout << 2 << " " << N / 2 << endl;
    } else {
        cout << 1 << " " << (N + 1) / 2 << endl;
    }
    cout.flush();

    while(true) {
        int t; cin >> t;
        if(t == 0 || t == 1) return 0;
        int k,x; cin >> k >> x;
        if(t == 2) return 0;
        assert(t == 3);
        if(k == 2) x++;
        x = N + 1 - x;
        cout << k << " " << x << endl; cout.flush();
    }
}
0