結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2017-03-21 02:37:47 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 1,081 ms |
コンパイル使用メモリ | 102,784 KB |
実行使用メモリ | 17,920 KB |
最終ジャッジ日時 | 2024-07-05 04:49:52 |
合計ジャッジ時間 | 2,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 18 |
コンパイルメッセージ
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 P { static void Main(string[] _) { int x = int.Parse(Console.ReadLine()); int y = int.Parse(Console.ReadLine()); int l = int.Parse(Console.ReadLine()); int m = Math.Abs(x) + Math.Abs(y); int n = 0; if (x == 0 && y == 0) { n = 0; } else if (x == 0 || y == 0) { n = (int)Math.Ceiling(m / (double)l); } else { n = 1 + (int)Math.Ceiling(m / (double)l); } Console.WriteLine(n); } }