結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-18 20:55:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 825 bytes |
| コンパイル時間 | 561 ms |
| コンパイル使用メモリ | 73,360 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-01 20:31:38 |
| 合計ジャッジ時間 | 1,346 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pr;
ll X, Y, L;
ll rot_num = 0;
ll go_num = 0;
int main()
{
cin >> X >> Y >> L;
if (X == 0) {
if (Y != 0) {
if (Y < 0)
rot_num = 2;
}
}
else if (Y == 0) {
if (X != 0) {
rot_num = 1;
}
}
else {
if (Y > 0)rot_num = 1;
else rot_num = 2;
}
if (X != 0) {
if (L >= abs(X))
go_num = 1;
else {
go_num = abs(X / L);
if (X % L != 0)go_num++;
}
}
if (Y != 0) {
if (L >= abs(Y))
go_num += 1;
else {
go_num += abs(Y / L);
if (Y % L != 0)go_num++;
}
}
cout << go_num + rot_num << endl;
return 0;
}