結果

問題 No.550 夏休みの思い出(1)
ユーザー RisenRisen
提出日時 2017-07-28 23:27:48
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 898 bytes
コンパイル時間 806 ms
コンパイル使用メモリ 112,760 KB
実行使用メモリ 30,136 KB
最終ジャッジ日時 2024-04-18 11:54:23
合計ジャッジ時間 4,014 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 33 ms
20,096 KB
testcase_03 AC 34 ms
19,840 KB
testcase_04 AC 35 ms
20,096 KB
testcase_05 AC 35 ms
20,096 KB
testcase_06 AC 36 ms
20,096 KB
testcase_07 AC 34 ms
19,712 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 33 ms
19,968 KB
testcase_12 AC 32 ms
20,224 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 34 ms
19,712 KB
testcase_23 AC 33 ms
19,968 KB
testcase_24 AC 30 ms
19,712 KB
testcase_25 AC 33 ms
20,096 KB
testcase_26 AC 34 ms
20,224 KB
testcase_27 AC 32 ms
20,224 KB
testcase_28 AC 31 ms
19,840 KB
testcase_29 AC 35 ms
20,096 KB
testcase_30 AC 33 ms
19,968 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 31 ms
19,968 KB
testcase_41 AC 31 ms
19,968 KB
testcase_42 AC 31 ms
19,968 KB
testcase_43 AC 32 ms
20,096 KB
testcase_44 AC 32 ms
19,712 KB
testcase_45 AC 35 ms
19,968 KB
testcase_46 AC 33 ms
19,712 KB
testcase_47 AC 34 ms
19,968 KB
testcase_48 AC 34 ms
20,096 KB
testcase_49 AC 34 ms
20,096 KB
testcase_50 AC 33 ms
20,096 KB
testcase_51 AC 34 ms
19,968 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(long.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