結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー tsunabittsunabit
提出日時 2018-07-15 15:11:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 485 bytes
コンパイル時間 3,674 ms
コンパイル使用メモリ 75,708 KB
実行使用メモリ 41,624 KB
最終ジャッジ日時 2024-04-24 05:43:38
合計ジャッジ時間 7,455 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,424 KB
testcase_01 AC 115 ms
40,008 KB
testcase_02 AC 112 ms
41,192 KB
testcase_03 AC 119 ms
41,236 KB
testcase_04 AC 100 ms
40,292 KB
testcase_05 AC 94 ms
40,216 KB
testcase_06 AC 112 ms
41,136 KB
testcase_07 AC 110 ms
41,364 KB
testcase_08 AC 99 ms
40,288 KB
testcase_09 AC 101 ms
40,388 KB
testcase_10 AC 109 ms
41,200 KB
testcase_11 AC 100 ms
40,600 KB
testcase_12 AC 108 ms
40,176 KB
testcase_13 AC 112 ms
41,128 KB
testcase_14 AC 112 ms
41,184 KB
testcase_15 AC 111 ms
41,624 KB
testcase_16 AC 101 ms
40,244 KB
testcase_17 AC 114 ms
40,160 KB
testcase_18 AC 115 ms
41,384 KB
testcase_19 AC 102 ms
40,144 KB
testcase_20 AC 102 ms
40,296 KB
testcase_21 AC 102 ms
40,032 KB
testcase_22 AC 110 ms
40,136 KB
testcase_23 AC 99 ms
40,060 KB
testcase_24 AC 111 ms
40,984 KB
testcase_25 AC 113 ms
41,124 KB
testcase_26 AC 113 ms
40,224 KB
testcase_27 AC 100 ms
40,368 KB
testcase_28 AC 102 ms
40,304 KB
testcase_29 AC 94 ms
40,004 KB
testcase_30 AC 111 ms
41,520 KB
testcase_31 AC 113 ms
41,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;
import java.time.*;
import java.time.format.*;

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