結果

問題 No.282 おもりと天秤(2)
ユーザー btkbtk
提出日時 2015-09-18 23:35:21
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,178 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 89,756 KB
実行使用メモリ 35,992 KB
最終ジャッジ日時 2023-09-23 21:32:14
合計ジャッジ時間 13,720 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
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 i = 0; i < N - 1; i++)
					cout << " 0 0";
				cout << endl<<flush;
			}
			string s;
			cin >> s;
			if (s == ">")cnt[i].first++;
			for (int i = 0; i < N - 1; i++)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