結果

問題 No.550 夏休みの思い出(1)
ユーザー bluemegane
提出日時 2018-09-11 20:10:06
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 915 ms
コンパイル使用メモリ 109,908 KB
実行使用メモリ 28,552 KB
最終ジャッジ日時 2024-06-23 22:07:28
合計ジャッジ時間 21,077 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 55
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(line[0]);
        var b = long.Parse(line[1]);
        var c = long.Parse(line[2]);
         getAns1(a, b, c);
    }
    public static void getAns1 (long a, long b, long c)
    {
        for (int i = -1000000; i <= 1000000; i++)
        {
            if (check(a, b, c, i)) { Console.WriteLine(i); }
        }
    }
    public  static  bool check (long a, long b, long c , long n)
    {
        var k1 = Math.Pow(n, 3);
        var k2 = a * Math.Pow(n, 2);
        var k3 = b * Math.Pow(n, 1);
        var k4 = (double)c;
        return Math.Abs(k1 + k2 + k3 + k4) < 0.4d;
    }
}
0