結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2015-11-12 01:39:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 427 bytes |
コンパイル時間 | 531 ms |
コンパイル使用メモリ | 57,996 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 00:43:42 |
合計ジャッジ時間 | 1,401 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream> #include <algorithm> #include <numeric> #include <sstream> #include <cstdio> using namespace std; int main(int argc, char *argv[]) { int N; cin >> N; int a[100] = {}, b[101] = {}; for (int i = 0; i < N; ++i) { cin >> a[i]; } for (int i = 0; i < N; ++i) { int x; cin >> x; b[x] += a[i]; } bool ans = b[0] >= *max_element(b + 1, b + 101); cout << (ans ? "YES" : "NO") << endl; return 0; }