結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2016-01-05 23:22:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 387 ms |
コンパイル使用メモリ | 54,492 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 00:44:55 |
合計ジャッジ時間 | 1,151 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include<iostream>using namespace std;int main(void){int i, n, a[105], b[105], c[105] = { 0 }, ans = 0;cin >> n;for (i = 0; i < n; i++)cin >> a[i];for (i = 0; i < n; i++)cin >> b[i];for (i = 0; i < n; i++) {c[b[i]] += a[i];}for (i = 1; i < 101; i++){if (c[0] < c[i])ans = 1;}if (ans != 0)cout << "NO" << endl;else cout << "YES" << endl;return 0;}