結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2025-07-16 22:28:28 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 415 bytes |
コンパイル時間 | 2,914 ms |
コンパイル使用メモリ | 275,624 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-07-16 22:28:33 |
合計ジャッジ時間 | 4,266 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() int main() { int x, y, l; cin >> x >> y >> l; int dx = abs(x); int dy = abs(y); int ans = (dx + l - 1) / l + (dy + l - 1) / l; if (y > 0 && dx > 0) ans++; if (y < 0) { ans += 2; if (dx > 0) ans++;} cout << ans << endl; return 0; }