結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2020-03-14 03:27:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 2,657 ms |
コンパイル使用メモリ | 191,020 KB |
最終ジャッジ日時 | 2025-01-09 06:44:15 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0;i<(n);i++)using namespace std;int main(){int x,y,l; cin>>x>>y>>l;int ans=0;if(y>0) ans+=(y+l-1)/l;if(y<0) ans+=(-y+l-1)/l+(x==0?2:1);if(x>0) ans+=(x+l-1)/l+1;if(x<0) ans+=(-x+l-1)/l+1;cout<<ans<<'\n';return 0;}