結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2015-04-03 05:43:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 59,448 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-04 01:34:38 |
合計ジャッジ時間 | 1,331 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 6 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; int main() { int x,y,l; cin >> x >> y >> l; ll ans = 0; if(y > 0) { if(y%l == 0) ans += y/l; else ans += y/l + 1; } else if(y < 0) { y = -y; ans++; if(y%l == 0) ans += y/l; else ans += y/l + 1; } if(x > 0) { if(x%l == 0) ans += x/l; else ans += x/l + 1; } else if(x < 0) { x = -x; ans++; if(x%l == 0) ans += x/l; else ans += x/l + 1; } cout << ans << endl; return 0; }