結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2020-07-18 21:07:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 485 bytes |
コンパイル時間 | 1,642 ms |
コンパイル使用メモリ | 168,276 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-14 07:24:47 |
合計ジャッジ時間 | 2,795 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++){ cin >> a[i]; } vector<int> b(N); for (int i = 0; i < N; i++){ cin >> b[i]; } vector<int> s(101, 0); for (int i = 0; i < N; i++){ s[b[i]] += a[i]; } bool ok = true; for (int i = 1; i <= 100; i++){ if (s[i] > s[0]){ ok = false; } } if (ok){ cout << "YES" << endl; } else{ cout << "NO" << endl; } }