結果

問題 No.339 何人が回答したのか
ユーザー tentententen
提出日時 2022-07-30 16:12:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 1,000 ms
コード長 1,183 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 73,976 KB
実行使用メモリ 49,672 KB
最終ジャッジ日時 2023-09-27 18:36:19
合計ジャッジ時間 8,723 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,112 KB
testcase_01 AC 40 ms
49,144 KB
testcase_02 AC 38 ms
49,116 KB
testcase_03 AC 39 ms
49,156 KB
testcase_04 AC 39 ms
49,132 KB
testcase_05 AC 38 ms
49,076 KB
testcase_06 AC 39 ms
49,368 KB
testcase_07 AC 39 ms
49,376 KB
testcase_08 AC 40 ms
49,156 KB
testcase_09 AC 40 ms
49,464 KB
testcase_10 AC 40 ms
49,208 KB
testcase_11 AC 41 ms
49,124 KB
testcase_12 AC 41 ms
49,124 KB
testcase_13 AC 42 ms
49,380 KB
testcase_14 AC 40 ms
49,224 KB
testcase_15 AC 39 ms
49,116 KB
testcase_16 AC 39 ms
49,536 KB
testcase_17 AC 39 ms
49,280 KB
testcase_18 AC 40 ms
49,156 KB
testcase_19 AC 39 ms
49,672 KB
testcase_20 AC 40 ms
49,148 KB
testcase_21 AC 41 ms
49,264 KB
testcase_22 AC 40 ms
49,232 KB
testcase_23 AC 42 ms
49,612 KB
testcase_24 AC 39 ms
49,320 KB
testcase_25 AC 39 ms
47,104 KB
testcase_26 AC 39 ms
49,340 KB
testcase_27 AC 39 ms
49,156 KB
testcase_28 AC 39 ms
49,252 KB
testcase_29 AC 39 ms
49,428 KB
testcase_30 AC 39 ms
49,236 KB
testcase_31 AC 39 ms
49,220 KB
testcase_32 AC 40 ms
49,276 KB
testcase_33 AC 40 ms
49,512 KB
testcase_34 AC 39 ms
49,296 KB
testcase_35 AC 39 ms
49,520 KB
testcase_36 AC 39 ms
49,228 KB
testcase_37 AC 40 ms
49,604 KB
testcase_38 AC 40 ms
49,216 KB
testcase_39 AC 39 ms
49,316 KB
testcase_40 AC 40 ms
49,280 KB
testcase_41 AC 40 ms
49,272 KB
testcase_42 AC 40 ms
49,152 KB
testcase_43 AC 40 ms
49,516 KB
testcase_44 AC 40 ms
49,320 KB
testcase_45 AC 40 ms
49,376 KB
testcase_46 AC 40 ms
49,272 KB
testcase_47 AC 40 ms
49,496 KB
testcase_48 AC 39 ms
49,272 KB
testcase_49 AC 40 ms
49,104 KB
testcase_50 AC 40 ms
49,156 KB
testcase_51 AC 40 ms
49,260 KB
testcase_52 AC 41 ms
49,100 KB
testcase_53 AC 39 ms
49,232 KB
testcase_54 AC 40 ms
49,316 KB
testcase_55 AC 41 ms
49,228 KB
testcase_56 AC 41 ms
49,148 KB
testcase_57 AC 42 ms
49,416 KB
testcase_58 AC 43 ms
49,236 KB
testcase_59 AC 40 ms
49,520 KB
testcase_60 AC 40 ms
49,220 KB
testcase_61 AC 40 ms
47,028 KB
testcase_62 AC 40 ms
49,304 KB
testcase_63 AC 39 ms
49,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int gcd = 100;
        while (n-- > 0) {
            gcd = getGCD(gcd, sc.nextInt());
        }
        System.out.println(100 / gcd);
    }
    
    static int getGCD(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return getGCD(y, x % y);
        }
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0