結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2018-01-20 02:20:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 509 ms |
コンパイル使用メモリ | 68,092 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-12-24 12:59:06 |
合計ジャッジ時間 | 9,988 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | AC * 10 RE * 14 |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<cmath> #include<math.h> #include<iomanip> #include<stdio.h> #include<cstring> using namespace std; int main(){ int n, a[100], b[100], member[101]={0}, k=0; cin >> n; for(int i=0; i<n; i++){ cin >> a[i]; } for(int i=0; i<n; i++){ cin >> b[i]; } for(int i=0; i<100; i++){ if(b[i]==0){ k+=a[i]; } else { member[b[i]]+=a[i]; } } for(int i=0; i<100; i++){ if(member[i]>k){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }