結果

問題 No.48 ロボットの操縦
ユーザー ixTL255ixTL255
提出日時 2016-09-08 01:10:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 373 bytes
コンパイル時間 1,831 ms
コンパイル使用メモリ 98,532 KB
実行使用メモリ 22,880 KB
最終ジャッジ日時 2023-08-14 00:50:38
合計ジャッジ時間 4,240 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
22,860 KB
testcase_01 AC 45 ms
20,720 KB
testcase_02 AC 47 ms
20,812 KB
testcase_03 AC 47 ms
20,816 KB
testcase_04 AC 47 ms
20,772 KB
testcase_05 AC 47 ms
22,880 KB
testcase_06 AC 47 ms
20,748 KB
testcase_07 AC 47 ms
20,824 KB
testcase_08 AC 45 ms
20,796 KB
testcase_09 AC 46 ms
20,824 KB
testcase_10 AC 45 ms
20,876 KB
testcase_11 AC 45 ms
20,652 KB
testcase_12 AC 47 ms
22,756 KB
testcase_13 AC 45 ms
20,680 KB
testcase_14 AC 45 ms
20,704 KB
testcase_15 AC 46 ms
22,816 KB
testcase_16 AC 45 ms
20,840 KB
testcase_17 AC 46 ms
20,932 KB
testcase_18 AC 47 ms
22,712 KB
testcase_19 AC 45 ms
18,752 KB
testcase_20 AC 46 ms
20,844 KB
testcase_21 AC 47 ms
22,744 KB
testcase_22 AC 45 ms
20,740 KB
testcase_23 AC 47 ms
20,716 KB
testcase_24 AC 47 ms
20,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Test
{
	public static void Main()
	{
		var x = int.Parse(Console.ReadLine());
		var y = int.Parse(Console.ReadLine());
		var l = int.Parse(Console.ReadLine());
		
		int ans;
		
		if(y < 0) ans = 2;
		else if(x != 0) ans = 1;
		else ans = 0;
		
		ans += (Math.Abs(x) + l - 1) / l
				+ (Math.Abs(y) + l - 1) / l;
		
		Console.WriteLine(ans);
	}
}
0