結果

問題 No.1064 ∪∩∩ / Cup Cap Cap
ユーザー kakel-san
提出日時 2025-10-17 21:09:43
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 1,513 bytes
コンパイル時間 8,575 ms
コンパイル使用メモリ 169,688 KB
実行使用メモリ 188,168 KB
最終ジャッジ日時 2025-10-17 21:09:56
合計ジャッジ時間 11,638 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (120 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray();
    static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray();
    static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
    static long[] LList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => long.Parse(ReadLine())).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var b2 = c[2] - c[0];
        var root = ((long)c[0] - c[2]) * (c[0] - c[2]) - 8L * (c[1] - c[3]);
        if (root < 0)
        {
            WriteLine("No");
        }
        else if (root == 0)
        {
            WriteLine("Yes");
        }
        else
        {
            var px = (b2 + Math.Sqrt(root)) / 4;
            var mx = (b2 - Math.Sqrt(root)) / 4;
            var py = px * px + c[0] * px + c[1];
            var my = mx * mx + c[0] * mx + c[1];
            
            var s = (double)(py - my) / (px - mx);
            WriteLine($"{s:0.0000000} {my - s * mx:0.0000000}");
        }
    }
}
0