結果
問題 | No.5004 Room Assignment |
ユーザー | 👑 Nachia |
提出日時 | 2021-12-01 00:38:44 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 137 ms / 5,000 ms |
コード長 | 1,892 bytes |
コンパイル時間 | 617 ms |
実行使用メモリ | 22,380 KB |
スコア | 115,464,144 |
平均クエリ数 | 7646.32 |
最終ジャッジ日時 | 2021-12-01 00:39:05 |
合計ジャッジ時間 | 16,727 ms |
ジャッジサーバーID (参考情報) |
judge10 / judge14 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 109 ms
21,948 KB |
testcase_01 | AC | 113 ms
21,948 KB |
testcase_02 | AC | 137 ms
22,092 KB |
testcase_03 | AC | 109 ms
22,104 KB |
testcase_04 | AC | 106 ms
22,020 KB |
testcase_05 | AC | 107 ms
21,960 KB |
testcase_06 | AC | 106 ms
21,924 KB |
testcase_07 | AC | 107 ms
22,140 KB |
testcase_08 | AC | 110 ms
21,960 KB |
testcase_09 | AC | 114 ms
21,948 KB |
testcase_10 | AC | 107 ms
21,900 KB |
testcase_11 | AC | 106 ms
21,780 KB |
testcase_12 | AC | 111 ms
21,936 KB |
testcase_13 | AC | 121 ms
21,948 KB |
testcase_14 | AC | 113 ms
21,912 KB |
testcase_15 | AC | 111 ms
21,936 KB |
testcase_16 | AC | 122 ms
22,224 KB |
testcase_17 | AC | 110 ms
21,896 KB |
testcase_18 | AC | 106 ms
21,948 KB |
testcase_19 | AC | 106 ms
22,356 KB |
testcase_20 | AC | 108 ms
21,924 KB |
testcase_21 | AC | 109 ms
22,356 KB |
testcase_22 | AC | 107 ms
21,972 KB |
testcase_23 | AC | 113 ms
21,960 KB |
testcase_24 | AC | 120 ms
21,948 KB |
testcase_25 | AC | 107 ms
21,948 KB |
testcase_26 | AC | 106 ms
22,104 KB |
testcase_27 | AC | 107 ms
21,924 KB |
testcase_28 | AC | 108 ms
21,780 KB |
testcase_29 | AC | 116 ms
22,128 KB |
testcase_30 | AC | 107 ms
21,900 KB |
testcase_31 | AC | 105 ms
21,912 KB |
testcase_32 | AC | 106 ms
21,972 KB |
testcase_33 | AC | 106 ms
21,924 KB |
testcase_34 | AC | 113 ms
22,116 KB |
testcase_35 | AC | 118 ms
21,924 KB |
testcase_36 | AC | 108 ms
21,900 KB |
testcase_37 | AC | 108 ms
21,912 KB |
testcase_38 | AC | 113 ms
21,936 KB |
testcase_39 | AC | 113 ms
21,900 KB |
testcase_40 | AC | 113 ms
21,828 KB |
testcase_41 | AC | 113 ms
21,936 KB |
testcase_42 | AC | 109 ms
21,792 KB |
testcase_43 | AC | 132 ms
22,116 KB |
testcase_44 | AC | 111 ms
21,948 KB |
testcase_45 | AC | 111 ms
21,948 KB |
testcase_46 | AC | 121 ms
21,960 KB |
testcase_47 | AC | 112 ms
21,792 KB |
testcase_48 | AC | 110 ms
21,780 KB |
testcase_49 | AC | 117 ms
22,380 KB |
testcase_50 | AC | 123 ms
22,100 KB |
testcase_51 | AC | 114 ms
22,152 KB |
testcase_52 | AC | 109 ms
21,960 KB |
testcase_53 | AC | 107 ms
22,092 KB |
testcase_54 | AC | 117 ms
22,092 KB |
testcase_55 | AC | 108 ms
21,936 KB |
testcase_56 | AC | 116 ms
21,936 KB |
testcase_57 | AC | 121 ms
21,936 KB |
testcase_58 | AC | 107 ms
21,948 KB |
testcase_59 | AC | 107 ms
21,924 KB |
testcase_60 | AC | 107 ms
21,960 KB |
testcase_61 | AC | 108 ms
21,780 KB |
testcase_62 | AC | 115 ms
21,936 KB |
testcase_63 | AC | 108 ms
21,912 KB |
testcase_64 | AC | 112 ms
21,792 KB |
testcase_65 | AC | 109 ms
21,924 KB |
testcase_66 | AC | 110 ms
21,900 KB |
testcase_67 | AC | 124 ms
21,900 KB |
testcase_68 | AC | 121 ms
21,764 KB |
testcase_69 | AC | 112 ms
22,356 KB |
testcase_70 | AC | 107 ms
21,732 KB |
testcase_71 | AC | 108 ms
21,948 KB |
testcase_72 | AC | 110 ms
21,912 KB |
testcase_73 | AC | 110 ms
21,792 KB |
testcase_74 | AC | 109 ms
21,960 KB |
testcase_75 | AC | 116 ms
21,948 KB |
testcase_76 | AC | 111 ms
21,924 KB |
testcase_77 | AC | 112 ms
21,924 KB |
testcase_78 | AC | 118 ms
21,948 KB |
testcase_79 | AC | 114 ms
22,092 KB |
testcase_80 | AC | 116 ms
21,912 KB |
testcase_81 | AC | 110 ms
22,164 KB |
testcase_82 | AC | 118 ms
21,924 KB |
testcase_83 | AC | 110 ms
21,948 KB |
testcase_84 | AC | 108 ms
21,900 KB |
testcase_85 | AC | 108 ms
22,020 KB |
testcase_86 | AC | 108 ms
22,020 KB |
testcase_87 | AC | 109 ms
22,104 KB |
testcase_88 | AC | 113 ms
22,020 KB |
testcase_89 | AC | 137 ms
21,924 KB |
testcase_90 | AC | 125 ms
22,128 KB |
testcase_91 | AC | 107 ms
21,792 KB |
testcase_92 | AC | 109 ms
21,912 KB |
testcase_93 | AC | 112 ms
21,960 KB |
testcase_94 | AC | 108 ms
21,924 KB |
testcase_95 | AC | 112 ms
21,960 KB |
testcase_96 | AC | 108 ms
21,780 KB |
testcase_97 | AC | 111 ms
21,768 KB |
testcase_98 | AC | 109 ms
22,020 KB |
testcase_99 | AC | 106 ms
22,140 KB |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) //vector<int> block_separator = { // 0, 10, 20, 30, 47, 56, 64, 81, 91, 101 //}; vector<int> block_separator = { // 0, 11, 22, 32, 48, 55, 62, 79, 90, 101 0, 11, 22, 32, 43, 50, 57, 62, 79, 90, 101 }; int main(){ int num_block = block_separator.size() - 1; vector<int> block_size(num_block, 0); vector<int> block_id(num_block, -1); int num_tick; cin >> num_tick; int max_block_size; cin >> max_block_size; int next_player_id = 1; rep(tick_idx, num_tick){ int num_enter; cin >> num_enter; vector<pair<int,int>> buf; rep(enter_idx, num_enter){ int enter_id = next_player_id++; int player_skill; cin >> player_skill; int block_to_assign = upper_bound(block_separator.begin(), block_separator.end(), player_skill) - block_separator.begin() - 1; if(block_size[block_to_assign] == 0){ block_id[block_to_assign] = enter_id; block_size[block_to_assign]++; } else{ buf.push_back(make_pair(block_id[block_to_assign], enter_id)); block_size[block_to_assign]++; } if(block_size[block_to_assign] >= max_block_size){ block_id[block_to_assign] = -1; block_size[block_to_assign] = 0; } } cout << buf.size() << "\n"; for(auto a : buf){ cout << a.first << " " << a.second << "\n"; } cout << flush; } return 0; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;