結果
問題 |
No.300 平方数
|
ユーザー |
![]() |
提出日時 | 2018-02-19 16:06:26 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 389 bytes |
コンパイル時間 | 4,216 ms |
コンパイル使用メモリ | 74,308 KB |
実行使用メモリ | 56,028 KB |
最終ジャッジ日時 | 2024-07-07 23:55:31 |
合計ジャッジ時間 | 11,697 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 34 |
ソースコード
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; } } System.out.println(y); } }