結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー Kome_soudouKome_soudou
提出日時 2021-12-24 01:28:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 351 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 1,980 ms
コンパイル使用メモリ 176,868 KB
実行使用メモリ 14,544 KB
最終ジャッジ日時 2023-10-20 07:48:18
合計ジャッジ時間 9,633 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 7 ms
4,348 KB
testcase_06 AC 8 ms
4,348 KB
testcase_07 AC 7 ms
4,348 KB
testcase_08 AC 8 ms
4,348 KB
testcase_09 AC 8 ms
4,348 KB
testcase_10 AC 8 ms
4,348 KB
testcase_11 AC 8 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 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 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 2 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 118 ms
6,556 KB
testcase_33 AC 82 ms
5,984 KB
testcase_34 AC 176 ms
7,668 KB
testcase_35 AC 151 ms
7,164 KB
testcase_36 AC 175 ms
7,996 KB
testcase_37 AC 96 ms
6,172 KB
testcase_38 AC 98 ms
6,316 KB
testcase_39 AC 193 ms
8,000 KB
testcase_40 AC 128 ms
6,864 KB
testcase_41 AC 178 ms
7,700 KB
testcase_42 AC 110 ms
6,588 KB
testcase_43 AC 118 ms
7,004 KB
testcase_44 AC 154 ms
7,736 KB
testcase_45 AC 115 ms
6,604 KB
testcase_46 AC 201 ms
8,260 KB
testcase_47 AC 50 ms
5,016 KB
testcase_48 AC 118 ms
6,800 KB
testcase_49 AC 219 ms
8,352 KB
testcase_50 AC 108 ms
6,232 KB
testcase_51 AC 95 ms
6,068 KB
testcase_52 AC 260 ms
10,732 KB
testcase_53 AC 259 ms
10,708 KB
testcase_54 AC 351 ms
14,544 KB
testcase_55 AC 342 ms
14,544 KB
testcase_56 AC 344 ms
14,544 KB
testcase_57 AC 343 ms
14,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  string S, T;
  int A, B;
  map<string, int> m;
  for(int i = 0; i < N; i++)
  {
    cin >> S >> A;
    m[S] = A;
  }
  for(int j = 0; j < M; j++)
  {
    cin >> T >> B;
    if(m.count(T)) m.at(T) = B;
    else m[T] = B;
  }
  
  for(auto p : m) cout << p.first << ' ' << p.second << endl;
  return 0;
}
0