結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-11-23 17:40:50 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 744µs | |
| コード長 | 1,417 bytes |
| 記録 | |
| コンパイル時間 | 2,155 ms |
| コンパイル使用メモリ | 337,228 KB |
| 実行使用メモリ | 9,928 KB |
| 最終ジャッジ日時 | 2026-11-23 17:40:55 |
| 合計ジャッジ時間 | 3,935 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
// #ifndef ONLINE_JUDGE
// #include "debug/debug_template.cpp"
// #else
// #define debug(...)
// #define debugArr(...)
// #endif
#define ll long long
#define nl "\n"
#define vi vector<int>
#define vvi vector<vector<int>>
#define int long long
#define pii pair<int,int>
#define double long double
#define pb push_back
#define here cout<<"HERE"<<nl;
#define forn(i,a,n) for(int i = a; i < n; i++)
#define print(a) for(auto& e : a) cout << e << " "; cout << nl;
#define all(a) a.begin(),a.end()
#define MOD(a,b) ((a%b)+b)%b
#define yesno(b) cout << ((b)? "YES\n" : "NO\n")
template<typename T> using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
using namespace std;
void solve(){
int x,y,l;
cin >> x >> y >> l;
bool origin=false;
if(x==0 and y==0){
cout<<0<<nl;return;
}
int ans=0;
if(y==0 and x>0)ans++;
if(y>0 and x>0)ans++;
if(y>0 and x==0)goto jba;
if(x<0 and y>0)ans++;
if(x<0 and y==0)ans++;
if(x<0 and y<0)ans+=2;
if(x==0 and y<0)ans+=2;
if(x>0 and y<0)ans+=2;
// if(x>0 and y<0){
// ans++;
// }
jba:
int xa=abs(x);
int xy=abs(y);
ans+=(xa+l-1)/l;
ans+=(xy+l-1)/l;
cout<<ans<<nl;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
//cin >> t;
while (t--){
solve();
}
return 0;
}
vjudge1