結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 14:58:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 494 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 71,892 KB
実行使用メモリ 56,568 KB
最終ジャッジ日時 2023-10-11 11:12:58
合計ジャッジ時間 7,775 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,020 KB
testcase_01 AC 123 ms
56,120 KB
testcase_02 AC 123 ms
55,868 KB
testcase_03 AC 124 ms
56,508 KB
testcase_04 AC 123 ms
55,536 KB
testcase_05 AC 122 ms
55,756 KB
testcase_06 AC 124 ms
56,168 KB
testcase_07 AC 124 ms
55,972 KB
testcase_08 AC 121 ms
55,880 KB
testcase_09 AC 122 ms
55,740 KB
testcase_10 AC 122 ms
56,132 KB
testcase_11 AC 121 ms
56,376 KB
testcase_12 AC 122 ms
56,040 KB
testcase_13 AC 122 ms
55,852 KB
testcase_14 AC 120 ms
55,952 KB
testcase_15 AC 124 ms
56,256 KB
testcase_16 AC 125 ms
56,240 KB
testcase_17 AC 123 ms
56,164 KB
testcase_18 AC 124 ms
56,160 KB
testcase_19 AC 123 ms
56,140 KB
testcase_20 AC 124 ms
56,052 KB
testcase_21 AC 122 ms
56,072 KB
testcase_22 AC 121 ms
56,568 KB
testcase_23 AC 121 ms
56,160 KB
testcase_24 AC 121 ms
56,276 KB
testcase_25 AC 122 ms
56,480 KB
testcase_26 AC 121 ms
56,236 KB
testcase_27 AC 122 ms
56,204 KB
testcase_28 AC 123 ms
56,144 KB
testcase_29 AC 121 ms
56,212 KB
testcase_30 AC 120 ms
56,024 KB
testcase_31 AC 123 ms
56,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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