結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2019-09-13 17:10:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 732 bytes |
コンパイル時間 | 802 ms |
コンパイル使用メモリ | 85,428 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 03:52:51 |
合計ジャッジ時間 | 1,592 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>#include <vector>#include <unordered_map>using namespace std;int main() {int n;vector<int> points, persons;std::unordered_map<int, int> mp;cin >> n;int point, person;for (int i = 0; i < n; i++) {cin >> point;points.push_back(point);}for (int i = 0; i < n; i++) {cin >> person;persons.push_back(person);}for (int i = 0; i < n; i++) {mp[persons[i]] += points[i];}int top = 0;for (int i = 1; i <= 100; i++) {top = max(top, mp[i]);}if (mp[0] >= top) {cout << "YES" << endl;} else {cout << "NO" << endl;}return 0;}