結果
問題 |
No.300 平方数
|
ユーザー |
![]() |
提出日時 | 2018-02-19 16:09:39 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 2,723 ms |
コンパイル使用メモリ | 74,408 KB |
実行使用メモリ | 56,100 KB |
最終ジャッジ日時 | 2024-07-08 00:07:31 |
合計ジャッジ時間 | 8,831 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 27 |
ソースコード
import java.util.Scanner; public class No300 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); long y = 1; int cnt = 0; for(long i = 2;i * i <= x;i++) { while(x % i == 0) { x /= i; cnt++; } if(cnt % 2 != 0) { y *= i; } cnt = 0; if(x == 1) { break; } } if(x != 1) { System.out.println(x); }else { System.out.println(y); } } }