結果
問題 |
No.550 夏休みの思い出(1)
|
ユーザー |
![]() |
提出日時 | 2018-09-11 20:12:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 846 bytes |
コンパイル時間 | 949 ms |
コンパイル使用メモリ | 109,628 KB |
実行使用メモリ | 28,668 KB |
最終ジャッジ日時 | 2024-06-23 22:10:48 |
合計ジャッジ時間 | 20,842 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 54 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic; 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) { var ans = new List<int>(); for (int i = -1000000; i <= 1000000; i++) { if (check(a, b, c, i)) ans.Add(i); } Console.WriteLine(string.Join(" ",ans)); } 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; } }