結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2016-12-03 23:25:45 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 410 ms |
コンパイル使用メモリ | 24,064 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 14:37:52 |
合計ジャッジ時間 | 1,134 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
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("%ld %ld %ld",&x,&y,&l); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>#include<math.h>int main(){long int x,y,l;scanf("%ld %ld %ld",&x,&y,&l);int res = 0;if((0 < x && 0 < y) || (x < 0 && 0 <= y)){res++;}else if((0 < x && y <= 0) || (x <= 0 && y < 0)){res+=2;}res += (int)ceil(fabs((double)x)/l);res += (int)ceil(fabs((double)y)/l);printf("%d\n",res);return 0;}