結果

問題 No.136 Yet Another GCD Problem
ユーザー takeya_okinotakeya_okino
提出日時 2019-08-22 19:14:57
言語 Java19
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 2,071 ms
コンパイル使用メモリ 72,352 KB
実行使用メモリ 57,600 KB
最終ジャッジ日時 2023-08-02 21:04:06
合計ジャッジ時間 9,268 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,796 KB
testcase_01 AC 124 ms
56,020 KB
testcase_02 AC 125 ms
55,812 KB
testcase_03 AC 125 ms
55,920 KB
testcase_04 AC 126 ms
55,616 KB
testcase_05 AC 126 ms
56,044 KB
testcase_06 AC 126 ms
55,836 KB
testcase_07 AC 125 ms
55,956 KB
testcase_08 AC 126 ms
55,376 KB
testcase_09 AC 127 ms
56,008 KB
testcase_10 AC 126 ms
55,652 KB
testcase_11 AC 125 ms
55,812 KB
testcase_12 AC 125 ms
55,792 KB
testcase_13 AC 126 ms
55,860 KB
testcase_14 AC 125 ms
55,856 KB
testcase_15 AC 127 ms
55,676 KB
testcase_16 AC 128 ms
55,812 KB
testcase_17 AC 125 ms
55,960 KB
testcase_18 AC 125 ms
55,864 KB
testcase_19 AC 125 ms
55,684 KB
testcase_20 AC 124 ms
55,812 KB
testcase_21 AC 124 ms
55,656 KB
testcase_22 AC 124 ms
55,440 KB
testcase_23 AC 125 ms
55,424 KB
testcase_24 AC 125 ms
55,688 KB
testcase_25 AC 126 ms
55,600 KB
testcase_26 AC 125 ms
55,708 KB
testcase_27 AC 125 ms
56,032 KB
testcase_28 AC 127 ms
55,664 KB
testcase_29 AC 129 ms
55,792 KB
testcase_30 AC 126 ms
55,832 KB
testcase_31 AC 126 ms
55,840 KB
testcase_32 AC 126 ms
55,780 KB
testcase_33 AC 124 ms
55,940 KB
testcase_34 AC 126 ms
55,976 KB
testcase_35 AC 125 ms
53,848 KB
testcase_36 AC 124 ms
55,964 KB
testcase_37 AC 128 ms
53,680 KB
testcase_38 AC 126 ms
55,756 KB
testcase_39 AC 126 ms
57,600 KB
testcase_40 AC 124 ms
55,832 KB
testcase_41 AC 124 ms
55,760 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