結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2015-11-01 22:01:38 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 302 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 24,960 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 06:53:35 |
合計ジャッジ時間 | 879 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 8 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%ld%ld%ld",&x,&y,&l); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<math.h> #include <stdlib.h> int main(void){ long x,y,l; double tmp,ans; scanf("%ld%ld%ld",&x,&y,&l); tmp = labs(x)/(double)l; ans += ceil(tmp); tmp = labs(y)/(double)l; ans += ceil(tmp); if(x!=0 && y>0) ans++; if(y<0)ans++; printf("%.0f\n",ans); return 0; }