結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2017-01-24 11:40:03 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 5,000 ms |
コード長 | 843 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 105,776 KB |
実行使用メモリ | 25,716 KB |
最終ジャッジ日時 | 2024-12-23 07:51:48 |
合計ジャッジ時間 | 2,282 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; class Program { static void Main(string[] args) { int ew = int.Parse(Console.ReadLine()); int ns = int.Parse(Console.ReadLine()); int range = int.Parse(Console.ReadLine()); int count = 0; if (ns < 0) { count += 2; } else if (Math.Abs(ew) > 0) { count += 1; } if (Math.Abs(ew) % range == 0) { count += Math.Abs(ew) / range; } else { count += Math.Abs(ew) / range + 1; } if (Math.Abs(ns) % range == 0) { count += Math.Abs(ns) / range; } else { count += Math.Abs(ns) / range + 1; } Console.WriteLine(count); Console.ReadLine(); } }