結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2015-05-28 23:30:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 1,262 ms |
コンパイル使用メモリ | 157,792 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 00:36:25 |
合計ジャッジ時間 | 2,265 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h>inline long nextInt(void) {long temp;std::cin >> temp;return temp;}int main() {int point[128] = {};int id[128] = {};int total[128] = {};int N;int max = -10000;std::cin >> N;for(int i = 0; i < N; ++i) {std::cin >> point[i];}for(int i = 0; i < N; ++i) {std::cin >> id[i];}for(int i = 0; i < N; ++i) {total[id[i]] += point[i];}for(int i = 0; i < 128; ++i) {max = std::max(max, total[i]);}if( max == total[0] ) {std::cout << "YES" << std::endl;}else {std::cout << "NO" << std::endl;}return 0;}