結果

問題 No.48 ロボットの操縦
ユーザー #ラス+#ラス+
提出日時 2019-11-12 12:48:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 1,186 bytes
コンパイル時間 3,191 ms
コンパイル使用メモリ 112,048 KB
実行使用メモリ 24,280 KB
最終ジャッジ日時 2023-10-19 01:56:51
合計ジャッジ時間 2,536 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,280 KB
testcase_01 AC 26 ms
24,280 KB
testcase_02 AC 26 ms
24,280 KB
testcase_03 AC 26 ms
24,280 KB
testcase_04 AC 26 ms
24,280 KB
testcase_05 AC 26 ms
24,280 KB
testcase_06 AC 26 ms
24,280 KB
testcase_07 AC 26 ms
24,280 KB
testcase_08 AC 26 ms
24,280 KB
testcase_09 AC 26 ms
24,280 KB
testcase_10 AC 26 ms
24,280 KB
testcase_11 AC 26 ms
24,280 KB
testcase_12 AC 26 ms
24,280 KB
testcase_13 AC 26 ms
24,280 KB
testcase_14 AC 26 ms
24,280 KB
testcase_15 AC 26 ms
24,280 KB
testcase_16 AC 26 ms
24,280 KB
testcase_17 AC 26 ms
24,280 KB
testcase_18 AC 26 ms
24,280 KB
testcase_19 AC 26 ms
24,280 KB
testcase_20 AC 26 ms
24,280 KB
testcase_21 AC 26 ms
24,280 KB
testcase_22 AC 26 ms
24,280 KB
testcase_23 AC 26 ms
24,280 KB
testcase_24 AC 26 ms
24,280 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
class Start{
  static void Solve(){
    var ans=1;
    var X=Rint();
    var Y=Rint();
    if(Y<0)ans++;
    else if(X==0)ans--;
    var x=Abs(X);
    var y=Abs(Y);
    var l=Rint();
    WriteLine(ans+(x+l-1)/l+(y+l-1)/l);
  }
  static void Main(){
    READ_COUNT=0;
    READ=In.ReadToEnd().Split(' ','\n');
    var sw=new StreamWriter(OpenStandardOutput()){AutoFlush=false};
    SetOut(sw);
    Solve();
    Out.Flush();
  }
  const long MOD=1000000007L;
  static void Swap<T>(ref T a,ref T b){T c=a;a=b;b=c;}
  static string Read()=>READ[READ_COUNT++];
  static int Rint()=>int.Parse(READ[READ_COUNT++]);
  static long Rlong()=>long.Parse(READ[READ_COUNT++]);
  static double Rdouble()=>double.Parse(READ[READ_COUNT++]);
  static char Rchar()=>READ[READ_COUNT++][0];
  static string[] READ;static int READ_COUNT;
}
class Pair<T1,T2>:IComparable<Pair<T1,T2>>where T1:IComparable<T1>where T2:IComparable<T2>{
  public T1 F;public T2 S;
  public Pair(T1 f,T2 s){F=f;S=s;}
  public int CompareTo(Pair<T1,T2> p)=>F.CompareTo(p.F)!=0?F.CompareTo(p.F):S.CompareTo(p.S);
}
0