結果

問題 No.216 FAC
ユーザー Konton7
提出日時 2020-01-18 15:25:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 2,538 ms
コンパイル使用メモリ 194,608 KB
最終ジャッジ日時 2025-01-08 20:02:44
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    int n, s;
    cin >> n;
    int a[n], b[n], p[100];
    fill(p, p+100, 0);
    rep(i, n)
        cin >> a[i];
    rep(i, n)
        cin >> b[i];
    rep(i, n)
        p[b[i]] += a[i];
    s = 0;
    rep(i,100)
        s = max(p[i], s);
    cout << ( (s == p[0]) ? "YES" : "NO" );
}
0