結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
napppoli
|
| 提出日時 | 2015-11-27 23:55:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 542 bytes |
| コンパイル時間 | 677 ms |
| コンパイル使用メモリ | 70,876 KB |
| 実行使用メモリ | 39,628 KB |
| 平均クエリ数 | 4.92 |
| 最終ジャッジ日時 | 2024-07-16 06:44:32 |
| 合計ジャッジ時間 | 4,419 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 1 TLE * 1 -- * 10 |
ソースコード
#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;
}
napppoli