結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
odan3240
|
| 提出日時 | 2016-04-02 20:24:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,267 bytes |
| コンパイル時間 | 871 ms |
| コンパイル使用メモリ | 87,700 KB |
| 実行使用メモリ | 25,836 KB |
| 平均クエリ数 | 62.00 |
| 最終ジャッジ日時 | 2024-07-16 09:38:59 |
| 合計ジャッジ時間 | 11,854 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 52 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
using ll = long long;
#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second
const ll INF=1e9;
const ll MOD=1e9+7;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
vector<int> ans;
pair<int,int> query(vector<int> vec) {
rep(i,4) cout<<vec[i]<<" ";
cout<<endl;
pair<int,int> ret;
cin>>ret.first>>ret.second;
return ret;
}
int sum(pair<int,int> p) {
return p.first+p.second;
}
int main() {
ans.resize(4);
rep(i,4) ans[i]=i;
vector<int> vec=ans;
vec.resize(4);
set<int> s;
rep(i,4) {
auto p=query(ans);
rep(j,10) if(!s.count(j)) {
vec[i]=j;
auto t=query(vec);
if(sum(t)>=sum(p)) {
p=t;
ans=vec;
}
}
s.insert(ans[i]);
vec=ans;
}
sort(all(ans));
do {
query(ans);
}while(std::next_permutation(all(ans)));
return 0;
}
odan3240