結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2018-07-28 02:39:09 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 844 ms |
コンパイル使用メモリ | 102,400 KB |
実行使用メモリ | 17,664 KB |
最終ジャッジ日時 | 2024-07-05 18:10:20 |
合計ジャッジ時間 | 2,270 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;class No48{static void Main(){var a=Int32.Parse(Console.ReadLine());var b=Int32.Parse(Console.ReadLine());var c=Int32.Parse(Console.ReadLine());var d=0;if(b>0){d+=(b%c==0)?b/c:b/c+1;}else if(b<0){b=Math.Abs(b);if(a!=0){d+=(b%c==0)?b/c+1:b/c+2;}else{d+=(b%c==0)?b/c+2:b/c+3;}}if(a!=0){a=Math.Abs(a);d+=(a%c==0)?a/c+1:a/c+2;}Console.WriteLine(d);}}