結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2022-11-01 01:47:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 308 bytes |
コンパイル時間 | 1,507 ms |
コンパイル使用メモリ | 165,680 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-08 13:14:40 |
合計ジャッジ時間 | 2,247 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int x, y, l; cin >> x >> y >> l; int ans = 0; if(y >= 0) { ans += (y + l - 1) / l; if(x != 0) ans += (abs(x) + l - 1) / l + 1; } else { ans += (abs(x) + l - 1) / l; ans += (y + l - 1) / l + 2; } cout << ans << endl; return 0; }