結果

問題 No.305 鍵(2)
ユーザー napppolinapppoli
提出日時 2015-11-27 23:55:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 68,876 KB
実行使用メモリ 36,040 KB
平均クエリ数 4.92
最終ジャッジ日時 2023-09-23 06:50:39
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<math.h>

using namespace std;

int main(){
 int k,i,j,X,X0;
string s;
i=0;
j=0;
k=0;
X0=0;
cout << setfill('0') << setw(10) << k<<endl;
cin>>X>>s;
if(s=="locked"){
X0=X;
i++;
k=k+i*pow(10,j);
while(1){
if(j>10)break;
cout << setfill('0') << setw(10) << k<<endl;
cin>>X>>s;
if(s=="unlocked")break;
else if(X==X0){
i++;
k=k+i*pow(10,j);
}
else if(X>X0){
i=1;
j++;
k=k+i*pow(10,j);
X0=X;
}
else if(X<X0){
i=1;
j++;
k=k+i*pow(10,j)-pow(10,(j-1));
}
}
}
  return 0;
}
0