結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
koyumeishi
|
| 提出日時 | 2015-01-16 00:08:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 429 bytes |
| コンパイル時間 | 542 ms |
| コンパイル使用メモリ | 72,512 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 18:15:27 |
| 合計ジャッジ時間 | 1,395 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
int main(){
long long x,y,l;
cin >> x >> y >> l;
long long ans = 0;
ans += abs(x)/l + (abs(x)%l==0?0:1);
ans += abs(y)/l + (abs(y)%l==0?0:1);
if(y<0) ans += 2;
else if(x!=0) ans += 1;
cout << ans << endl;
return 0;
}
koyumeishi