結果

問題 No.136 Yet Another GCD Problem
ユーザー kenji_shioyakenji_shioya
提出日時 2016-07-05 00:19:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 358 bytes
コンパイル時間 2,978 ms
コンパイル使用メモリ 74,968 KB
実行使用メモリ 41,684 KB
最終ジャッジ日時 2024-04-20 21:59:07
合計ジャッジ時間 8,877 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
41,492 KB
testcase_01 AC 108 ms
41,268 KB
testcase_02 AC 120 ms
41,144 KB
testcase_03 AC 121 ms
40,972 KB
testcase_04 AC 114 ms
41,448 KB
testcase_05 AC 123 ms
41,368 KB
testcase_06 AC 119 ms
41,480 KB
testcase_07 AC 121 ms
41,408 KB
testcase_08 AC 117 ms
41,428 KB
testcase_09 AC 117 ms
41,368 KB
testcase_10 AC 107 ms
41,320 KB
testcase_11 AC 118 ms
41,180 KB
testcase_12 AC 107 ms
40,112 KB
testcase_13 AC 122 ms
41,396 KB
testcase_14 AC 105 ms
40,184 KB
testcase_15 AC 108 ms
41,580 KB
testcase_16 AC 106 ms
40,188 KB
testcase_17 AC 109 ms
39,900 KB
testcase_18 AC 119 ms
41,292 KB
testcase_19 AC 114 ms
41,244 KB
testcase_20 AC 105 ms
40,040 KB
testcase_21 AC 122 ms
41,300 KB
testcase_22 AC 126 ms
41,684 KB
testcase_23 AC 125 ms
41,148 KB
testcase_24 AC 116 ms
41,224 KB
testcase_25 AC 122 ms
41,192 KB
testcase_26 AC 118 ms
41,660 KB
testcase_27 AC 104 ms
41,180 KB
testcase_28 AC 107 ms
41,240 KB
testcase_29 AC 124 ms
41,272 KB
testcase_30 AC 118 ms
40,132 KB
testcase_31 AC 106 ms
41,304 KB
testcase_32 AC 105 ms
41,104 KB
testcase_33 AC 107 ms
41,352 KB
testcase_34 AC 114 ms
41,172 KB
testcase_35 AC 113 ms
40,264 KB
testcase_36 AC 106 ms
41,452 KB
testcase_37 AC 116 ms
41,184 KB
testcase_38 AC 117 ms
40,192 KB
testcase_39 AC 110 ms
41,008 KB
testcase_40 AC 114 ms
40,148 KB
testcase_41 AC 128 ms
41,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise144{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();
    int max = 0;

    for(int i = 2; i <= n / 2; i++){
      if(n % i == 0){
        max = Math.max(max, i);
      }
    }
    System.out.println((max == 0) ? 1 :max);
  }
}
0