結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2014-10-23 22:34:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 309 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 30,080 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:05:56 |
合計ジャッジ時間 | 1,158 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:10:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | int x,y,l;scanf("%d%d%d",&x,&y,&l); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> #include <stdlib.h> using namespace std; //namaega 184 int main(){ int x,y,l;scanf("%d%d%d",&x,&y,&l); int ans=0; if(x!=0)ans+=1,ans+=(abs(0-x)+l-1)/l; if(y<0){ans++;if(x==0)ans++;} ans+=(abs(0-y)+l-1)/l; printf("%d\n",ans); return 0; }