結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー htensaihtensai
提出日時 2019-11-14 08:24:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 422 bytes
コンパイル時間 2,554 ms
コンパイル使用メモリ 78,948 KB
実行使用メモリ 57,608 KB
最終ジャッジ日時 2023-10-21 19:55:06
合計ジャッジ時間 8,024 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,056 KB
testcase_01 AC 130 ms
57,468 KB
testcase_02 AC 131 ms
57,360 KB
testcase_03 AC 130 ms
55,424 KB
testcase_04 AC 129 ms
57,288 KB
testcase_05 AC 130 ms
57,308 KB
testcase_06 AC 133 ms
57,320 KB
testcase_07 AC 130 ms
57,076 KB
testcase_08 AC 129 ms
57,464 KB
testcase_09 AC 129 ms
57,312 KB
testcase_10 AC 125 ms
57,320 KB
testcase_11 AC 128 ms
57,268 KB
testcase_12 AC 128 ms
57,332 KB
testcase_13 AC 132 ms
57,360 KB
testcase_14 AC 134 ms
57,284 KB
testcase_15 AC 130 ms
55,396 KB
testcase_16 AC 127 ms
57,332 KB
testcase_17 AC 126 ms
57,384 KB
testcase_18 AC 130 ms
57,296 KB
testcase_19 AC 131 ms
57,360 KB
testcase_20 AC 129 ms
57,324 KB
testcase_21 AC 131 ms
57,608 KB
testcase_22 AC 134 ms
57,292 KB
testcase_23 AC 127 ms
57,472 KB
testcase_24 AC 130 ms
57,300 KB
testcase_25 AC 131 ms
57,444 KB
testcase_26 AC 131 ms
57,060 KB
testcase_27 AC 131 ms
57,284 KB
testcase_28 AC 129 ms
57,308 KB
testcase_29 AC 130 ms
57,220 KB
testcase_30 AC 129 ms
57,292 KB
testcase_31 AC 130 ms
57,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int total = 0;
		for (int i = 0; i < 5; i++) {
		    int x = sc.nextInt();
		    if (x % 15 == 0) {
		        total += 8;
		    } else if (x % 5 == 0 || x % 3 == 0) {
		        total += 4;
		    } else {
		        total += String.valueOf(x).length();
		    }
		}
		System.out.println(total);
	}
}
0