結果
問題 |
No.300 平方数
|
ユーザー |
|
提出日時 | 2023-08-16 10:59:27 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 36 ms / 1,000 ms |
コード長 | 821 bytes |
コンパイル時間 | 846 ms |
コンパイル使用メモリ | 111,892 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-11-24 23:16:41 |
合計ジャッジ時間 | 3,552 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var x = long.Parse(Console.ReadLine()); var k = PF(x); Console.WriteLine(k.Aggregate((x, y) => x * y)); } public static List<long> PF(long x) { var k = new List<long>(); var n = Math.Sqrt(x); for (var i = 2; i <= n; i++) { var j = 0; while (x % i == 0) { j++; x /= i; } if (j % 2 == 1) { k.Add(i); } } k.Add(x); return k; } } }