結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-11-23 17:32:57 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,350 bytes |
| 記録 | |
| コンパイル時間 | 2,220 ms |
| コンパイル使用メモリ | 336,076 KB |
| 実行使用メモリ | 9,840 KB |
| 最終ジャッジ日時 | 2026-11-23 17:33:01 |
| 合計ジャッジ時間 | 4,439 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 WA * 2 |
ソースコード
#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 || y==0){
origin=true;
}
int ans=0;
// // if(!origin) ans++;
if(!origin){
if(x>0 and y>0){
ans++;
}else if(x<0 and y>0){
ans++;
}else ans+=2;
}
// if(x>0 and y<0){
// ans++;
// }
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