結果

問題 No.800 四平方定理
ユーザー keymoonkeymoon
提出日時 2019-03-28 21:20:05
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 826 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 107,904 KB
実行使用メモリ 192,960 KB
最終ジャッジ日時 2024-04-22 14:53:26
合計ジャッジ時間 8,220 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
29,728 KB
testcase_01 AC 70 ms
29,184 KB
testcase_02 AC 55 ms
24,064 KB
testcase_03 AC 65 ms
28,416 KB
testcase_04 AC 54 ms
24,320 KB
testcase_05 AC 67 ms
28,160 KB
testcase_06 AC 77 ms
29,056 KB
testcase_07 AC 73 ms
30,080 KB
testcase_08 AC 80 ms
30,080 KB
testcase_09 AC 72 ms
28,928 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using LayoutKind = System.Runtime.InteropServices.LayoutKind;

static class P
{
    static void Main()
    {
        var nd = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] pows = Enumerable.Range(1, nd[0]).Select(x => x * x).ToArray();
        var dict = pows.SelectMany(x => pows.Select(y => x - y + nd[1])).GroupBy(x => x).Where(x => x.Key >= 0).ToDictionary(x => x.Key, x => x.Count());
        Console.WriteLine(pows.SelectMany(x => pows.Select(y => x + y)).Sum(x => dict.ContainsKey(x) ? dict[x] : 0));
    }
}
0