結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
Elizack
|
| 提出日時 | 2020-02-05 18:41:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 461 bytes |
| コンパイル時間 | 512 ms |
| コンパイル使用メモリ | 64,488 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 19:19:29 |
| 合計ジャッジ時間 | 2,430 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 6 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int x,y,l;
cin >> x >> y >> l;
int ans = 0;
if(y > 0){
while(y > 0){
y -= l;
ans++;
}
}else if(y < 0){
ans += 2;
while(y < 0){
y += l;
ans++;
}
}
if(x != 0){
ans++;
}
if(x > 0){
while(x > 0){
x -= l;
ans++;
}
}else if(x < 0){
while(x < 0){
x += l;
ans++;
}
}
cout << ans << endl;
return 0;
}
Elizack