結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-12 03:12:52 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 60,036 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-06 09:42:39 |
| 合計ジャッジ時間 | 1,924 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
//216
int main() {
int n, s[101] = { 0 }, a[100], b[100];
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", a + i);
for (int i = 0; i < n; i++)
scanf("%d", b + i);
for (int i = 0; i < n; i++)
s[b[i]] += a[i];
int ano = s[1];
for (int i = 2; i <= 100; i++)
ano = max(ano, s[i]);
printf("%s\n", ano <= s[0] ? "YES" : "NO");
}
AQUA16573837