結果

問題 No.216 FAC
ユーザー Yug_min_null
提出日時 2021-09-05 04:35:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 2,401 ms
コンパイル使用メモリ 189,132 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-21 17:45:17
合計ジャッジ時間 2,725 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N; cin >> N;
  vector<int> A(N, 0), T(101, 0);
  for(int i = 0; i < N; i++) cin >> A[i];
  for(int i = 0; i < N; i++){
    int B; cin >> B;
    if(B == 0) T[0] += A[i];
    else T[B] += A[i];
  }
  int maxP = -1;
  for(int i = 0; i < N; i++) maxP = max(maxP, T[i]);
  if(maxP == T[0]) cout << "YES" << endl;
  else cout << "NO" << endl;
}
0