結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 01:51:25
言語 Java19
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 468 bytes
コンパイル時間 3,192 ms
コンパイル使用メモリ 72,352 KB
実行使用メモリ 56,172 KB
最終ジャッジ日時 2023-09-11 04:27:42
合計ジャッジ時間 7,439 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,692 KB
testcase_01 AC 124 ms
56,136 KB
testcase_02 AC 124 ms
55,936 KB
testcase_03 AC 125 ms
55,376 KB
testcase_04 AC 124 ms
56,172 KB
testcase_05 AC 123 ms
55,664 KB
testcase_06 AC 124 ms
55,844 KB
testcase_07 AC 124 ms
55,596 KB
testcase_08 AC 125 ms
55,736 KB
testcase_09 AC 126 ms
55,820 KB
testcase_10 AC 127 ms
56,148 KB
testcase_11 AC 125 ms
55,656 KB
testcase_12 AC 124 ms
55,992 KB
testcase_13 AC 123 ms
55,848 KB
testcase_14 AC 127 ms
55,916 KB
testcase_15 AC 125 ms
55,788 KB
testcase_16 AC 125 ms
56,020 KB
testcase_17 AC 126 ms
55,572 KB
testcase_18 AC 124 ms
55,920 KB
testcase_19 AC 122 ms
56,124 KB
testcase_20 AC 126 ms
55,520 KB
testcase_21 AC 126 ms
55,768 KB
testcase_22 AC 124 ms
55,556 KB
testcase_23 AC 125 ms
56,104 KB
testcase_24 AC 123 ms
55,724 KB
testcase_25 AC 124 ms
55,680 KB
testcase_26 AC 124 ms
55,540 KB
testcase_27 AC 125 ms
55,912 KB
testcase_28 AC 123 ms
55,576 KB
testcase_29 AC 126 ms
55,596 KB
testcase_30 AC 128 ms
55,796 KB
testcase_31 AC 128 ms
55,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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