結果

問題 No.305 鍵(2)
ユーザー latte0119latte0119
提出日時 2015-11-27 23:22:38
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 1,073 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 44,968 KB
実行使用メモリ 24,372 KB
平均クエリ数 92.62
最終ジャッジ日時 2023-09-23 22:04:32
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
23,640 KB
testcase_01 AC 26 ms
23,616 KB
testcase_02 AC 26 ms
23,460 KB
testcase_03 AC 26 ms
23,400 KB
testcase_04 AC 27 ms
23,376 KB
testcase_05 AC 26 ms
23,976 KB
testcase_06 AC 23 ms
24,372 KB
testcase_07 AC 27 ms
24,324 KB
testcase_08 AC 26 ms
24,012 KB
testcase_09 AC 26 ms
23,688 KB
testcase_10 AC 26 ms
24,360 KB
testcase_11 AC 26 ms
24,108 KB
testcase_12 AC 26 ms
24,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;

//#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

int main(){
    int ans[10];
    char s[100];

    for(int i=0;i<10;i++){
        int ma=0,v=-1;
        for(int j=0;j<10;j++){
            for(int k=0;k<i;k++)printf("0");
            printf("%d",j);
            for(int k=i+1;k<10;k++)printf("0");
            puts("");
            fflush(stdout);

            int a;
            scanf("%d%s",&a,s);
            if(s[0]=='u')return 0;
            if(v<a){
                v=a;
                ma=j;
            }
        }
        ans[i]=ma;
    }

    for(int i=0;i<10;i++)printf("%d",ans[i]);
    puts("");fflush(stdout);

    scanf("%d%s",&ans[0],s);
    return 0;
}
0