結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー nak2yoshi
提出日時 2016-02-18 02:16:52
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 370 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 505 ms
コンパイル使用メモリ 85,492 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-05 06:38:12
合計ジャッジ時間 1,411 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(15): Deprecation: `long += real` is performing truncating conversion
    ans += (X / L).abs.ceil + (Y / L).abs.ceil;
        ^

ソースコード

diff #
raw source code

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