結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 22:37:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 510 bytes
コンパイル時間 3,356 ms
コンパイル使用メモリ 72,588 KB
実行使用メモリ 55,928 KB
最終ジャッジ日時 2023-09-11 04:30:19
合計ジャッジ時間 8,893 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,392 KB
testcase_01 AC 126 ms
55,692 KB
testcase_02 AC 127 ms
55,420 KB
testcase_03 AC 128 ms
55,572 KB
testcase_04 AC 129 ms
55,716 KB
testcase_05 AC 129 ms
55,924 KB
testcase_06 AC 128 ms
55,596 KB
testcase_07 AC 130 ms
55,712 KB
testcase_08 AC 130 ms
55,432 KB
testcase_09 AC 129 ms
55,648 KB
testcase_10 AC 131 ms
55,928 KB
testcase_11 AC 130 ms
53,820 KB
testcase_12 AC 130 ms
55,612 KB
testcase_13 AC 128 ms
55,796 KB
testcase_14 AC 130 ms
55,628 KB
testcase_15 AC 130 ms
55,688 KB
testcase_16 AC 127 ms
55,692 KB
testcase_17 AC 130 ms
55,672 KB
testcase_18 AC 128 ms
55,716 KB
testcase_19 AC 130 ms
55,688 KB
testcase_20 AC 130 ms
55,616 KB
testcase_21 AC 133 ms
55,480 KB
testcase_22 AC 132 ms
55,756 KB
testcase_23 AC 131 ms
55,600 KB
testcase_24 AC 129 ms
55,604 KB
testcase_25 AC 129 ms
55,564 KB
testcase_26 AC 131 ms
55,632 KB
testcase_27 AC 130 ms
55,688 KB
testcase_28 AC 127 ms
55,808 KB
testcase_29 AC 131 ms
55,600 KB
testcase_30 AC 128 ms
55,684 KB
testcase_31 AC 130 ms
55,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;

import java.util.Scanner;

public class Fizzbuzz637 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = new Scanner(System.in);
		int[] a = new int[5];
		for(int i = 0;i < 5;i++){
			a[i] = s.nextInt();
		}
		s.close();
		int sum = 0;
		for(int k : a){
			if(k % 15 == 0){
				sum += 8;
			}else if((k % 3) * (k % 5) == 0){
				sum += 4;
			}else{
				sum += Integer.toString(k).length();
			}
		}
		System.out.println(sum);
	}

}
0