結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
Eclair1015
|
| 提出日時 | 2018-07-08 16:26:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 495 bytes |
| コンパイル時間 | 378 ms |
| コンパイル使用メモリ | 58,964 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 14:58:39 |
| 合計ジャッジ時間 | 1,082 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 18 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include<string>
using namespace std;
int main() {
int x, y, l;
int x_ori;
int count = 0;
cin >> x >> y >> l;
if (x == 0 || y == 0) {
x = abs(x);
y = abs(y);
count += (x + y) / l;
if ((x + y) % l != 0)count++;
}else{
if (x < 0) count++;
if (y < 0) count++;
x = abs(x);
y = abs(y);
count += (x / l);
if (x%l != 0)count++;
count++;
count += (y / l);
if (y%l != 0)count++;
}
cout << count << "\n";
}
Eclair1015