結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2015-11-01 22:12:05 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 606 ms |
コンパイル使用メモリ | 24,832 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:30:13 |
合計ジャッジ時間 | 1,079 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
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);ans += 1;if(x==0 && y>=0) ans--;if(y<0)ans++;printf("%.0f\n",ans);return 0;}