結果

問題 No.136 Yet Another GCD Problem
ユーザー k_kadorak_kadora
提出日時 2015-06-16 21:42:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 351 bytes
コンパイル時間 3,010 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 57,952 KB
最終ジャッジ日時 2023-09-21 09:05:52
合計ジャッジ時間 9,737 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,180 KB
testcase_01 AC 118 ms
56,128 KB
testcase_02 AC 117 ms
56,748 KB
testcase_03 AC 120 ms
54,176 KB
testcase_04 AC 116 ms
55,856 KB
testcase_05 AC 123 ms
55,924 KB
testcase_06 AC 115 ms
56,488 KB
testcase_07 AC 115 ms
55,984 KB
testcase_08 AC 117 ms
56,348 KB
testcase_09 AC 117 ms
56,176 KB
testcase_10 AC 114 ms
55,804 KB
testcase_11 AC 126 ms
56,196 KB
testcase_12 AC 114 ms
56,408 KB
testcase_13 AC 114 ms
55,728 KB
testcase_14 AC 123 ms
56,108 KB
testcase_15 AC 117 ms
56,024 KB
testcase_16 AC 121 ms
55,904 KB
testcase_17 AC 122 ms
55,976 KB
testcase_18 AC 121 ms
56,324 KB
testcase_19 AC 116 ms
56,196 KB
testcase_20 AC 118 ms
56,360 KB
testcase_21 AC 118 ms
56,148 KB
testcase_22 AC 116 ms
56,116 KB
testcase_23 AC 120 ms
55,496 KB
testcase_24 AC 117 ms
55,844 KB
testcase_25 AC 113 ms
55,968 KB
testcase_26 AC 117 ms
55,620 KB
testcase_27 AC 116 ms
55,824 KB
testcase_28 AC 117 ms
55,812 KB
testcase_29 AC 119 ms
55,864 KB
testcase_30 AC 118 ms
56,176 KB
testcase_31 AC 116 ms
56,168 KB
testcase_32 AC 122 ms
56,084 KB
testcase_33 AC 118 ms
57,952 KB
testcase_34 AC 116 ms
56,140 KB
testcase_35 AC 116 ms
56,304 KB
testcase_36 AC 115 ms
56,012 KB
testcase_37 AC 116 ms
54,216 KB
testcase_38 AC 115 ms
56,084 KB
testcase_39 AC 118 ms
55,740 KB
testcase_40 AC 117 ms
56,032 KB
testcase_41 AC 117 ms
56,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yuki136{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n,k,res=1;
		n = sc.nextInt();
		k = sc.nextInt();
		if(n % 2 == 0){
			res = n /2;
		}else{
			for(int i = 3;i < n ;i++){
				if(n % i == 0){
					res = n /i;
					break;
				}
			}
		}
		System.out.println(res);
	}
}
0