結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2014-11-01 15:31:44 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 869 bytes |
コンパイル時間 | 2,488 ms |
コンパイル使用メモリ | 108,056 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-11-21 18:07:32 |
合計ジャッジ時間 | 3,779 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.Globalization; class Program { public static void Main(string[] args) { int x = int.Parse(Console.ReadLine()); int y = int.Parse(Console.ReadLine()); int k = int.Parse(Console.ReadLine()); int count = 0; if (x != 0) { count++; } if (y < 0) { count = Math.Max(2, count+1); } if (x != 0) { count += Math.Abs(x)/k; if (Math.Abs(x)%k != 0) { count++; } } if (y != 0) { count += Math.Abs(y) / k; if (Math.Abs(y) % k != 0) { count++; } } Console.WriteLine(count.ToString(CultureInfo.InvariantCulture)); } }