結果

問題 No.1149 色塗りゲーム
ユーザー rabimea
提出日時 2025-09-29 14:25:13
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 3,080 ms
コンパイル使用メモリ 275,184 KB
実行使用メモリ 26,240 KB
平均クエリ数 19.82
最終ジャッジ日時 2025-09-29 14:25:27
合計ジャッジ時間 12,776 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target ("avx,avx2,fma")
#include <bits/stdc++.h>

using std::cin, std::cout, std::cerr;
using ll = long long;

int Paint(int k, int x) {
    cout << k << ' ' << x << '\n';
    cout.flush();
    int t; cin >> t;
    return t;
}

int main() {
    std::ios::sync_with_stdio(false);
    int n; cin >> n;
    int t = Paint(n % 2 == 1 ? 1 : 2, (n + 1) / 2);
    while(t != 0) {
        int k, x; cin >> k >> x;
        int rx = n - x + 1;
        if(k == 2) rx --;
        t = Paint(k, rx);
    }
}
0