結果

問題 No.48 ロボットの操縦
ユーザー jin128
提出日時 2016-08-26 14:39:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 587 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 106,552 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-11-21 18:48:36
合計ジャッジ時間 3,446 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class S18_robot{
  public static int Main(string[] args){
    int x, y, l;
    int count = 0;

    x = int.Parse(Console.ReadLine());
    y = int.Parse(Console.ReadLine());
    l = int.Parse(Console.ReadLine());

    if(y < 0){
      count += 2;
    }else if(Math.Abs(x) > 0){
      count += 1;
    }

    if(Math.Abs(x) % l == 0)
      count += Math.Abs(x) / l;
    else
      count += Math.Abs(x) / l + 1;

    if(Math.Abs(y) % l == 0)
      count += Math.Abs(y) / l;
    else
      count += Math.Abs(y) / l + 1;

    Console.WriteLine("{0}",count);
    return 0;
  }
}
0