結果

問題 No.5004 Room Assignment
ユーザー square1001square1001
提出日時 2021-12-01 00:11:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 1,075 bytes
コンパイル時間 692 ms
実行使用メモリ 22,352 KB
スコア 75,613,374
平均クエリ数 7650.00
最終ジャッジ日時 2021-12-01 00:12:07
合計ジャッジ時間 17,847 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
22,128 KB
testcase_01 AC 116 ms
22,080 KB
testcase_02 AC 122 ms
22,140 KB
testcase_03 AC 123 ms
21,912 KB
testcase_04 AC 122 ms
21,960 KB
testcase_05 AC 127 ms
21,900 KB
testcase_06 AC 125 ms
21,780 KB
testcase_07 AC 121 ms
21,780 KB
testcase_08 AC 133 ms
21,792 KB
testcase_09 AC 136 ms
21,812 KB
testcase_10 AC 136 ms
21,764 KB
testcase_11 AC 117 ms
21,960 KB
testcase_12 AC 119 ms
21,900 KB
testcase_13 AC 119 ms
21,768 KB
testcase_14 AC 120 ms
22,152 KB
testcase_15 AC 118 ms
21,776 KB
testcase_16 AC 123 ms
22,116 KB
testcase_17 AC 120 ms
22,092 KB
testcase_18 AC 132 ms
21,924 KB
testcase_19 AC 126 ms
21,876 KB
testcase_20 AC 116 ms
22,028 KB
testcase_21 AC 118 ms
22,152 KB
testcase_22 AC 133 ms
21,780 KB
testcase_23 AC 118 ms
22,092 KB
testcase_24 AC 119 ms
21,780 KB
testcase_25 AC 121 ms
22,140 KB
testcase_26 AC 118 ms
22,092 KB
testcase_27 AC 127 ms
21,924 KB
testcase_28 AC 132 ms
21,936 KB
testcase_29 AC 129 ms
21,780 KB
testcase_30 AC 120 ms
21,912 KB
testcase_31 AC 121 ms
21,948 KB
testcase_32 AC 118 ms
22,092 KB
testcase_33 AC 117 ms
21,936 KB
testcase_34 AC 121 ms
21,780 KB
testcase_35 AC 125 ms
21,924 KB
testcase_36 AC 123 ms
21,924 KB
testcase_37 AC 121 ms
21,900 KB
testcase_38 AC 127 ms
21,900 KB
testcase_39 AC 137 ms
21,948 KB
testcase_40 AC 122 ms
21,912 KB
testcase_41 AC 122 ms
21,708 KB
testcase_42 AC 120 ms
21,948 KB
testcase_43 AC 118 ms
22,128 KB
testcase_44 AC 123 ms
21,936 KB
testcase_45 AC 123 ms
22,140 KB
testcase_46 AC 126 ms
22,020 KB
testcase_47 AC 118 ms
22,128 KB
testcase_48 AC 119 ms
21,912 KB
testcase_49 AC 120 ms
21,948 KB
testcase_50 AC 119 ms
22,140 KB
testcase_51 AC 116 ms
21,936 KB
testcase_52 AC 121 ms
21,924 KB
testcase_53 AC 137 ms
22,140 KB
testcase_54 AC 123 ms
22,152 KB
testcase_55 AC 121 ms
21,948 KB
testcase_56 AC 131 ms
21,924 KB
testcase_57 AC 123 ms
21,936 KB
testcase_58 AC 120 ms
21,972 KB
testcase_59 AC 134 ms
22,020 KB
testcase_60 AC 128 ms
21,960 KB
testcase_61 AC 120 ms
21,792 KB
testcase_62 AC 125 ms
22,128 KB
testcase_63 AC 121 ms
22,352 KB
testcase_64 AC 121 ms
21,936 KB
testcase_65 AC 137 ms
21,828 KB
testcase_66 AC 121 ms
21,900 KB
testcase_67 AC 122 ms
22,128 KB
testcase_68 AC 119 ms
22,140 KB
testcase_69 AC 122 ms
22,140 KB
testcase_70 AC 119 ms
22,032 KB
testcase_71 AC 127 ms
21,780 KB
testcase_72 AC 134 ms
21,984 KB
testcase_73 AC 120 ms
22,128 KB
testcase_74 AC 123 ms
22,128 KB
testcase_75 AC 133 ms
21,816 KB
testcase_76 AC 116 ms
21,888 KB
testcase_77 AC 117 ms
21,948 KB
testcase_78 AC 118 ms
21,948 KB
testcase_79 AC 120 ms
21,972 KB
testcase_80 AC 118 ms
21,780 KB
testcase_81 AC 119 ms
21,768 KB
testcase_82 AC 121 ms
21,972 KB
testcase_83 AC 115 ms
21,948 KB
testcase_84 AC 118 ms
22,032 KB
testcase_85 AC 134 ms
22,140 KB
testcase_86 AC 123 ms
21,924 KB
testcase_87 AC 118 ms
22,128 KB
testcase_88 AC 120 ms
21,924 KB
testcase_89 AC 121 ms
22,212 KB
testcase_90 AC 117 ms
21,936 KB
testcase_91 AC 115 ms
21,912 KB
testcase_92 AC 120 ms
21,948 KB
testcase_93 AC 121 ms
21,924 KB
testcase_94 AC 120 ms
21,936 KB
testcase_95 AC 123 ms
22,212 KB
testcase_96 AC 138 ms
21,972 KB
testcase_97 AC 138 ms
21,792 KB
testcase_98 AC 118 ms
21,924 KB
testcase_99 AC 115 ms
21,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// NOT YET DEBUGGED

#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int T; // T = 3600
	int R; // R = 4
	cin >> T >> R;
	vector<int> P, S;
	vector<int> rem;
	for (int iteration = 0; iteration < T; ++iteration) {
		int subn;
		cin >> subn;
		for (int j = 0; j < subn; ++j) {
			int x;
			cin >> x;
			P.push_back(iteration);
			S.push_back(x);
			rem.push_back(int(P.size()) - 1);
		}
		if ((iteration + 1) % 100 == 0) {
			sort(rem.begin(), rem.end(), [&](int j, int k) { return S[j] < S[k]; });
			vector<int> qu, qv;
			while (int(rem.size()) >= 4) {
				int v1 = rem.back(); rem.pop_back();
				int v2 = rem.back(); rem.pop_back();
				int v3 = rem.back(); rem.pop_back();
				int v4 = rem.back(); rem.pop_back();
				qu.push_back(v1); qv.push_back(v2);
				qu.push_back(v1); qv.push_back(v3);
				qu.push_back(v1); qv.push_back(v4);
			}
			cout << qu.size() << endl;
			for (int i = 0; i < int(qu.size()); ++i) {
				cout << qu[i] + 1 << ' ' << qv[i] + 1 << endl;
			}
		}
		else {
			cout << 0 << endl;
		}
	}
	return 0;
}
0