結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー YamaKasaYamaKasa
提出日時 2018-05-08 22:02:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 418 bytes
コンパイル時間 2,267 ms
コンパイル使用メモリ 71,716 KB
実行使用メモリ 56,148 KB
最終ジャッジ日時 2023-09-11 04:37:30
合計ジャッジ時間 7,689 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,784 KB
testcase_01 AC 127 ms
56,148 KB
testcase_02 AC 125 ms
55,792 KB
testcase_03 AC 127 ms
55,792 KB
testcase_04 AC 129 ms
55,588 KB
testcase_05 AC 129 ms
55,800 KB
testcase_06 AC 124 ms
55,944 KB
testcase_07 AC 127 ms
55,732 KB
testcase_08 AC 125 ms
55,900 KB
testcase_09 AC 122 ms
55,488 KB
testcase_10 AC 126 ms
55,664 KB
testcase_11 AC 128 ms
55,960 KB
testcase_12 AC 127 ms
55,460 KB
testcase_13 AC 126 ms
55,824 KB
testcase_14 AC 125 ms
55,792 KB
testcase_15 AC 128 ms
55,460 KB
testcase_16 AC 126 ms
55,628 KB
testcase_17 AC 126 ms
56,116 KB
testcase_18 AC 130 ms
55,632 KB
testcase_19 AC 122 ms
55,468 KB
testcase_20 AC 126 ms
55,996 KB
testcase_21 AC 130 ms
55,660 KB
testcase_22 AC 127 ms
55,768 KB
testcase_23 AC 125 ms
55,856 KB
testcase_24 AC 126 ms
55,788 KB
testcase_25 AC 131 ms
55,984 KB
testcase_26 AC 126 ms
55,964 KB
testcase_27 AC 127 ms
55,876 KB
testcase_28 AC 126 ms
55,768 KB
testcase_29 AC 128 ms
56,120 KB
testcase_30 AC 127 ms
55,728 KB
testcase_31 AC 128 ms
55,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int cnt = 0;
		for(int i = 0; i < 5; i++) {
			int t = scan.nextInt();
			if(t % 15 == 0) {
				cnt += 8;
			}else if(t % 3 == 0 || t % 5 == 0) {
				cnt += 4;
			}else {
				String s = Integer.toString(t);
				cnt += s.length();
			}
		}
		scan.close();
		System.out.println(cnt);
	}
}
0