結果

問題 No.136 Yet Another GCD Problem
ユーザー takeya_okinotakeya_okino
提出日時 2019-08-22 19:14:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 73,788 KB
実行使用メモリ 41,788 KB
最終ジャッジ日時 2024-04-20 21:06:04
合計ジャッジ時間 7,674 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
41,168 KB
testcase_01 AC 111 ms
41,216 KB
testcase_02 AC 110 ms
40,976 KB
testcase_03 AC 115 ms
41,132 KB
testcase_04 AC 109 ms
41,236 KB
testcase_05 AC 109 ms
41,092 KB
testcase_06 AC 111 ms
41,072 KB
testcase_07 AC 110 ms
40,644 KB
testcase_08 AC 99 ms
40,060 KB
testcase_09 AC 115 ms
41,520 KB
testcase_10 AC 111 ms
41,132 KB
testcase_11 AC 101 ms
39,972 KB
testcase_12 AC 103 ms
40,112 KB
testcase_13 AC 111 ms
41,080 KB
testcase_14 AC 116 ms
41,656 KB
testcase_15 AC 109 ms
40,372 KB
testcase_16 AC 110 ms
41,300 KB
testcase_17 AC 103 ms
40,340 KB
testcase_18 AC 109 ms
41,124 KB
testcase_19 AC 113 ms
40,780 KB
testcase_20 AC 105 ms
40,256 KB
testcase_21 AC 112 ms
41,136 KB
testcase_22 AC 112 ms
40,712 KB
testcase_23 AC 120 ms
41,140 KB
testcase_24 AC 101 ms
39,940 KB
testcase_25 AC 115 ms
40,908 KB
testcase_26 AC 111 ms
41,132 KB
testcase_27 AC 112 ms
41,396 KB
testcase_28 AC 100 ms
40,180 KB
testcase_29 AC 117 ms
41,424 KB
testcase_30 AC 119 ms
41,216 KB
testcase_31 AC 120 ms
41,788 KB
testcase_32 AC 109 ms
39,904 KB
testcase_33 AC 103 ms
39,868 KB
testcase_34 AC 104 ms
40,080 KB
testcase_35 AC 115 ms
41,400 KB
testcase_36 AC 115 ms
41,000 KB
testcase_37 AC 115 ms
40,996 KB
testcase_38 AC 118 ms
41,520 KB
testcase_39 AC 112 ms
40,876 KB
testcase_40 AC 95 ms
39,900 KB
testcase_41 AC 106 ms
41,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int ans = 0;
    for(int i = n - 1; i >= 1; i--) {
      if((n % i) == 0) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}
0