結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-08 18:46:28 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 237µs | |
| コード長 | 392 bytes |
| 記録 | |
| コンパイル時間 | 994 ms |
| コンパイル使用メモリ | 172,224 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-08 18:46:48 |
| 合計ジャッジ時間 | 3,132 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
int x, y, l; cin >> x >> y >> l;
int ans=(abs(x)+l-1)/l+(abs(y)+l-1)/l;
if(x==0||y==0){
if(x==0&&y==0) cout << 0 << endl;
else if(x==0) cout << ans+2*(y<0) << endl;
else cout << ans+1 << endl;
return 0;
}
cout << ans+(y>0?1:2) << endl;
return 0;
}