結果

問題 No.282 おもりと天秤(2)
ユーザー btk
提出日時 2015-09-18 23:38:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,189 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 90,364 KB
実行使用メモリ 25,604 KB
平均クエリ数 3069.71
最終ジャッジ日時 2024-07-16 05:58:55
合計ジャッジ時間 15,550 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 4 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
using namespace std;


#define input_init stringstream ss; string strtoken, token; istringstream is
#define input_line  getline(cin, strtoken);is.str(strtoken);is.clear(istringstream::goodbit)
#define input_token(num) ss.str(""); ss.clear(stringstream::goodbit); getline(is, token, ','); ss << token; ss >> num

pair<int,int> cnt[500];
int main(void){
	int N;
	cin >> N;
	for (int i = 0; i <N; i++){
		cnt[i].first = 0; cnt[i].second = i+1;
		for (int j = 0; j < N; j++){
			if (i != j){
				cout << "? " << i + 1 << " " << j + 1;
				for (int k = 0; k < N - 1; k++)
					cout << " 0 0";
				cout << endl << flush;

				string s;
				cin >> s;
				if (s == ">")cnt[i].first++;
				for (int k = 0; k < N - 1; k++)cin >> s;
			}
		}
	}
	sort(cnt, cnt + N);
	cout << "!";
	for (int i = 0; i < N; i++){
		cout << " " << cnt[i].second;
	}
	cout << endl << flush << endl;
	return(0);
}
0