結果

問題 No.305 鍵(2)
ユーザー horoyoisawahoroyoisawa
提出日時 2022-02-01 11:09:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 1,412 ms
コンパイル使用メモリ 165,540 KB
実行使用メモリ 24,060 KB
平均クエリ数 1.54
最終ジャッジ日時 2023-09-02 02:29:18
合計ジャッジ時間 5,930 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int match = 0;
    string lock = "locked";
    string s;

    for(int i=0;i<=10;i++) {
        if(i != 0) cin >> match >> lock;
        if(match == 10) break;
        else {
            string ss(match, '0' + i - 1);
            s += ss;
        }
        if(i != 10) {
            string t(10, '0' + i);
            cout << t << endl;
        }
    }

    if(lock == "unlocked") return 0;

    do {
        cout << s << endl;
        cin >> match >> lock;
    } while(next_permutation(s.begin(), s.end()) || lock == "locked");

    return 0;
}
0