結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-11-23 18:20:10 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 779µs | |
| コード長 | 1,094 bytes |
| 記録 | |
| コンパイル時間 | 1,178 ms |
| コンパイル使用メモリ | 217,696 KB |
| 実行使用メモリ | 9,840 KB |
| 最終ジャッジ日時 | 2026-11-23 18:20:14 |
| 合計ジャッジ時間 | 3,461 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
while (t--) {
int x,y,l;
cin >> x >> y >> l;
int x1 = abs(x);
int y1 = abs(y);
int c1 = 0;
int c2 = 0;
if(x1%l==0){
c1 = x1/l;
} else {
c1 = x1/l + 1;
}
if(y1%l==0){
c2 = y1/l;
} else {
c2 = y1/l + 1;
}
int ec = 0;
if(x>0 && y>0){
ec = 1;
} else if (x>0 && y<0){
ec = 2;
} else if(x<0 && y>0){
ec = 1;
} else if(x<0 && y<0){
ec = 2;
}
if(x==0 && y>0){
ec = 0;
}
if(x==0 && y<0){
ec = 2;
}
if(x!=0 && y==0){
ec = 1;
}
if(x==0 && y==0){
ec = 0;
}
int fc = ec + c1 + c2;
cout << fc << endl;
}
}
vjudge1