結果
問題 |
No.300 平方数
|
ユーザー |
|
提出日時 | 2015-11-13 22:27:06 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 613 bytes |
コンパイル時間 | 3,324 ms |
コンパイル使用メモリ | 74,608 KB |
実行使用メモリ | 54,560 KB |
最終ジャッジ日時 | 2024-09-13 14:38:46 |
合計ジャッジ時間 | 12,670 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 22 |
ソースコード
import java.util.ArrayList; import java.util.Scanner; public class Main299 { public static void main(String[] args) { new Main299(); } public Main299() { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); System.out.println(solve(x)); } public long solve(long x) { long res = 1; for (long i = 2; i * i < (10e+12) + 1; i++) { int count = 0; while (x % i == 0) { x /= i; count++; } res *= count % 2 == 1 ? i : 1; } return res; } }