結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-28 10:32:20 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 621 ms |
| コンパイル使用メモリ | 26,240 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-28 10:32:22 |
| 合計ジャッジ時間 | 2,239 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&pointList[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d",&answer);
| ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void){
int n = 0;
scanf("%d",&n);
int pointList[n] = {};
for(int i = 0 ; i < n ; i++){
scanf("%d",&pointList[i]);
}
int score[101] = {};
for(int i = 0 ; i < n ; i++){
int answer = 0;
scanf("%d",&answer);
score[answer] += pointList[i];
}
int max = score[0];
for(int i = 0 ; i < 101 ; i++){
if(max < score[i]){
max = score[i];
}
}
if(max <= score[0]){
printf("YES");
}else{
printf("NO");
}
}
Maeda