結果

問題 No.48 ロボットの操縦
ユーザー FVRChan
提出日時 2017-07-27 11:11:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 341 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 60,328 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-10 02:03:28
合計ジャッジ時間 1,441 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
using namespace std;
int main(void){
	int x,y,l,counter=0;
	cin>>x>>y>>l;

	if(y<0)counter+=2;
	else if(y>=0&&x!=0)counter++;

	y=abs(y);
	counter+=y/l;
	if(y%l!=0)counter++;


	x=abs(x);
	counter+=x/l;
	if(x%l!=0)counter++;


	cout<<counter<<endl;
}
0