結果

問題 No.282 おもりと天秤(2)
コンテスト
ユーザー pekempey
提出日時 2015-09-18 23:45:06
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 938 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,016 ms
コンパイル使用メモリ 175,540 KB
実行使用メモリ 28,976 KB
平均クエリ数 44019.50
最終ジャッジ日時 2026-03-30 19:58:22
合計ジャッジ時間 33,611 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define rep(i, a) rep2 (i, 0, a)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a) repr2 (i, 0, a)
#define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define chmin(a, b) ((b) < a && (a = (b), true))
#define chmax(a, b) (a < (b) && (a = (b), true))
#define rng(a) (a).begin(), (a).end()
using namespace std;
typedef long long ll;

int n;
int C[555][555];
int a[555];

int comp(int i, int j) {
	cout << "?";
	cout << " " << a[i] + 1 << " " << a[j] + 1;
	rep (i, n - 1) cout << " 0 0";
	cout << endl;
	char str[2];
	scanf("%s", str);
	int res;
	if (str[0] == '<') res = -1;
	else if (str[1] == '=') res = 0;
	else res = 1;
	rep (i, n - 1) scanf("%s", str);
	return res;
}

int main() {
	cin >> n;
	rep (i, n) a[i] = i;
	rep (i, n) {
		rep2 (j, i, n) {
			if (comp(a[i], a[j]) > 0) {
				swap(a[i], a[j]);
			}
		}
	}
	cout << "!";
	rep (i, n) cout << " " << a[i] << endl;
	return 0;
}
0