結果

問題 No.889 素数!
ユーザー Beat7501Beat7501
提出日時 2019-10-25 20:38:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 709 bytes
コンパイル時間 2,939 ms
コンパイル使用メモリ 72,372 KB
実行使用メモリ 56,696 KB
最終ジャッジ日時 2023-09-29 12:33:09
合計ジャッジ時間 10,470 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
55,808 KB
testcase_01 AC 120 ms
56,308 KB
testcase_02 AC 104 ms
55,648 KB
testcase_03 AC 97 ms
55,688 KB
testcase_04 AC 104 ms
55,756 KB
testcase_05 AC 96 ms
56,020 KB
testcase_06 AC 99 ms
56,148 KB
testcase_07 AC 104 ms
56,356 KB
testcase_08 AC 99 ms
55,904 KB
testcase_09 AC 102 ms
56,108 KB
testcase_10 AC 99 ms
55,696 KB
testcase_11 AC 103 ms
56,436 KB
testcase_12 AC 100 ms
56,216 KB
testcase_13 AC 110 ms
55,976 KB
testcase_14 AC 97 ms
55,744 KB
testcase_15 AC 98 ms
55,760 KB
testcase_16 AC 102 ms
55,892 KB
testcase_17 AC 97 ms
53,820 KB
testcase_18 AC 97 ms
55,920 KB
testcase_19 AC 103 ms
56,176 KB
testcase_20 AC 101 ms
55,788 KB
testcase_21 AC 96 ms
55,844 KB
testcase_22 AC 98 ms
55,992 KB
testcase_23 AC 99 ms
56,152 KB
testcase_24 AC 99 ms
54,108 KB
testcase_25 AC 98 ms
56,120 KB
testcase_26 AC 101 ms
54,316 KB
testcase_27 AC 97 ms
54,160 KB
testcase_28 AC 103 ms
56,132 KB
testcase_29 AC 108 ms
55,556 KB
testcase_30 AC 110 ms
56,072 KB
testcase_31 AC 97 ms
56,000 KB
testcase_32 AC 101 ms
56,128 KB
testcase_33 AC 107 ms
56,332 KB
testcase_34 AC 99 ms
55,536 KB
testcase_35 AC 113 ms
56,008 KB
testcase_36 AC 100 ms
56,136 KB
testcase_37 AC 104 ms
56,012 KB
testcase_38 AC 101 ms
55,844 KB
testcase_39 AC 98 ms
55,796 KB
testcase_40 AC 110 ms
55,776 KB
testcase_41 AC 99 ms
55,800 KB
testcase_42 AC 101 ms
55,780 KB
testcase_43 AC 97 ms
55,872 KB
testcase_44 AC 104 ms
55,860 KB
testcase_45 AC 115 ms
56,248 KB
testcase_46 AC 116 ms
56,016 KB
testcase_47 AC 106 ms
55,792 KB
testcase_48 AC 98 ms
56,172 KB
testcase_49 AC 96 ms
55,860 KB
testcase_50 AC 83 ms
51,352 KB
testcase_51 AC 108 ms
56,248 KB
testcase_52 AC 101 ms
56,696 KB
testcase_53 AC 97 ms
56,516 KB
testcase_54 AC 102 ms
56,248 KB
testcase_55 AC 102 ms
56,208 KB
testcase_56 AC 104 ms
55,964 KB
testcase_57 AC 101 ms
56,068 KB
testcase_58 AC 100 ms
56,160 KB
testcase_59 AC 99 ms
55,820 KB
testcase_60 AC 99 ms
55,800 KB
testcase_61 AC 97 ms
54,032 KB
testcase_62 AC 92 ms
53,804 KB
testcase_63 AC 95 ms
56,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main6{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		boolean flag = true;
		for(int i = 2; i < n; i++){
			if(n%i==0){
				flag = false;
				break;
			}
		}
		if(n == 0 || n == 1){
			System.out.println(n);
		}else if(flag){
			System.out.println("Sosu!");
		}else{
			if(Math.sqrt(n)%1.==0){
				System.out.println("Heihosu!");
			}else{
				if(Math.cbrt(n)%1.0==0){
					System.out.println("Ripposu!");
				}else{
					int sum = 0;
					for(int i = 1; i < n; i++){
						if(n%i==0)sum+=i;
					}
					if(n==sum){
						System.out.println("Kanzensu!");
					}else{
						System.out.println(n);
					}
				}
			}
		}
	}
}
0