結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
hiyori
|
| 提出日時 | 2016-10-14 20:01:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 435 ms |
| コンパイル使用メモリ | 53,976 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 06:50:23 |
| 合計ジャッジ時間 | 1,454 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 22 |
ソースコード
#include <iostream>
using namespace std;
int action (int num, int l)
{
int count = 0;
if (num >= l) {
count += num/l;
num = num % l;
}
count += num;
return count;
}
int main ()
{
int x, y, l;
cin >> x >> y >> l;
int count = 0; // 行動をカウントする
if (x < 0) x *= -1;
if (y < 0) {
if (x > 0) {
count++;
count += action(x, l);
}
y *= -1;
if (y > 0) {
count += action(y, l);
}
}
else {
if (x > 0) {
count++;
count += action(x, l);
}
if (y > 0) {
count += action(y, l);
}
}
cout << count << endl;
return 0;
}
hiyori