結果
問題 | No.740 幻の木 |
ユーザー | Kakisuke1005 |
提出日時 | 2018-12-17 19:27:29 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 325 ms |
コンパイル使用メモリ | 20,652 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-25 23:30:53 |
合計ジャッジ時間 | 900 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 1 ms
4,348 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 1 ms
4,348 KB |
コンパイルメッセージ
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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main() { int N,M,P,Q,i,num; num=0; i=1; scanf("%d %d %d %d",&N,&M,&P,&Q); while(1){ if((i>=Q)&&(i<=(P+Q-1))){ N-=(M*2); }else{ N-=M; } num++; i++; if(N>=0){ break; } } printf("%d\n",num); return 0; }