結果

問題 No.2352 Sharpened Knife in Fall
ユーザー 👑 kakel-sankakel-san
提出日時 2023-08-09 07:12:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 582 ms / 3,000 ms
コード長 1,175 bytes
コンパイル時間 1,235 ms
コンパイル使用メモリ 108,416 KB
実行使用メモリ 32,128 KB
最終ジャッジ日時 2024-04-26 21:56:44
合計ジャッジ時間 15,128 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
20,480 KB
testcase_01 AC 30 ms
19,584 KB
testcase_02 AC 31 ms
20,480 KB
testcase_03 AC 30 ms
19,584 KB
testcase_04 AC 300 ms
32,128 KB
testcase_05 AC 29 ms
19,584 KB
testcase_06 AC 561 ms
31,488 KB
testcase_07 AC 295 ms
26,112 KB
testcase_08 AC 582 ms
31,616 KB
testcase_09 AC 579 ms
31,488 KB
testcase_10 AC 573 ms
31,744 KB
testcase_11 AC 565 ms
31,488 KB
testcase_12 AC 562 ms
31,360 KB
testcase_13 AC 557 ms
31,232 KB
testcase_14 AC 265 ms
25,856 KB
testcase_15 AC 509 ms
31,104 KB
testcase_16 AC 59 ms
20,708 KB
testcase_17 AC 45 ms
20,436 KB
testcase_18 AC 218 ms
24,064 KB
testcase_19 AC 455 ms
30,080 KB
testcase_20 AC 197 ms
23,680 KB
testcase_21 AC 192 ms
23,680 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 static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray();
    static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (r, k) = (c[0], c[1]);
        var piece = Math.PI * r * r / (k + 1);
        var ans = new double[k];
        for (var i = 0; i < k; ++i)
        {
            var ok = (double)r;
            var ng = - (double)r;
            while (ok - ng > 0.000001)
            {
                var mid = (ok + ng) / 2;
                var th = Math.PI - Math.Acos(mid / r);
                var area = th * r * r + mid * r * Math.Sin(th);
                if (area >= piece * (i + 1)) ok = mid;
                else ng = mid;
            }
            ans[i] = ok;
        }
        WriteLine(string.Join("\n", ans));
    }
}
0