結果

問題 No.136 Yet Another GCD Problem
ユーザー kenji_shioyakenji_shioya
提出日時 2016-07-05 00:18:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 4,135 ms
コンパイル使用メモリ 74,188 KB
実行使用メモリ 41,756 KB
最終ジャッジ日時 2024-04-20 21:58:52
合計ジャッジ時間 9,649 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,200 KB
testcase_01 AC 105 ms
40,060 KB
testcase_02 AC 114 ms
41,076 KB
testcase_03 AC 101 ms
40,040 KB
testcase_04 AC 108 ms
41,460 KB
testcase_05 AC 101 ms
40,048 KB
testcase_06 AC 117 ms
41,024 KB
testcase_07 AC 108 ms
41,304 KB
testcase_08 AC 113 ms
41,124 KB
testcase_09 AC 105 ms
40,956 KB
testcase_10 AC 111 ms
41,236 KB
testcase_11 AC 103 ms
40,040 KB
testcase_12 AC 115 ms
41,476 KB
testcase_13 AC 101 ms
40,100 KB
testcase_14 AC 116 ms
41,252 KB
testcase_15 AC 118 ms
40,996 KB
testcase_16 AC 105 ms
41,484 KB
testcase_17 AC 104 ms
40,328 KB
testcase_18 AC 109 ms
41,308 KB
testcase_19 AC 111 ms
40,720 KB
testcase_20 AC 116 ms
41,560 KB
testcase_21 AC 116 ms
41,544 KB
testcase_22 WA -
testcase_23 AC 107 ms
41,116 KB
testcase_24 WA -
testcase_25 AC 107 ms
40,780 KB
testcase_26 AC 115 ms
41,524 KB
testcase_27 AC 108 ms
40,268 KB
testcase_28 AC 114 ms
41,112 KB
testcase_29 AC 102 ms
40,172 KB
testcase_30 WA -
testcase_31 AC 116 ms
41,756 KB
testcase_32 WA -
testcase_33 AC 116 ms
41,132 KB
testcase_34 AC 107 ms
41,224 KB
testcase_35 AC 108 ms
40,360 KB
testcase_36 AC 111 ms
41,312 KB
testcase_37 AC 105 ms
40,396 KB
testcase_38 AC 111 ms
41,416 KB
testcase_39 AC 107 ms
41,416 KB
testcase_40 AC 109 ms
39,872 KB
testcase_41 AC 118 ms
41,408 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 = 3; i <= n / 2; i++){
      if(n % i == 0){
        max = Math.max(max, i);
      }
    }
    System.out.println((max == 0) ? 1 :max);  
  }
}
0