結果

問題 No.889 素数!
ユーザー Beat7501Beat7501
提出日時 2019-10-25 20:37:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 71,596 KB
実行使用メモリ 57,852 KB
最終ジャッジ日時 2023-09-29 12:30:10
合計ジャッジ時間 13,776 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,108 KB
testcase_01 AC 125 ms
55,560 KB
testcase_02 AC 124 ms
56,220 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 125 ms
56,044 KB
testcase_06 AC 123 ms
56,084 KB
testcase_07 AC 124 ms
56,196 KB
testcase_08 AC 123 ms
55,872 KB
testcase_09 AC 124 ms
56,416 KB
testcase_10 AC 124 ms
55,716 KB
testcase_11 AC 121 ms
56,424 KB
testcase_12 AC 124 ms
56,152 KB
testcase_13 AC 122 ms
56,108 KB
testcase_14 AC 122 ms
56,244 KB
testcase_15 AC 124 ms
56,060 KB
testcase_16 AC 123 ms
55,776 KB
testcase_17 AC 124 ms
56,228 KB
testcase_18 AC 125 ms
55,984 KB
testcase_19 AC 124 ms
56,012 KB
testcase_20 AC 125 ms
55,796 KB
testcase_21 AC 130 ms
56,308 KB
testcase_22 AC 126 ms
56,232 KB
testcase_23 AC 124 ms
55,800 KB
testcase_24 AC 124 ms
56,060 KB
testcase_25 AC 124 ms
56,060 KB
testcase_26 AC 125 ms
56,184 KB
testcase_27 AC 122 ms
56,472 KB
testcase_28 AC 123 ms
56,336 KB
testcase_29 AC 121 ms
55,848 KB
testcase_30 AC 122 ms
56,008 KB
testcase_31 AC 122 ms
56,148 KB
testcase_32 AC 124 ms
55,884 KB
testcase_33 AC 123 ms
54,416 KB
testcase_34 AC 125 ms
56,236 KB
testcase_35 AC 124 ms
55,956 KB
testcase_36 AC 121 ms
56,248 KB
testcase_37 AC 120 ms
56,132 KB
testcase_38 AC 124 ms
56,200 KB
testcase_39 AC 122 ms
55,988 KB
testcase_40 AC 123 ms
55,952 KB
testcase_41 AC 123 ms
55,804 KB
testcase_42 AC 123 ms
55,988 KB
testcase_43 AC 123 ms
55,984 KB
testcase_44 AC 122 ms
55,592 KB
testcase_45 AC 124 ms
56,264 KB
testcase_46 AC 123 ms
56,008 KB
testcase_47 AC 124 ms
55,720 KB
testcase_48 AC 125 ms
56,008 KB
testcase_49 AC 126 ms
55,796 KB
testcase_50 AC 124 ms
55,992 KB
testcase_51 AC 125 ms
55,864 KB
testcase_52 AC 124 ms
55,860 KB
testcase_53 AC 125 ms
56,060 KB
testcase_54 AC 126 ms
57,852 KB
testcase_55 AC 123 ms
55,964 KB
testcase_56 AC 123 ms
55,992 KB
testcase_57 AC 123 ms
56,008 KB
testcase_58 AC 123 ms
55,668 KB
testcase_59 AC 124 ms
56,040 KB
testcase_60 AC 124 ms
56,012 KB
testcase_61 AC 124 ms
55,428 KB
testcase_62 AC 125 ms
56,076 KB
testcase_63 AC 124 ms
55,760 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(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