結果
問題 | No.955 ax^2+bx+c=0 |
ユーザー | fgwiebfaoish |
提出日時 | 2019-12-18 00:51:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,750 bytes |
コンパイル時間 | 1,528 ms |
コンパイル使用メモリ | 114,132 KB |
実行使用メモリ | 29,216 KB |
最終ジャッジ日時 | 2024-07-07 00:03:27 |
合計ジャッジ時間 | 7,395 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
24,704 KB |
testcase_01 | AC | 26 ms
24,964 KB |
testcase_02 | AC | 24 ms
23,936 KB |
testcase_03 | AC | 25 ms
26,024 KB |
testcase_04 | AC | 25 ms
25,852 KB |
testcase_05 | AC | 26 ms
24,112 KB |
testcase_06 | AC | 25 ms
23,820 KB |
testcase_07 | AC | 24 ms
24,200 KB |
testcase_08 | AC | 25 ms
23,984 KB |
testcase_09 | AC | 24 ms
23,732 KB |
testcase_10 | AC | 23 ms
23,984 KB |
testcase_11 | AC | 23 ms
23,808 KB |
testcase_12 | AC | 24 ms
25,892 KB |
testcase_13 | AC | 23 ms
25,984 KB |
testcase_14 | AC | 26 ms
24,704 KB |
testcase_15 | AC | 25 ms
26,080 KB |
testcase_16 | AC | 25 ms
24,960 KB |
testcase_17 | AC | 25 ms
23,932 KB |
testcase_18 | AC | 26 ms
24,960 KB |
testcase_19 | AC | 25 ms
24,068 KB |
testcase_20 | AC | 26 ms
24,960 KB |
testcase_21 | AC | 26 ms
25,828 KB |
testcase_22 | AC | 28 ms
26,868 KB |
testcase_23 | AC | 26 ms
26,088 KB |
testcase_24 | AC | 26 ms
24,700 KB |
testcase_25 | AC | 24 ms
24,032 KB |
testcase_26 | AC | 25 ms
24,704 KB |
testcase_27 | AC | 25 ms
23,856 KB |
testcase_28 | AC | 27 ms
24,580 KB |
testcase_29 | AC | 25 ms
25,944 KB |
testcase_30 | AC | 25 ms
22,456 KB |
testcase_31 | AC | 24 ms
23,776 KB |
testcase_32 | AC | 26 ms
24,880 KB |
testcase_33 | AC | 27 ms
23,904 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 | 28 ms
24,704 KB |
testcase_63 | AC | 28 ms
25,128 KB |
testcase_64 | AC | 24 ms
22,192 KB |
testcase_65 | AC | 27 ms
25,136 KB |
testcase_66 | AC | 24 ms
25,900 KB |
testcase_67 | AC | 29 ms
24,956 KB |
testcase_68 | AC | 25 ms
26,360 KB |
testcase_69 | AC | 29 ms
25,256 KB |
testcase_70 | AC | 28 ms
24,880 KB |
testcase_71 | AC | 24 ms
24,064 KB |
testcase_72 | AC | 25 ms
26,288 KB |
testcase_73 | AC | 27 ms
23,224 KB |
testcase_74 | AC | 31 ms
24,832 KB |
testcase_75 | AC | 26 ms
23,676 KB |
testcase_76 | AC | 26 ms
25,720 KB |
testcase_77 | AC | 27 ms
24,832 KB |
testcase_78 | AC | 28 ms
23,092 KB |
testcase_79 | AC | 30 ms
24,964 KB |
testcase_80 | AC | 27 ms
25,848 KB |
testcase_81 | AC | 30 ms
26,920 KB |
testcase_82 | AC | 25 ms
23,988 KB |
testcase_83 | AC | 25 ms
22,708 KB |
testcase_84 | AC | 27 ms
26,488 KB |
testcase_85 | AC | 26 ms
22,456 KB |
testcase_86 | AC | 26 ms
24,832 KB |
testcase_87 | AC | 25 ms
23,980 KB |
testcase_88 | AC | 25 ms
24,576 KB |
testcase_89 | AC | 26 ms
24,832 KB |
testcase_90 | AC | 26 ms
24,844 KB |
testcase_91 | AC | 27 ms
24,492 KB |
testcase_92 | AC | 24 ms
23,988 KB |
testcase_93 | AC | 23 ms
21,684 KB |
testcase_94 | AC | 26 ms
24,756 KB |
testcase_95 | AC | 25 ms
24,752 KB |
testcase_96 | AC | 26 ms
26,736 KB |
testcase_97 | AC | 27 ms
26,620 KB |
testcase_98 | AC | 26 ms
22,704 KB |
testcase_99 | AC | 26 ms
26,856 KB |
testcase_100 | AC | 29 ms
23,976 KB |
testcase_101 | AC | 26 ms
26,740 KB |
testcase_102 | AC | 26 ms
24,844 KB |
testcase_103 | AC | 27 ms
24,964 KB |
testcase_104 | AC | 27 ms
24,960 KB |
testcase_105 | AC | 26 ms
22,708 KB |
testcase_106 | AC | 26 ms
24,452 KB |
testcase_107 | AC | 26 ms
24,752 KB |
testcase_108 | AC | 27 ms
26,604 KB |
testcase_109 | AC | 27 ms
24,704 KB |
testcase_110 | AC | 27 ms
26,996 KB |
testcase_111 | AC | 26 ms
26,616 KB |
testcase_112 | AC | 28 ms
26,744 KB |
testcase_113 | AC | 28 ms
24,492 KB |
testcase_114 | AC | 27 ms
26,604 KB |
testcase_115 | AC | 28 ms
24,556 KB |
testcase_116 | AC | 27 ms
24,812 KB |
testcase_117 | AC | 28 ms
24,708 KB |
testcase_118 | AC | 26 ms
24,704 KB |
testcase_119 | AC | 26 ms
24,620 KB |
testcase_120 | AC | 26 ms
24,960 KB |
testcase_121 | AC | 27 ms
24,704 KB |
testcase_122 | WA | - |
testcase_123 | AC | 30 ms
25,088 KB |
testcase_124 | AC | 29 ms
26,876 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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;} }