結果

問題 No.48 ロボットの操縦
ユーザー pirorirori_n712
提出日時 2018-07-28 02:19:15
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 107,416 KB
実行使用メモリ 28,096 KB
最終ジャッジ日時 2024-07-05 18:10:10
合計ジャッジ時間 2,172 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class No48{
    static void Main(){
        var a=Int32.Parse(Console.ReadLine());
        var b=Int32.Parse(Console.ReadLine());
        var c=Int32.Parse(Console.ReadLine());
        var d=0;
        if(b>0){
            d+=(b%c==0)?b/c:b/c+1;
        }else if(b<0){
            b=Math.Abs(b);
            d+=(b%c==0)?b/c+1:b/c+2;
        }
        if(a!=0){
            a=Math.Abs(a);
            d+=(a%c==0)?a/c:a/c+1;
        }
        Console.WriteLine(d);
    }
}
0