結果

問題 No.143 豆
ユーザー pracodepracode
提出日時 2018-09-17 16:22:10
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 27,612 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 09:28:46
合計ジャッジ時間 1,041 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 0 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 0 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
    int k,n,f;
    int age[100];
    int i;
    int num;
    
    scanf("%d",&k);
    scanf("%d",&n);
    scanf("%d",&f);
    num=k*n;
    
    for(i=0;i<f;i++){
        scanf("%d",&age[i]);
        if((num-age[i]>0)){
            num-=age[i];
        }
        else{
            printf("-1\n");
            break;
        }
    }
    printf("%d\n",num);
    return 0;
}
0