結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2018-02-26 15:14:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 768 ms |
コンパイル使用メモリ | 69,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 01:27:15 |
合計ジャッジ時間 | 1,795 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 2 RE * 2 |
ソースコード
#include <iostream>#include <vector>#define REP(i, a, b) for (int i = (a); i < (b); i++)#define dump(s) cerr << __LINE__ << "\t:" << #s << " = " << (s) << endlusing namespace std;int main () {int N;cin >> N;vector<int> a(N), b(N + 1, 0);REP(i, 0, N) cin >> a[i];REP(i, 0, N) {int t;cin >> t;b[t] += a[i];}int mx = b[0];REP (i, 0, N + 1) mx = max(mx, b[i]);cout << (mx == b[0] ? "YES" : "NO") << endl;return 0;}