結果

問題 No.282 おもりと天秤(2)
ユーザー btkbtk
提出日時 2015-09-18 23:38:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,189 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 89,500 KB
実行使用メモリ 24,288 KB
平均クエリ数 3069.71
最終ジャッジ日時 2023-09-23 06:02:40
合計ジャッジ時間 16,371 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,904 KB
testcase_01 WA -
testcase_02 AC 182 ms
23,364 KB
testcase_03 AC 95 ms
23,604 KB
testcase_04 AC 57 ms
23,652 KB
testcase_05 AC 386 ms
24,120 KB
testcase_06 WA -
testcase_07 AC 58 ms
23,748 KB
testcase_08 WA -
testcase_09 AC 27 ms
23,628 KB
testcase_10 WA -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

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