結果

問題 No.216 FAC
ユーザー satanic
提出日時 2015-12-06 18:29:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 666 ms
コンパイル使用メモリ 61,568 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 16:00:31
合計ジャッジ時間 1,668 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int n, Kscore=0, input;
  cin >> n;
  vector<int> a(n, 0);
  vector<int> score(100, 0);
  
  for(int i=0; i<n; ++i) cin >> a[i];
  for(int i=0; i<n; ++i){
    cin >> input;
    if(input==0) Kscore+=a[i];
    else score[input]+=a[i];
  }
  cout << ( ( Kscore<*max_element(score.begin(), score.end()) ) ? "NO\n" : "YES\n");

  return 0;
}
0