結果

問題 No.550 夏休みの思い出(1)
ユーザー RisenRisen
提出日時 2017-07-29 00:15:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 900 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 116,616 KB
実行使用メモリ 27,996 KB
最終ジャッジ日時 2024-04-18 13:55:59
合計ジャッジ時間 5,402 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 34 ms
19,712 KB
testcase_03 AC 33 ms
19,840 KB
testcase_04 AC 33 ms
19,840 KB
testcase_05 AC 33 ms
19,712 KB
testcase_06 AC 33 ms
19,968 KB
testcase_07 AC 33 ms
19,840 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 33 ms
19,584 KB
testcase_12 AC 33 ms
19,712 KB
testcase_13 AC 33 ms
19,712 KB
testcase_14 AC 34 ms
19,840 KB
testcase_15 AC 33 ms
19,840 KB
testcase_16 AC 32 ms
19,584 KB
testcase_17 AC 33 ms
19,840 KB
testcase_18 AC 34 ms
19,840 KB
testcase_19 AC 33 ms
19,840 KB
testcase_20 AC 34 ms
19,968 KB
testcase_21 AC 34 ms
19,712 KB
testcase_22 AC 34 ms
19,712 KB
testcase_23 AC 34 ms
19,968 KB
testcase_24 AC 33 ms
19,712 KB
testcase_25 AC 33 ms
19,712 KB
testcase_26 AC 33 ms
19,968 KB
testcase_27 AC 33 ms
19,968 KB
testcase_28 AC 34 ms
19,584 KB
testcase_29 AC 35 ms
19,840 KB
testcase_30 AC 33 ms
19,584 KB
testcase_31 AC 33 ms
19,584 KB
testcase_32 AC 33 ms
19,840 KB
testcase_33 AC 33 ms
19,712 KB
testcase_34 AC 33 ms
19,840 KB
testcase_35 AC 32 ms
19,584 KB
testcase_36 AC 32 ms
19,840 KB
testcase_37 AC 33 ms
19,968 KB
testcase_38 AC 33 ms
19,584 KB
testcase_39 AC 33 ms
19,968 KB
testcase_40 AC 34 ms
19,584 KB
testcase_41 AC 33 ms
19,840 KB
testcase_42 AC 33 ms
19,968 KB
testcase_43 AC 33 ms
19,840 KB
testcase_44 AC 34 ms
19,712 KB
testcase_45 AC 34 ms
19,968 KB
testcase_46 AC 34 ms
19,840 KB
testcase_47 AC 34 ms
19,584 KB
testcase_48 AC 34 ms
19,840 KB
testcase_49 AC 34 ms
20,096 KB
testcase_50 AC 34 ms
19,840 KB
testcase_51 AC 33 ms
19,840 KB
testcase_52 AC 31 ms
19,968 KB
testcase_53 AC 34 ms
20,096 KB
testcase_54 AC 34 ms
19,840 KB
testcase_55 AC 35 ms
19,840 KB
testcase_56 AC 34 ms
20,096 KB
testcase_57 AC 34 ms
19,584 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;
using System.Linq;

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