結果

問題 No.282 おもりと天秤(2)
ユーザー 唐澤貴洋唐澤貴洋
提出日時 2015-10-13 22:50:04
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2,582 ms / 5,000 ms
コード長 932 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 73,180 KB
実行使用メモリ 24,348 KB
平均クエリ数 211.21
最終ジャッジ日時 2023-09-23 21:51:05
合計ジャッジ時間 18,780 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,640 KB
testcase_01 AC 28 ms
23,568 KB
testcase_02 AC 26 ms
23,556 KB
testcase_03 AC 25 ms
23,652 KB
testcase_04 AC 26 ms
23,640 KB
testcase_05 AC 27 ms
24,348 KB
testcase_06 AC 28 ms
23,400 KB
testcase_07 AC 25 ms
23,628 KB
testcase_08 AC 28 ms
24,000 KB
testcase_09 AC 25 ms
23,568 KB
testcase_10 AC 437 ms
24,036 KB
testcase_11 AC 1,465 ms
23,412 KB
testcase_12 AC 452 ms
24,012 KB
testcase_13 AC 713 ms
23,568 KB
testcase_14 AC 1,276 ms
24,024 KB
testcase_15 AC 2,582 ms
24,036 KB
testcase_16 AC 193 ms
23,448 KB
testcase_17 AC 1,096 ms
24,024 KB
testcase_18 AC 1,158 ms
23,856 KB
testcase_19 AC 1,174 ms
24,276 KB
testcase_20 AC 1,700 ms
23,856 KB
testcase_21 AC 1,682 ms
24,012 KB
testcase_22 AC 1,891 ms
24,036 KB
testcase_23 AC 24 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<bitset>
#include<array>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<numeric>
#define D long long
#define U unsigned
using namespace std;
D n, m,a, b, d, e, x, y, z;
D i, j, k;
char c,f;
string s;
bool f1;
D p[500];
int main() {
	cin >> a;
	iota(p, p + a, 1);
	f = 0;
	for (i = 0; i < a * 2;i++){
		s = "";
		s +="?";
		for (j = f, k = 0; j < a - 1; j += 2,k+=2) {
			s += " " + to_string(p[j]) +" " + to_string(p[j + 1]);
		}
		for (; k < a * 2; k++) {
			s+= " 0";
		}
		cout << s << endl;
		f1 = false;
		for (j = f,k=0; j < a-1; j+=2,k++) {
			cin >> c;
			if (c == '>') {
				swap(p[j], p[j + 1]);
				f1 = true;
			}
		}
		for (; k < a; k++)
			cin >> c;
		if (!f1)
			break;
		f ^= 1;
	}
	cout << "!";
	for (i = 0; i < a; i++) {
		cout <<" "<< p[i];
	}
	cout << endl;
}
0