結果

問題 No.305 鍵(2)
ユーザー horoyoisawa
提出日時 2022-02-01 11:09:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 1,696 ms
コンパイル使用メモリ 168,072 KB
実行使用メモリ 25,220 KB
平均クエリ数 1.54
最終ジャッジ日時 2024-06-11 09:08:30
合計ジャッジ時間 5,172 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

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