結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
mewmew
|
| 提出日時 | 2017-03-02 00:33:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 596 bytes |
| コンパイル時間 | 462 ms |
| コンパイル使用メモリ | 61,276 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-12 22:50:07 |
| 合計ジャッジ時間 | 1,277 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 18 |
ソースコード
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#define REP(i,n) for(int i=0;i<(n);++i)
#define SORT(a) sort((a).begin(),(a).end())
#define PB push_back
using namespace std;
typedef vector<int> VI;
typedef queue<int> QI;
int main(){
int X, Y, L;
cin >> X >> Y >> L;
int r = 0;
if(X == 0){
if(Y != 0){
if(Y < 0){
r = 2;
Y = -Y;
}
r += (Y - 1) / L + 1;
}
}else{
if(X < 0){
r = 1;
X = -X;
}
r += 2 + (Y == 0 ? 0 : (Y - 1) / L + 1) + (X - 1) / L;
}
cout << r << endl;
}
mewmew