結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
かに
|
| 提出日時 | 2017-04-01 22:54:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,219 bytes |
| コンパイル時間 | 1,587 ms |
| コンパイル使用メモリ | 171,816 KB |
| 実行使用メモリ | 25,692 KB |
| 平均クエリ数 | 8.87 |
| 最終ジャッジ日時 | 2024-07-16 12:48:26 |
| 合計ジャッジ時間 | 19,168 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 22 RE * 29 |
ソースコード
#include "bits/stdc++.h"
#define _CRT_SECURE_NO_WARNINGS
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define vi vector<int>
#define mp(a,b) make_pair(a,b)
using namespace std;typedef long long ll;typedef unsigned long long ull;int dx[] = { 1, -1 , 0 , 0};int dy[] = { 0, 0, 1, -1};
void solve() {
int a,x,y,first,last;
vi v,no;
cout << 0 << " " << 1 << " " << 2 << " " << 3 << endl;
cin >> x >> y;
first = x + y;
if(x + y != 4){
REP(i,4,10){
cout << 0 << " " << 1 << " " << 2 << " " << i << endl;
cin >> x >> y;
if(x + y >= first)v.push_back(i);
else{
no.push_back(i);
if(no.size() == 2)break;
}
}
}
if(v.size() != 4){
rep(i,4){
rep(j,v.size()){
cout << v[j] << " ";
}
rep(j,3-v.size()){
cout << no[j] << " ";
}
cout << i << endl;
cin >> x >> y;
if(x + y > v.size())v.push_back(i);
}
}
do{
printf("%d %d %d %d\n",v[0],v[1],v[2],v[3]);
cin >> x >> y;
if(x == 4)return;
}while(next_permutation(v.begin(),v.end()));
}
int main() {
solve();
return 0;
}
かに