結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2015-08-23 20:40:59 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 725 bytes |
| 記録 | |
| コンパイル時間 | 656 ms |
| コンパイル使用メモリ | 81,056 KB |
| 実行使用メモリ | 89,028 KB |
| 最終ジャッジ日時 | 2026-04-02 06:06:23 |
| 合計ジャッジ時間 | 1,473 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 1 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
static const int PEOPLE = 100;
int main() {
int problem_num;
std::cin >> problem_num;
std::vector<int> score, solved(PEOPLE, 0);
for (int i = 0; i < problem_num; i++) {
int num;
std::cin >> num;
score.push_back(num);
}
for (int i = 0; i < problem_num; i++) {
int num;
std::cin >> num;
solved[num] += score[i];
if (num != 0) score[i] = 0;
}
solved[0] = 0; //解かれてない問題は集計しない
int top_score = *std::max_element(solved.begin(), solved.end());
int player_score = std::accumulate(score.begin(), score.end(), 0);
std::cout << (top_score <= player_score ? "YES" : "NO") << std::endl;
return 0;
}
hanorver