結果

問題 No.550 夏休みの思い出(1)
ユーザー RisenRisen
提出日時 2017-07-29 01:16:20
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 842 bytes
コンパイル時間 1,141 ms
コンパイル使用メモリ 111,916 KB
実行使用メモリ 30,184 KB
最終ジャッジ日時 2024-04-18 18:07:14
合計ジャッジ時間 4,151 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
24,244 KB
testcase_02 AC 31 ms
26,148 KB
testcase_03 AC 30 ms
26,224 KB
testcase_04 AC 31 ms
24,116 KB
testcase_05 AC 32 ms
24,112 KB
testcase_06 AC 32 ms
26,280 KB
testcase_07 AC 33 ms
26,164 KB
testcase_08 AC 34 ms
26,024 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 31 ms
26,220 KB
testcase_12 AC 35 ms
26,348 KB
testcase_13 AC 30 ms
23,728 KB
testcase_14 AC 32 ms
26,280 KB
testcase_15 AC 33 ms
24,116 KB
testcase_16 AC 31 ms
25,700 KB
testcase_17 AC 32 ms
26,024 KB
testcase_18 AC 33 ms
28,400 KB
testcase_19 AC 37 ms
28,008 KB
testcase_20 AC 34 ms
26,084 KB
testcase_21 AC 32 ms
25,900 KB
testcase_22 AC 31 ms
26,232 KB
testcase_23 AC 33 ms
26,224 KB
testcase_24 AC 31 ms
26,024 KB
testcase_25 AC 33 ms
26,084 KB
testcase_26 AC 36 ms
26,148 KB
testcase_27 AC 35 ms
26,020 KB
testcase_28 AC 35 ms
26,152 KB
testcase_29 AC 36 ms
28,008 KB
testcase_30 AC 36 ms
26,348 KB
testcase_31 AC 36 ms
28,392 KB
testcase_32 AC 37 ms
26,280 KB
testcase_33 AC 34 ms
26,028 KB
testcase_34 AC 33 ms
24,124 KB
testcase_35 AC 32 ms
23,988 KB
testcase_36 AC 33 ms
26,276 KB
testcase_37 AC 33 ms
26,028 KB
testcase_38 AC 31 ms
23,988 KB
testcase_39 AC 34 ms
26,276 KB
testcase_40 AC 32 ms
28,060 KB
testcase_41 AC 33 ms
26,148 KB
testcase_42 AC 34 ms
26,212 KB
testcase_43 AC 32 ms
28,144 KB
testcase_44 AC 35 ms
26,096 KB
testcase_45 AC 32 ms
28,064 KB
testcase_46 AC 31 ms
26,152 KB
testcase_47 AC 31 ms
26,152 KB
testcase_48 AC 31 ms
26,344 KB
testcase_49 AC 30 ms
26,020 KB
testcase_50 AC 31 ms
25,972 KB
testcase_51 AC 31 ms
26,148 KB
testcase_52 AC 32 ms
26,160 KB
testcase_53 AC 36 ms
26,220 KB
testcase_54 AC 33 ms
26,032 KB
testcase_55 AC 32 ms
28,140 KB
testcase_56 AC 33 ms
26,152 KB
testcase_57 AC 32 ms
26,348 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.Linq;

class Solution
{
    static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(decimal.Parse).ToArray();
        var a = vals[0];
        var b = vals[1];
        var c = vals[2];
        // カルダノの方法
        double p = (double)(-a * a / 9 + b / 3);
        double q = (double)(a * a * a / 27 - a * b / 6 + c / 2);
        var lamda = 2 * Math.Sqrt(-p);
        var theta = Math.Acos(-q / Math.Sqrt(-1.0 * p * p * p)) / 3;
        var gamma = (double)a / 3;
        var x = new double[3];
        x[0] = lamda * Math.Cos(theta) - gamma;
        x[1] = lamda * Math.Cos(theta + 2 * Math.PI / 3) - gamma;
        x[2] = lamda * Math.Cos(theta - 2 * Math.PI / 3) - gamma;
        Console.WriteLine(string.Join(" ", x.OrderBy(d => d).Select(d => (long)Math.Round(d))));
    }
}
0