結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2015-12-18 01:20:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 558 ms |
コンパイル使用メモリ | 65,644 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 08:19:49 |
合計ジャッジ時間 | 1,275 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 8 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin >> n; vector<int> data1(n); vector<int> data2(n); vector<int> score(100); for(auto &a:data1) cin >> a; for(auto &b:data2) cin >> b; int count = 0; for(int i = 0; i < n; i++){ if(data2[i] == 0) count += data1[i]; else score[data2[i]] += data1[i]; } /* for(int i = 0; i < n; i++){ if(count < score[data2[i]]){ cout << "NO" << endl; return 0; } } */ sort(score.begin(),score.end()); cout << (count >= score[100] ? "YES" : "NO") << endl; return 0; }