結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-14 19:28:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 332 bytes |
| コンパイル時間 | 1,615 ms |
| コンパイル使用メモリ | 164,944 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 00:52:43 |
| 合計ジャッジ時間 | 2,379 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int x, y, l;
int count = 0;
scanf("%d %d %d", &x, &y, &l);
if (y < 0) {
y *= -1;
count += 2;
}
else {
if (x != 0) count += 1;
}
if (x < 0) x *= -1;
count += (x + l - 1) / l;
count += (y + l - 1) / l;
printf("%d\n", count);
return 0;
}