結果

問題 No.3064 Speedrun (Easy)
ユーザー Maeda
提出日時 2025-03-27 10:12:55
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 25,088 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-27 10:12:56
合計ジャッジ時間 1,235 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&problemCount[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d",&result);
      |         ^~~~~~~~~~~~~~~~~~~
main.c:15:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |     scanf("%d",&answerTime);
      |     ^~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
    int problemCount[4] = {0,0,0,0};
    for(int i = 0 ; i < 4 ; i++){
        scanf("%d",&problemCount[i]);
    }
    int resultTime = 0;
    for(int i = 0 ; i < 4 ; i++){
        int result = 0 ;
        scanf("%d",&result);
        resultTime += result*problemCount[i];
    }
    int answerTime = 0;
    scanf("%d",&answerTime);
    if(answerTime >= resultTime){
        printf("Yes");
    }else{
        printf("No");
    }
}
0