結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
rickytheta
|
| 提出日時 | 2016-04-01 22:38:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,272 bytes |
| コンパイル時間 | 1,507 ms |
| コンパイル使用メモリ | 166,148 KB |
| 実行使用メモリ | 25,616 KB |
| 平均クエリ数 | 23.21 |
| 最終ジャッジ日時 | 2024-07-16 08:53:32 |
| 合計ジャッジ時間 | 16,239 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 27 RE * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:83:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
83 | printf("%d %d %d %d",a,b,c,i);
| ~^ ~
| | |
| int ll {aka long long int}
| %lld
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++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 MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD
int main(){
int id[11];
int mn = 100, mx = 0;
int sum = 0;
FOR(i,3,10){
cout<<"0 1 2 "<<i<<endl;
int x,y;
cin>>x>>y;
if(x==4&&y==0)return 0;
id[i] = x+y;
mn = min(mn,x+y);
mx = max(mx,x+y);
sum += x+y;
}
int other = sum - mn*7; // 3~9の中に何個あるか
DEBUG(other);
vi cand;
if(other==1){
int yey = 0;
FOR(i,3,10){
if(id[i]==mn+1){
yey = i;
break;
}
}
cand.push_back(0);
cand.push_back(1);
cand.push_back(2);
cand.push_back(yey);
}else if(other==2){
int a=0,b=0;
FOR(i,3,10){
if(id[i]==mn+1){
if(!a)a=i;
else b=i;
}
}
vi t(3);
REP(i,3)t[i]=i;
do{
printf("%d %d %d %d",a,b,t[0],t[1]);
cout<<endl;
int x,y;
cin>>x>>y;
if(x==4&&y==0)return 0;
if(x+y==4)break;
}while(next_permutation(ALL(t)));
cand.push_back(t[0]);
cand.push_back(t[1]);
cand.push_back(a);
cand.push_back(b);
}else if(other==3){
int a=0,b=0,c=0;
FOR(i,3,10){
if(id[i]==mn+1){
if(!a)a=i;
else if(!b)b=i;
else c=i;
}
}
REP(i,3){
printf("%d %d %d %d",a,b,c,i);
cout<<endl;
int x,y;
cin>>x>>y;
if(x==4&&y==0)return 0;
if(x+y==4){
cand.push_back(a);
cand.push_back(b);
cand.push_back(c);
cand.push_back(i);
break;
}
}
}else if(other==4){
FOR(i,3,10){
if(id[i]==mn+1)cand.push_back(i);
}
}
sort(ALL(cand));
do{
printf("%d %d %d %d",cand[0],cand[1],cand[2],cand[3]);
cout<<endl;
int x,y;
cin>>x>>y;
if(x==4&&y==0)return 0;
}while(next_permutation(ALL(cand)));
return 0;
}
rickytheta