結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2024-03-22 15:45:18 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 2,621 ms |
コンパイル使用メモリ | 244,700 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-30 10:36:45 |
合計ジャッジ時間 | 3,495 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll x,y,l,ans=0;cin>>x>>y>>l; if(x!=0){ ans++; if(y<0)ans++; }else{ if(y<0)ans+=2; } if(x<0)x*=-1; if(y<0)y*=-1; ans+=(x+l-1)/l+(y+l-1)/l; cout<<ans<<endl; }