結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-06 17:50:27 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 416 bytes |
| コンパイル時間 | 569 ms |
| コンパイル使用メモリ | 25,600 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-06 17:50:29 |
| 合計ジャッジ時間 | 1,501 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d", &a[i]);
| ^~~~~~~~~~~~~~~~~~
main.c:16:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &b);
| ^~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int i;
int a[102];
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
int b;
int scor[102];
for (i = 0; i < 102; i++)
scor[i] = 0;
for (i = 0; i < n; i++)
{
scanf("%d", &b);
scor[b] += a[i];
}
int max = 0;
for (i = 0; i < 102; i++)
if (max < scor[i])
max = scor[i];
if (scor[0] == max)
printf("YES\n");
else
printf("NO\n");
return 0;
}
sasa