結果

問題 No.300 平方数
ユーザー nanophoto12nanophoto12
提出日時 2015-11-15 10:20:37
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 450 bytes
コンパイル時間 2,943 ms
コンパイル使用メモリ 72,296 KB
実行使用メモリ 58,284 KB
最終ジャッジ日時 2023-10-11 17:50:33
合計ジャッジ時間 9,954 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,448 KB
testcase_01 AC 125 ms
55,868 KB
testcase_02 RE -
testcase_03 AC 126 ms
55,544 KB
testcase_04 AC 126 ms
55,748 KB
testcase_05 AC 127 ms
55,644 KB
testcase_06 AC 127 ms
55,920 KB
testcase_07 AC 126 ms
55,724 KB
testcase_08 AC 126 ms
55,620 KB
testcase_09 AC 124 ms
55,636 KB
testcase_10 AC 125 ms
55,996 KB
testcase_11 AC 125 ms
55,812 KB
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int z = (int)Math.sqrt(a);
        while(true)
        {
            int z2 = z*z;
            if(z2 % a == 0)
            {
                System.out.println(z2 / a);
                return;
            }
            z++;
        }
    }
}
0