結果

問題 No.216 FAC
ユーザー cowgirl
提出日時 2018-10-08 20:44:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 168,692 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 15:42:26
合計ジャッジ時間 2,620 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 13 WA * 9 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N; cin >> N;
    std::vector<int> a(N),b(N),c(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 < N; i++){
        c[b[i]] += a[i];
    }
    int maxp = c[0];
    for(int i=0; i < N; i++){
        maxp = max(maxp, c[i]);
    }
    if(maxp = c[0]) cout << "YES" << endl;
    else cout << "NO" << endl;
}
0