結果
| 問題 |
No.2508 Discriminant
|
| コンテスト | |
| ユーザー |
crimsontea
|
| 提出日時 | 2023-10-20 23:59:17 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 1,518 ms / 2,000 ms |
| コード長 | 2,044 bytes |
| コンパイル時間 | 12,641 ms |
| コンパイル使用メモリ | 168,856 KB |
| 実行使用メモリ | 185,880 KB |
| 最終ジャッジ日時 | 2024-09-21 00:19:07 |
| 合計ジャッジ時間 | 17,421 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (101 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) /home/judge/data/code/Main.cs(32,28): warning CS8632: '#nullable' 注釈コンテキスト内のコードでのみ、Null 許容参照型の注釈を使用する必要があります。 [/home/judge/data/code/main.csproj] /home/judge/data/code/Main.cs(33,26): warning CS8632: '#nullable' 注釈コンテキスト内のコードでのみ、Null 許容参照型の注釈を使用する必要があります。 [/home/judge/data/code/main.csproj] main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Linq;
using System.Collections;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Runtime.Intrinsics.X86;
using System.Buffers;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using static InputUtility;
class Program
{
static void Main()
{
InputNewLine();
var (a, p, q) = (NextBigInteger, NextBigInteger, NextBigInteger);
var b = -p * a + -q * a;
var c = p * q * a;
var res = b * b > 4 * a * c;
Console.WriteLine(res ? "Yes" : "No");
}
}
public static class InputUtility
{
private static string[]? s_inputs;
private static string? s_raw;
private static int s_index = 0;
private static void Init() => s_index = 0;
public static int NextInt32 => int.Parse(s_inputs![s_index++]!);
public static uint NextUInt32 => uint.Parse(s_inputs![s_index++]!);
public static long NextInt64 => long.Parse(s_inputs![s_index++]!);
public static BigInteger NextBigInteger => BigInteger.Parse(s_inputs![s_index++]!);
public static string NextString => s_inputs![s_index++];
public static char NextChar => s_inputs![s_index++][0];
public static int[] GetInt32Array() => s_inputs!.Select(int.Parse).ToArray();
public static long[] GetInt64Array() => s_inputs!.Select(long.Parse).ToArray();
public static string GetRawString() => s_raw!;
#if DEBUG
private static TextReader? s_textReader;
public static void SetSource(string path) => s_textReader = new StringReader(File.ReadAllText(path));
#endif
public static bool InputNewLine()
{
#if DEBUG
if (s_textReader is TextReader sr)
{
Init();
s_raw = sr.ReadLine()!;
s_inputs = s_raw.Split(' ', StringSplitOptions.RemoveEmptyEntries);
return true;
}
#endif
Init();
s_raw = Console.ReadLine()!;
s_inputs = s_raw.Split(' ', StringSplitOptions.RemoveEmptyEntries);
return true;
}
}
crimsontea