結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
Kaz_nl
|
| 提出日時 | 2017-08-15 21:44:25 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 374 bytes |
| 記録 | |
| コンパイル時間 | 343 ms |
| コンパイル使用メモリ | 77,676 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-30 20:26:59 |
| 合計ジャッジ時間 | 1,236 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int x, y, L, ans = 0;
cin >> x >> y >> L;
if (y >= 0 && x) {
ans++;
} else if (y < 0) {
ans += 2;
}
if (x % L) {
ans += abs(x) / L + 1;
} else {
ans += abs(x) / L;
}
if (y % L) {
ans += abs(y) / L + 1;
} else {
ans += abs(y) / L;
}
cout << ans << endl;
}
Kaz_nl