結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2020-06-28 12:16:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 364 bytes |
コンパイル時間 | 1,390 ms |
コンパイル使用メモリ | 166,768 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 11:42:24 |
合計ジャッジ時間 | 1,983 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using ll = long long;using namespace std;int main(){ll x,y,l,c{0};scanf("%lld%lld%lld",&x,&y,&l);if (x==0 && y==0){printf("%lld\n",c);return 0;}if (y<0)c=2;else if(x)c=1;c+= (abs(x)+l-1)/l;c+= (abs(y)+l-1)/l;printf("%lld\n",c);return 0;}