結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2015-07-14 20:03:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 586 bytes |
コンパイル時間 | 1,232 ms |
コンパイル使用メモリ | 157,788 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:22:08 |
合計ジャッジ時間 | 1,977 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;template<typename T> inline T gcd(T a, T b) {return __gcd(a, b);}template<typename T> inline T lcm(T a, T b) {return a / gcd(a, b) * b;}template<typename T> inline T floor(T a, T b) {return a / b * b <= a ? a / b : a / b - 1;}template<typename T> inline T ceil(T a, T b) {return floor(a + b - 1, b);}template<typename T> inline T round(T a, T b) {return floor(a + b / 2);}int main() {int x, y, l;cin >> x >> y >> l;cout << (y < 0 ? 2 : x != 0 ? 1 : 0) + ceil(abs(x), l) + ceil(abs(y), l) << endl;}