結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2019-06-03 16:37:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 386 bytes |
コンパイル時間 | 834 ms |
コンパイル使用メモリ | 72,808 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 20:33:18 |
合計ジャッジ時間 | 1,360 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>#include <vector>#include <map>using namespace std;int main() {int n;cin >> n;vector<int> v(n);for (int i=0; i<n; i++) {cin >> v[i];}map<int, int> mp;int max=0;for (int i=0; i<n; i++) {int a;cin >> a;mp[a]+=v[i];if (mp[a]>max && a!=0) max=mp[a];}cout << (mp[0]>=max ? "YES": "NO") << endl;return 0;}