結果
問題 |
No.624 Santa Claus and The Last Dungeon
|
ユーザー |
![]() |
提出日時 | 2017-12-24 00:32:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,403 bytes |
コンパイル時間 | 1,649 ms |
コンパイル使用メモリ | 162,024 KB |
実行使用メモリ | 25,592 KB |
平均クエリ数 | 1176.11 |
最終ジャッジ日時 | 2024-07-16 15:06:27 |
合計ジャッジ時間 | 10,558 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 24 |
コンパイルメッセージ
main.cpp: In function ‘void query()’: main.cpp:40:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 40 | scanf("%d%d%d",&p0,&p1,&p2); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() #define CHMIN(a,b) a=min((a),(b)) #define CHMAX(a,b) a=max((a),(b)) // mod const ll MOD = 1000000007ll; #define FIX(a) ((a)%MOD+MOD)%MOD // floating typedef double Real; const Real EPS = 1e-11; #define EQ0(x) (abs(x)<EPS) #define EQ(a,b) (abs(a-b)<EPS) typedef complex<Real> P; char s[325]; int p0, p1, p2; int qcnt; void query(){ puts(s); fflush(stdout); scanf("%d%d%d",&p0,&p1,&p2); qcnt++; } void clear(){ REP(i,100){ s[3*i] = '?'; s[3*i+1] = '?'; s[3*i+2] = ' '; } s[299] = '\0'; } void setval(int p, int u, int d){ s[3*p] = u==-1 ? '?' : u+'0'; s[3*p+1] = d==-1 ? '?' : d+'0'; } int ans[125]; void solve(){ REP(i,20){ int base = 5*i; vi dcnt(10, 0); REP(j,9){ clear(); REP(k,5)setval(base+k, -1, j); query(); dcnt[j] = p1; } dcnt[9] = 5 - accumulate(ALL(dcnt), 0); REP(j,10)if(dcnt[j]>0){ REP(m,1<<5)if(__builtin_popcount(m)==dcnt[j]){ clear(); REP(k,5)if((m>>k)&1)setval(base+k, -1, j); query(); if(p1==dcnt[j]){ REP(k,5)if((m>>k)&1)ans[base+k] += j; } } } vi ucnt(10, 0); REP(j,9){ clear(); REP(k,5)setval(base+k, j, -1); query(); ucnt[j] = p1; } ucnt[9] = 5 - accumulate(ALL(ucnt), 0); REP(j,10)if(ucnt[j]>0){ REP(m,1<<5)if(__builtin_popcount(m)==ucnt[j]){ clear(); REP(k,5)if((m>>k)&1)setval(base+k, j, -1); query(); if(p1==ucnt[j]){ REP(k,5)if((m>>k)&1)ans[base+k] += j*10; } } } // printf("! "); // REP(k,5)printf("%02d ", ans[base+k]); // puts(""); // fflush(stdout); } // printf("! "); REP(i,100)printf("%02d%c",ans[i],i==99?'\n':' '); // printf("! %d\n", qcnt); fflush(stdout); return; } int main(){ int q; cin>>q; solve(); return 0; }