結果

問題 No.740 幻の木
ユーザー Kakisuke1005Kakisuke1005
提出日時 2018-12-17 19:15:20
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 20,568 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 23:29:41
合計ジャッジ時間 585 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%d %d %d %d",&N,&M,&P,&Q);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main()
{
    int N,M,P,Q,i,num;
    num=1;
    i=1;
    scanf("%d %d %d %d",&N,&M,&P,&Q);
    do{
        if((i>=Q)||(i<=(P+Q-1))){
            N-=(M*2);
        }else{
            N-=M;
        }
        num++;
        i++;
    }while(N>=0);
    printf("%d\n",num);
    return 0;
}
0