結果

問題 No.98 円を描こう
ユーザー yuki2006yuki2006
提出日時 2018-01-22 14:58:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 638 bytes
コンパイル時間 2,396 ms
コンパイル使用メモリ 99,608 KB
実行使用メモリ 22,840 KB
最終ジャッジ日時 2023-08-26 21:09:41
合計ジャッジ時間 3,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,808 KB
testcase_01 AC 58 ms
20,712 KB
testcase_02 AC 56 ms
20,720 KB
testcase_03 AC 57 ms
20,852 KB
testcase_04 AC 57 ms
20,712 KB
testcase_05 AC 58 ms
20,700 KB
testcase_06 AC 57 ms
22,780 KB
testcase_07 AC 58 ms
20,804 KB
testcase_08 AC 58 ms
20,896 KB
testcase_09 AC 58 ms
22,840 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.Collections.Generic;

namespace lecture
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] A = Console.ReadLine().Split();
            int x = int.Parse(A[0]);
            int y = int.Parse(A[1]);

            // 点pまでの距離 
            double r = Math.Sqrt(x * x + y * y);
            // 直径
            double d = 2 * r;

            // 1足しておいて切り捨てる
            // intにキャストすると切り捨てすることができる
            int ans = (int)(d+1);

            Console.WriteLine(ans);

        }

    }
}
0