結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2023-01-03 13:58:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,037 ms / 5,000 ms |
コード長 | 564 bytes |
コンパイル時間 | 1,553 ms |
コンパイル使用メモリ | 165,340 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 01:51:38 |
合計ジャッジ時間 | 3,112 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int X,Y,L; cin>>X>>Y>>L; int count=0; if(Y>=0){ int a=Y; while(a>0){ a-=L; count++; } if(X!=0){ count++; } int b=abs(X); while(b>0){ b-=L; count++; } } else{ count+=2; int a=abs(Y); int b=abs(X); while(a>0){ a-=L; count++; } while(b>0){ b-=L; count++; } } cout<<count<<endl; }