結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-12 03:11:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 442 bytes |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 37,316 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-06 07:25:58 |
| 合計ジャッジ時間 | 1,266 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 14 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d", a + i);
| ~~~~~^~~~~~~~~~~~~
main.cpp:14:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%d", b + i);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
//216
int main() {
int n, s[101], 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