結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-11-27 22:43:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,011 bytes |
| コンパイル時間 | 1,320 ms |
| コンパイル使用メモリ | 157,716 KB |
| 実行使用メモリ | 24,964 KB |
| 平均クエリ数 | 7.08 |
| 最終ジャッジ日時 | 2024-07-16 21:47:13 |
| 合計ジャッジ時間 | 4,748 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:32:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
32 | scanf("%d%s",&a,s);
| ~~~~~^~~~~~~~~~~~~
main.cpp:44:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
44 | scanf("%d%s",&base,s);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
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;}
char s[100];
signed main(){
int base;
int ans[10];
rep(i,10){
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){
ma=j;
v=a;
}
}
ans[i]=ma;
}
for(int i=0;i<10;i++)printf("%d",ans[i]);
puts("");
scanf("%d%s",&base,s);
return 0;
}
latte0119