結果
| 問題 |
No.1795 AtCoder Heuristic Rating coloring
|
| コンテスト | |
| ユーザー |
ygd.
|
| 提出日時 | 2022-01-05 00:01:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 409 ms / 2,000 ms |
| コード長 | 1,085 bytes |
| コンパイル時間 | 2,649 ms |
| コンパイル使用メモリ | 209,952 KB |
| 最終ジャッジ日時 | 2025-01-27 08:47:07 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 54 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(),(a).end() //lower_bound(ALL(a),x)
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
template <typename T>
bool chmax(T &a, const T& b) {
if (a < b) {
a = b; // aをbで更新
return true;
}
return false;
}
template <typename T>
bool chmin(T &a, const T& b) {
if (a > b) {
a = b; // aをbで更新
return true;
}
return false;
}
int INF = 100100100;
int main() {
int n,m;
cin >> n >> m;
map<string, int> rating;
rep(i,n) {
string name;
int r;
cin >> name >> r;
rating[name] = r;
}
rep(i,m) {
string name;
int nr;
cin >> name >> nr;
rating[name] = nr;
}
vector<string> ret;
for (auto i = rating.begin(); i != rating.end(); i++) {
ret.push_back(i -> first);
}
sort(ALL(ret));
for (auto ans: ret) {
cout << ans << " " << rating[ans] << endl;
}
}
ygd.