結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー harurunharurun
提出日時 2021-11-15 17:14:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 573 bytes
コンパイル時間 2,598 ms
コンパイル使用メモリ 215,932 KB
実行使用メモリ 11,372 KB
最終ジャッジ日時 2023-10-18 23:09:24
合計ジャッジ時間 27,042 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,696 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 8 ms
4,348 KB
testcase_05 AC 8 ms
4,348 KB
testcase_06 AC 9 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 10 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 3 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 3 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 965 ms
4,904 KB
testcase_33 AC 195 ms
5,704 KB
testcase_34 TLE -
testcase_35 AC 1,696 ms
7,488 KB
testcase_36 AC 1,655 ms
7,288 KB
testcase_37 AC 466 ms
5,704 KB
testcase_38 AC 160 ms
4,648 KB
testcase_39 TLE -
testcase_40 AC 968 ms
6,232 KB
testcase_41 TLE -
testcase_42 AC 656 ms
6,232 KB
testcase_43 AC 405 ms
6,760 KB
testcase_44 AC 937 ms
7,288 KB
testcase_45 AC 739 ms
6,232 KB
testcase_46 TLE -
testcase_47 AC 151 ms
4,648 KB
testcase_48 AC 393 ms
4,956 KB
testcase_49 TLE -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  int N,M;
  cin>>N>>M;
  vector<pair<string,int>> SA(N);
  for(int i=0;i<N;i++){
    cin>>SA[i].first>>SA[i].second;
  }
  SA.reserve(N+M);
  for(int i=0;i<M;i++){
    string T;
    int B;
    cin>>T>>B;
    bool flag=true;
    for(int j=0;j<N;j++){
      if(SA[j].first==T){
        SA[j].second=B;
        flag=false;
        break;
      }
    }
    if(flag){
      SA.push_back(make_pair(T,B));
    }
  }
  sort(SA.begin(),SA.end());
  for(auto i:SA){
    cout<<i.first<<" "<<i.second<<endl;
  }
  return 0;
}
0