結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 22:53:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 511 bytes
コンパイル時間 5,160 ms
コンパイル使用メモリ 71,532 KB
実行使用メモリ 56,112 KB
最終ジャッジ日時 2023-09-11 04:30:31
合計ジャッジ時間 9,105 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,552 KB
testcase_01 AC 125 ms
55,664 KB
testcase_02 AC 128 ms
55,716 KB
testcase_03 AC 127 ms
55,692 KB
testcase_04 AC 127 ms
55,772 KB
testcase_05 AC 129 ms
55,744 KB
testcase_06 AC 126 ms
55,748 KB
testcase_07 AC 128 ms
55,392 KB
testcase_08 AC 130 ms
55,716 KB
testcase_09 AC 130 ms
55,700 KB
testcase_10 AC 129 ms
55,616 KB
testcase_11 AC 125 ms
55,756 KB
testcase_12 AC 130 ms
55,516 KB
testcase_13 AC 129 ms
55,476 KB
testcase_14 AC 129 ms
55,724 KB
testcase_15 AC 127 ms
56,112 KB
testcase_16 AC 126 ms
55,596 KB
testcase_17 AC 126 ms
56,012 KB
testcase_18 AC 126 ms
55,756 KB
testcase_19 AC 126 ms
55,920 KB
testcase_20 AC 126 ms
55,516 KB
testcase_21 AC 127 ms
55,904 KB
testcase_22 AC 129 ms
55,720 KB
testcase_23 AC 125 ms
55,628 KB
testcase_24 AC 125 ms
55,748 KB
testcase_25 AC 125 ms
55,472 KB
testcase_26 AC 125 ms
55,680 KB
testcase_27 AC 125 ms
55,692 KB
testcase_28 AC 125 ms
55,856 KB
testcase_29 AC 126 ms
55,396 KB
testcase_30 AC 124 ms
55,868 KB
testcase_31 AC 125 ms
55,760 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