結果

問題 No.305 鍵(2)
ユーザー dnishdnish
提出日時 2018-06-16 09:09:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 834 bytes
コンパイル時間 1,263 ms
コンパイル使用メモリ 165,140 KB
実行使用メモリ 24,348 KB
平均クエリ数 44.08
最終ジャッジ日時 2023-09-24 01:48:37
合計ジャッジ時間 2,520 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,364 KB
testcase_01 AC 22 ms
24,060 KB
testcase_02 AC 24 ms
23,532 KB
testcase_03 AC 21 ms
24,348 KB
testcase_04 AC 21 ms
24,048 KB
testcase_05 AC 23 ms
23,400 KB
testcase_06 AC 20 ms
23,460 KB
testcase_07 AC 22 ms
23,664 KB
testcase_08 AC 22 ms
24,192 KB
testcase_09 AC 24 ms
23,868 KB
testcase_10 AC 21 ms
24,060 KB
testcase_11 AC 22 ms
23,388 KB
testcase_12 AC 22 ms
24,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i,n,N) for(int i=(n); i<(N); i++)
#define RREP(i,n,N) for(int i=(N-1); i>=n; i--)
#define CK(n,a,b) (a)<=(n)&&(n)<(b)
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
typedef long long ll;
using namespace std;
const ll mod =1e9+7;


int main(){
    string s="0000000000";
    cout<<"0000000000"<<endl;

    int now,idx=0,prev;
    string ok;
    cin>>now>>ok;
    if(ok=="unlocked") return 0;
    s[idx]++;
    cout<<s<<endl;
    prev=now;
    while(cin>>now>>ok){
        if(ok=="unlocked") break;
        if(prev==now) s[idx]++;
        else if(prev>now){
            s[idx]--;
            idx++;
            s[idx]++;
            now++;
        }
        else {
            idx++;
            s[idx]++;
        }
        prev = now;
        cout<<s<<endl;
    }
    return 0;
}
0