結果
| 問題 | No.3794 Super Chat |
| ユーザー |
|
| 提出日時 | 2026-11-13 22:34:00 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 921µs | |
| コード長 | 473 bytes |
| 記録 | |
| コンパイル時間 | 3,392 ms |
| コンパイル使用メモリ | 361,808 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-11-13 22:34:06 |
| 合計ジャッジ時間 | 5,246 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<pair<string, int>> a(n);
for(auto &&[s, v] : a) cin >> s >> v;
sort(a.begin(), a.end());
string t;
ll ans = 0;
while(m--){
cin >> t;
int p = lower_bound(a.begin(), a.end(), make_pair(t, -1)) - a.begin();
ans += a[p].second;
}
cout << ans << '\n';
}