結果
| 問題 |
No.740 幻の木
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-17 19:06:24 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 285 bytes |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 07:36:10 |
| 合計ジャッジ時間 | 598 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d %d %d",&N,&M,&P,&Q);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main()
{
int N,M,P,Q,i,num;
num=0;
scanf("%d %d %d %d",&N,&M,&P,&Q);
for(i=1;N<=0;i++){
if((i>=Q)||(i<=(P+Q-1))){
N-=(M*2);
}else{
N-=M;
}
num++;
}
printf("%d\n",num);
return 0;
}