結果

問題 No.955 ax^2+bx+c=0
ユーザー fgwiebfaoishfgwiebfaoish
提出日時 2019-12-18 00:51:26
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,750 bytes
コンパイル時間 3,601 ms
コンパイル使用メモリ 107,364 KB
実行使用メモリ 26,744 KB
最終ジャッジ日時 2023-09-21 05:32:57
合計ジャッジ時間 16,677 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
24,612 KB
testcase_01 AC 70 ms
22,624 KB
testcase_02 AC 65 ms
20,880 KB
testcase_03 AC 63 ms
20,760 KB
testcase_04 AC 62 ms
20,704 KB
testcase_05 AC 64 ms
20,780 KB
testcase_06 AC 62 ms
18,776 KB
testcase_07 AC 65 ms
20,780 KB
testcase_08 AC 63 ms
22,816 KB
testcase_09 AC 66 ms
22,792 KB
testcase_10 AC 63 ms
20,888 KB
testcase_11 AC 62 ms
20,796 KB
testcase_12 AC 62 ms
18,736 KB
testcase_13 AC 64 ms
20,860 KB
testcase_14 AC 69 ms
22,680 KB
testcase_15 AC 68 ms
20,824 KB
testcase_16 AC 69 ms
24,728 KB
testcase_17 AC 67 ms
20,764 KB
testcase_18 AC 70 ms
22,712 KB
testcase_19 AC 66 ms
20,836 KB
testcase_20 AC 70 ms
24,588 KB
testcase_21 AC 67 ms
20,776 KB
testcase_22 AC 70 ms
24,676 KB
testcase_23 AC 66 ms
20,908 KB
testcase_24 AC 70 ms
22,616 KB
testcase_25 AC 68 ms
22,752 KB
testcase_26 AC 76 ms
22,696 KB
testcase_27 AC 68 ms
20,804 KB
testcase_28 AC 72 ms
20,396 KB
testcase_29 AC 66 ms
20,836 KB
testcase_30 AC 69 ms
22,584 KB
testcase_31 AC 66 ms
20,888 KB
testcase_32 AC 71 ms
24,596 KB
testcase_33 AC 68 ms
20,772 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 AC 72 ms
22,596 KB
testcase_63 AC 74 ms
20,648 KB
testcase_64 AC 63 ms
20,756 KB
testcase_65 AC 74 ms
24,696 KB
testcase_66 AC 64 ms
20,764 KB
testcase_67 AC 74 ms
22,672 KB
testcase_68 AC 63 ms
20,864 KB
testcase_69 AC 74 ms
22,756 KB
testcase_70 AC 72 ms
22,624 KB
testcase_71 AC 64 ms
22,816 KB
testcase_72 AC 63 ms
20,824 KB
testcase_73 AC 72 ms
22,656 KB
testcase_74 AC 72 ms
22,676 KB
testcase_75 AC 62 ms
22,796 KB
testcase_76 AC 63 ms
20,776 KB
testcase_77 AC 72 ms
22,704 KB
testcase_78 AC 72 ms
24,688 KB
testcase_79 AC 73 ms
24,804 KB
testcase_80 AC 63 ms
20,880 KB
testcase_81 AC 74 ms
22,540 KB
testcase_82 AC 67 ms
20,808 KB
testcase_83 AC 71 ms
24,596 KB
testcase_84 AC 70 ms
22,684 KB
testcase_85 AC 69 ms
22,700 KB
testcase_86 AC 69 ms
24,736 KB
testcase_87 AC 66 ms
20,772 KB
testcase_88 AC 69 ms
24,668 KB
testcase_89 AC 68 ms
22,632 KB
testcase_90 AC 68 ms
20,636 KB
testcase_91 AC 72 ms
22,624 KB
testcase_92 AC 63 ms
20,876 KB
testcase_93 AC 62 ms
20,872 KB
testcase_94 AC 69 ms
22,744 KB
testcase_95 AC 70 ms
22,644 KB
testcase_96 AC 69 ms
22,636 KB
testcase_97 AC 68 ms
22,584 KB
testcase_98 AC 69 ms
20,664 KB
testcase_99 AC 71 ms
22,732 KB
testcase_100 AC 64 ms
20,728 KB
testcase_101 AC 69 ms
20,588 KB
testcase_102 AC 70 ms
20,592 KB
testcase_103 AC 73 ms
22,608 KB
testcase_104 AC 71 ms
22,664 KB
testcase_105 AC 71 ms
24,704 KB
testcase_106 AC 70 ms
24,696 KB
testcase_107 AC 71 ms
22,628 KB
testcase_108 AC 70 ms
22,604 KB
testcase_109 AC 72 ms
24,628 KB
testcase_110 AC 71 ms
24,632 KB
testcase_111 AC 71 ms
24,552 KB
testcase_112 AC 70 ms
22,648 KB
testcase_113 AC 71 ms
22,584 KB
testcase_114 AC 71 ms
22,728 KB
testcase_115 AC 71 ms
24,740 KB
testcase_116 AC 76 ms
20,728 KB
testcase_117 AC 73 ms
24,712 KB
testcase_118 AC 71 ms
22,876 KB
testcase_119 AC 71 ms
22,720 KB
testcase_120 AC 71 ms
22,724 KB
testcase_121 AC 71 ms
24,624 KB
testcase_122 WA -
testcase_123 AC 72 ms
24,728 KB
testcase_124 AC 71 ms
22,568 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.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.Da;
		if(s[0]==0&&s[1]==0){
			Console.WriteLine("{0}",s[2]==0?-1:0);
		}
		else if(s[0]==0){
			Console.WriteLine("{0}",1);
			Console.WriteLine("{0}",-s[2]/s[1]);
		}
		else{
			double d=s[1]*s[1]-4*s[0]*s[2];
			if(d>0){
				Console.WriteLine("{0}",2);
				var h=new double[]{(-s[1]+Sqrt(d))/(2*s[0]),(-s[1]-Sqrt(d))/(2*s[0])};
				Array.Sort(h);
				Console.WriteLine("{0}",h[0]);
				Console.WriteLine("{0}",h[1]);
			}
			else if(d==0){
				Console.WriteLine("{0}",1);
				Console.WriteLine("{0}",-s[1]/(2*s[0]));
			}
			else{
				Console.WriteLine("{0}",0);
			}
		}
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}
0