結果

問題 No.1218 Something Like a Theorem
ユーザー keymoonkeymoon
提出日時 2020-09-04 21:42:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 3,660 ms
コンパイル使用メモリ 106,564 KB
実行使用メモリ 24,444 KB
最終ジャッジ日時 2023-08-17 15:18:59
合計ジャッジ時間 4,090 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,060 KB
testcase_01 AC 62 ms
24,408 KB
testcase_02 AC 59 ms
21,860 KB
testcase_03 AC 60 ms
19,956 KB
testcase_04 AC 61 ms
23,932 KB
testcase_05 AC 59 ms
21,780 KB
testcase_06 AC 59 ms
22,116 KB
testcase_07 AC 71 ms
24,164 KB
testcase_08 AC 74 ms
22,036 KB
testcase_09 AC 103 ms
22,124 KB
testcase_10 AC 65 ms
24,104 KB
testcase_11 AC 59 ms
22,116 KB
testcase_12 AC 60 ms
24,204 KB
testcase_13 AC 58 ms
22,292 KB
testcase_14 AC 60 ms
22,216 KB
testcase_15 AC 58 ms
24,444 KB
testcase_16 AC 58 ms
22,220 KB
testcase_17 AC 59 ms
22,324 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;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var nz = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var n = nz[0];
        var z = nz[1];
        if (n == 1)
        {
            Console.WriteLine(z != 1 ? "Yes" : "No");
            return;
        }
        for (int i = 1; i <= z; i++)
        {
            for (int j = 1; j <= z; j++)
            {
                if (Pow(i, n) + Pow(j, n) == Pow(z, n))
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
        }
        Console.WriteLine("No");
        return;
    }
}
0