結果

問題 No.355 数当てゲーム(2)
ユーザー izryt(趣味)
提出日時 2016-04-02 00:10:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 58,404 KB
実行使用メモリ 25,628 KB
平均クエリ数 137.31
最終ジャッジ日時 2024-07-16 09:31:23
合計ジャッジ時間 11,520 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;

#define rep(i,x) for(i=0;i<(x);++i)

int n[4];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    rep(n[0], 10) {
        rep(n[1], n[0]) {
            rep(n[2], n[1]) {
                rep(n[3], n[2]) {
                    cout << n[0] << ' ' << n[1] << ' ' << n[2] << ' ' << n[3] << endl;
                    int x, y; cin >> x >> y;
                    if (x + y == 4) goto end1;
                }
            }
        }
    }

end1:;

    do {
        cout << n[0] << ' ' << n[1] << ' ' << n[2] << ' ' << n[3] << endl;
        int x, y; cin >> x >> y;
        if (x == 4) break;
    } while (next_permutation(n, n + 4));
}
0