結果
問題 | No.1593 Perfect Distance |
ユーザー |
![]() |
提出日時 | 2021-07-10 07:20:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 539 bytes |
コンパイル時間 | 797 ms |
コンパイル使用メモリ | 107,404 KB |
実行使用メモリ | 23,168 KB |
最終ジャッジ日時 | 2024-07-02 01:40:12 |
合計ジャッジ時間 | 6,183 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 10 TLE * 1 -- * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; public class Hello { static void Main() { var n = long.Parse(Console.ReadLine().Trim()); var n2 = n * n; getAns(n2); } static void getAns (long t) { var count = 0; for (long i = 1; i * i <= t; i++) for (long j = i; i *j<=t; j++) { if (i *i + j * j == t) { if (i == j) count++; else count += 2; } } Console.WriteLine(count); } }