結果
| 問題 | No.355 数当てゲーム(2) | 
| コンテスト | |
| ユーザー |  koyumeishi | 
| 提出日時 | 2016-04-01 22:42:40 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 25 ms / 2,000 ms | 
| コード長 | 1,398 bytes | 
| コンパイル時間 | 934 ms | 
| コンパイル使用メモリ | 100,464 KB | 
| 実行使用メモリ | 25,580 KB | 
| 平均クエリ数 | 60.25 | 
| 最終ジャッジ日時 | 2024-07-16 23:10:02 | 
| 合計ジャッジ時間 | 4,700 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 52 | 
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
#include <chrono>
using namespace std;
template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& val: vec) is >> val; return is;}
template<class T> istream& operator ,  (istream& is, T& val){ return is >> val;}
template<class T> ostream& operator << (ostream& os, const vector<T>& vec){for(int i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"":" "); return os;}
template<class T> ostream& operator ,  (ostream& os, const T& val){ return os << " " << val;}
template<class T> ostream& operator >> (ostream& os, const T& val){ return os << " " << val;}
int main(){
	vector<int> n = {0,1,2,3};
	set<int> s;
	
	for(int i=0; i<10; i++){
		n = {i, (i+1)%10, (i+2)%10, (i+3)%10};
		int a,b;
		cout << n << endl;
		cin >> a,b;
		if(a==4 && b==0) return 0;
		for(int k=4; k<10; k++){
			n[0] = (i+k)%10;
			int c,d;
			cout << n << endl;
			cin >> c,d;
			if(c==4 && d==0) return 0;
			if(a+b > c+d){
				s.insert(i);
				break;
			}
		}
	}
	n = vector<int>(s.begin(), s.end());
	do{
		cout << n << endl;
		int a,b;
		cin >> a >> b;
		if(a==4 && b==0){
			return 0;
		}
	}while(next_permutation(n.begin(), n.end()));
	abort();
	return 0;
	
}
            
            
            
        