結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
satos___jp
|
| 提出日時 | 2015-11-27 22:46:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,016 bytes |
| コンパイル時間 | 560 ms |
| コンパイル使用メモリ | 62,180 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 80.31 |
| 最終ジャッジ日時 | 2024-07-16 06:37:37 |
| 合計ジャッジ時間 | 3,697 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 13 |
コンパイルメッセージ
main.cpp: In function ‘int qu(char*)’:
main.cpp:30:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
30 | scanf("%d%s",&d,ns);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
int qu(char* s){
printf("%s\n",s);
fflush(stdout);
char ns[100];
int d;
scanf("%d%s",&d,ns);
return d;
}
bool isz(int p){
char s[15]="0000000000";
int p0=qu(s);
s[p]='1';
int p1=qu(s);
if(p0>p1)return true;
else return false;
}
char ans[15]="0000000000";
int main(void){
int md=-1;
int nk=0;
rep(i,10){
if(isz(i))continue;
int mq=qu(ans);
reg(j,1,9){
ans[i]='0'+j;
int nq=qu(ans);
if(nq>mq)break;
}
}
printf("%s\n",ans);
return 0;
}
satos___jp