結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2016-03-03 10:01:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 58,156 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 13:40:15 |
| 合計ジャッジ時間 | 1,483 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 8 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int ans = 0,x,y,l;
cin >> x >> y >> l;
if(x < 0 && y != 0) ans++;
else if(y == 0) ans += 2;
if(y < 0) ans++;
x = abs(x);
y = abs(y);
if(x % l) ans += x / l + 1;
else ans += x / l;
if(y % l) ans += y / l + 1;
else ans += y / l;
cout << ans << endl;
}
ldsyb