結果
| 問題 | No.3794 Super Chat |
| ユーザー |
👑 |
| 提出日時 | 2026-11-14 00:03:22 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 925µs | |
| コード長 | 781 bytes |
| 記録 | |
| コンパイル時間 | 5,309 ms |
| コンパイル使用メモリ | 380,112 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-11-14 00:03:30 |
| 合計ジャッジ時間 | 7,310 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define rrep(i, a, b) for (ll i = a; i >= b; --i)
// --- 初期設定(入出力の高速化と小数15桁出力) ---
struct Init {
Init() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
}
} init;
// ------------------------------------------------
int main() {
int n, m;
cin >> n >> m;
vector<pair<string, int>> sp(n);
rep(i, 0, n) {
cin >> sp[i].first >> sp[i].second;
}
ll ans = 0;
rep(i, 0, m) {
string inp;
cin >> inp;
rep(j, 0, n) {
if (sp[j].first == inp) {
ans += sp[j].second;
}
}
}
cout << ans << "\n";
return 0;
}