結果

問題 No.300 平方数
ユーザー kano_town
提出日時 2015-11-13 23:14:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 3,712 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 41,816 KB
最終ジャッジ日時 2024-09-13 15:10:57
合計ジャッジ時間 13,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder300 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong(), y = 1;
        double z;

        for (int i = 2; i < 10000; i++) {
            if (x % (i * i) == 0) x /= (i * i);
        }
        System.out.println(x);
        for (y = 1; y <= x; y++) {
            z = (int) Math.sqrt(x * y);
            if (z * z == x * y) break;
        }
        System.out.println(y);
    }
}
0