結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-27 01:33:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 401 bytes |
| コンパイル時間 | 2,195 ms |
| コンパイル使用メモリ | 191,640 KB |
| 最終ジャッジ日時 | 2025-01-07 09:00:49 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
int score[101] {};
int mx = 0;
for (int i = 0; i < n; i++) {
int b; cin >> b;
score[b] += a[i];
mx = max(mx, score[b]);
}
if (score[0] == mx) puts("YES");
else puts("NO");
return 0;
}