結果

問題 No.48 ロボットの操縦
ユーザー nak2yoshi
提出日時 2016-02-18 02:16:52
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 101,760 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 02:53:28
合計ジャッジ時間 1,303 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(15): Warning: `long += real` is performing truncating conversion

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm;

void main()
{
    auto X = readln.strip.to!real;
    auto Y = readln.strip.to!real;
    auto L = readln.strip.to!real;

    long ans;
    ans += (X / L).abs.ceil + (Y / L).abs.ceil;
    if (X != 0 && Y >= 0) ans++;
    if (Y < 0) ans += 2;
    ans.writeln;
}
0