結果

問題 No.339 何人が回答したのか
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-04 06:10:53
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 737 bytes
コンパイル時間 3,432 ms
コンパイル使用メモリ 77,832 KB
実行使用メモリ 54,452 KB
最終ジャッジ日時 2024-04-17 00:15:00
合計ジャッジ時間 14,454 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
41,824 KB
testcase_01 AC 142 ms
41,328 KB
testcase_02 AC 137 ms
41,460 KB
testcase_03 AC 136 ms
41,424 KB
testcase_04 AC 136 ms
41,284 KB
testcase_05 AC 136 ms
41,116 KB
testcase_06 WA -
testcase_07 AC 140 ms
41,624 KB
testcase_08 AC 136 ms
41,512 KB
testcase_09 AC 134 ms
41,160 KB
testcase_10 AC 138 ms
41,440 KB
testcase_11 AC 141 ms
41,408 KB
testcase_12 WA -
testcase_13 AC 140 ms
41,516 KB
testcase_14 AC 136 ms
41,128 KB
testcase_15 AC 138 ms
41,676 KB
testcase_16 AC 138 ms
41,436 KB
testcase_17 AC 137 ms
41,148 KB
testcase_18 WA -
testcase_19 AC 138 ms
41,136 KB
testcase_20 AC 141 ms
41,440 KB
testcase_21 AC 137 ms
41,256 KB
testcase_22 AC 137 ms
41,436 KB
testcase_23 AC 137 ms
41,456 KB
testcase_24 AC 136 ms
40,976 KB
testcase_25 WA -
testcase_26 AC 138 ms
41,492 KB
testcase_27 AC 136 ms
41,756 KB
testcase_28 AC 137 ms
41,444 KB
testcase_29 WA -
testcase_30 AC 137 ms
41,224 KB
testcase_31 AC 139 ms
41,148 KB
testcase_32 AC 138 ms
41,380 KB
testcase_33 AC 137 ms
40,964 KB
testcase_34 AC 136 ms
41,592 KB
testcase_35 AC 138 ms
41,448 KB
testcase_36 WA -
testcase_37 AC 140 ms
41,400 KB
testcase_38 AC 139 ms
41,224 KB
testcase_39 AC 139 ms
41,492 KB
testcase_40 AC 136 ms
41,560 KB
testcase_41 AC 137 ms
41,392 KB
testcase_42 AC 137 ms
41,576 KB
testcase_43 AC 139 ms
41,600 KB
testcase_44 AC 140 ms
41,368 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 138 ms
41,404 KB
testcase_48 AC 138 ms
41,476 KB
testcase_49 AC 136 ms
41,384 KB
testcase_50 AC 137 ms
41,452 KB
testcase_51 AC 136 ms
41,328 KB
testcase_52 AC 138 ms
41,444 KB
testcase_53 AC 136 ms
41,332 KB
testcase_54 AC 137 ms
41,584 KB
testcase_55 WA -
testcase_56 AC 138 ms
41,452 KB
testcase_57 WA -
testcase_58 AC 141 ms
41,492 KB
testcase_59 AC 137 ms
41,560 KB
testcase_60 AC 135 ms
41,348 KB
testcase_61 AC 135 ms
41,456 KB
testcase_62 AC 134 ms
41,496 KB
testcase_63 AC 139 ms
41,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int[] percentages = new int[n];

    for (int i = 0; i < n; i++){
      percentages[i] = sc.nextInt();
    }

    Arrays.sort(percentages);

    int gcm = 0;
    if (n < 2){
      gcm = 100;
    }else{
      gcm = ea(percentages[1], percentages[0]);
      for(int i = 2; i < n; i++){
        gcm = ea(percentages[2], gcm);
      }
    }

    System.out.println(100 / gcm);
  }
  private static int ea (int biggerNum, int smallerNum){
    int mod = biggerNum % smallerNum;
    if (mod == 0){
      return smallerNum;
    } else {
      return ea(smallerNum, mod);
    }
  }
}
0