結果

問題 No.216 FAC
ユーザー Konton7
提出日時 2020-08-19 11:08:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 429 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 192,112 KB
最終ジャッジ日時 2025-01-13 03:42:35
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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[101];
    fill(p, p+101, 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,101)
        s = max(p[i], s);
    cout << ( (s == p[0]) ? "YES" : "NO" ) << endl;
}
0