結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
Kaz_nl
|
| 提出日時 | 2017-08-15 21:44:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 374 bytes |
| コンパイル時間 | 506 ms |
| コンパイル使用メモリ | 58,212 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 11:01:45 |
| 合計ジャッジ時間 | 1,232 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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