結果
| 問題 | No.1218 Something Like a Theorem |
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2020-09-04 22:41:34 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 573 bytes |
| 記録 | |
| コンパイル時間 | 4,315 ms |
| コンパイル使用メモリ | 109,060 KB |
| 実行使用メモリ | 28,428 KB |
| 最終ジャッジ日時 | 2024-11-26 20:32:31 |
| 合計ジャッジ時間 | 5,529 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 7 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using static System.Math;
using System;
public class Hello
{
static void Main()
{
string[] line = Console.ReadLine().Trim().Split(' ');
var n = int.Parse(line[0]);
var z = int.Parse(line[1]);
getAns(2, 5);
}
static void getAns(int n, int z)
{
var zn = (int)Pow(z, n);
for (int i = 1; i <= z; i++)
for (int j = i; j <= z; j++)
{
if ((int)Pow(i, n) + (int)Pow(j, n) == zn) { Console.WriteLine("Yes"); return; }
}
Console.WriteLine("No");
}
}
bluemegane