結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-16 22:37:46 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 3,182 ms |
| コンパイル使用メモリ | 275,784 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-07-16 22:37:51 |
| 合計ジャッジ時間 | 4,166 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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++;
if (y == 0 && dx > 0) ans++;
cout << ans << endl;
return 0;
}