結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー GrenacheGrenache
提出日時 2018-02-12 12:17:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 737 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 73,376 KB
実行使用メモリ 56,008 KB
最終ジャッジ日時 2023-09-11 04:29:26
合計ジャッジ時間 9,075 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,516 KB
testcase_01 AC 129 ms
55,608 KB
testcase_02 AC 130 ms
55,824 KB
testcase_03 AC 129 ms
55,876 KB
testcase_04 AC 130 ms
56,008 KB
testcase_05 AC 130 ms
55,856 KB
testcase_06 AC 130 ms
55,704 KB
testcase_07 AC 131 ms
55,528 KB
testcase_08 AC 129 ms
55,992 KB
testcase_09 AC 130 ms
55,492 KB
testcase_10 AC 130 ms
55,752 KB
testcase_11 AC 132 ms
55,724 KB
testcase_12 AC 129 ms
55,924 KB
testcase_13 AC 130 ms
55,644 KB
testcase_14 AC 130 ms
55,568 KB
testcase_15 AC 128 ms
55,888 KB
testcase_16 AC 130 ms
55,688 KB
testcase_17 AC 130 ms
55,696 KB
testcase_18 AC 131 ms
55,484 KB
testcase_19 AC 132 ms
53,708 KB
testcase_20 AC 130 ms
55,660 KB
testcase_21 AC 133 ms
55,896 KB
testcase_22 AC 130 ms
55,924 KB
testcase_23 AC 130 ms
55,700 KB
testcase_24 AC 129 ms
55,996 KB
testcase_25 AC 130 ms
55,708 KB
testcase_26 AC 130 ms
55,956 KB
testcase_27 AC 129 ms
55,884 KB
testcase_28 AC 129 ms
55,672 KB
testcase_29 AC 130 ms
55,716 KB
testcase_30 AC 131 ms
55,664 KB
testcase_31 AC 132 ms
55,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder637 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			int a = sc.nextInt();

			if (a % 3 == 0 && a % 5 == 0) {
				ans += 8;
			} else if (a % 3 == 0 || a % 5 == 0) {
				ans += 4;
			} else {
				ans += Integer.toString(a).length();
			}
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0