結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー mmn15277198mmn15277198
提出日時 2021-12-24 11:09:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 370 ms / 2,000 ms
コード長 721 bytes
コンパイル時間 2,018 ms
コンパイル使用メモリ 114,052 KB
実行使用メモリ 22,056 KB
最終ジャッジ日時 2023-10-20 07:53:36
合計ジャッジ時間 10,008 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 7 ms
4,348 KB
testcase_05 AC 6 ms
4,348 KB
testcase_06 AC 8 ms
4,348 KB
testcase_07 AC 8 ms
4,348 KB
testcase_08 AC 8 ms
4,348 KB
testcase_09 AC 9 ms
4,348 KB
testcase_10 AC 9 ms
4,348 KB
testcase_11 AC 9 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 3 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 3 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 122 ms
8,976 KB
testcase_33 AC 88 ms
7,024 KB
testcase_34 AC 181 ms
10,088 KB
testcase_35 AC 154 ms
9,580 KB
testcase_36 AC 187 ms
10,412 KB
testcase_37 AC 100 ms
7,268 KB
testcase_38 AC 107 ms
8,736 KB
testcase_39 AC 205 ms
10,416 KB
testcase_40 AC 137 ms
9,280 KB
testcase_41 AC 184 ms
10,120 KB
testcase_42 AC 118 ms
9,004 KB
testcase_43 AC 133 ms
9,420 KB
testcase_44 AC 174 ms
10,152 KB
testcase_45 AC 124 ms
9,020 KB
testcase_46 AC 208 ms
10,680 KB
testcase_47 AC 55 ms
6,056 KB
testcase_48 AC 120 ms
9,216 KB
testcase_49 AC 206 ms
10,768 KB
testcase_50 AC 108 ms
7,328 KB
testcase_51 AC 97 ms
7,164 KB
testcase_52 AC 259 ms
14,948 KB
testcase_53 AC 262 ms
14,920 KB
testcase_54 AC 370 ms
22,056 KB
testcase_55 AC 353 ms
22,056 KB
testcase_56 AC 350 ms
22,056 KB
testcase_57 AC 349 ms
22,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <cstdio>
#include <string>

using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    int r;
    cin >> s >> r;
    mp[s] = r;
  }
  for (int i = 0; i < m; i++) {
    string s;
    int r;
    cin >> s >> r;
    mp[s] = r;
  }
  vector<pair<string, int> > p;
  for (auto i : mp) {
    p.push_back(make_pair(i.first, i.second));
  }
  sort(p.begin(), p.end());
  for (int i = 0; i < p.size(); i++) {
    cout << p[i].first << " " << p[i].second << endl;
  }
  return 0;
}
0