結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー jp_stejp_ste
提出日時 2016-02-17 02:00:43
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 509 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 74,484 KB
実行使用メモリ 530,792 KB
最終ジャッジ日時 2023-10-22 06:08:18
合計ジャッジ時間 12,432 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 301 ms
171,212 KB
testcase_02 RE -
testcase_03 AC 115 ms
54,144 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 129 ms
57,400 KB
testcase_07 AC 131 ms
57,424 KB
testcase_08 AC 126 ms
57,120 KB
testcase_09 RE -
testcase_10 AC 131 ms
57,152 KB
testcase_11 AC 128 ms
57,444 KB
testcase_12 AC 156 ms
68,484 KB
testcase_13 AC 144 ms
61,780 KB
testcase_14 AC 156 ms
68,668 KB
testcase_15 AC 167 ms
74,692 KB
testcase_16 AC 164 ms
68,628 KB
testcase_17 AC 149 ms
64,320 KB
testcase_18 AC 202 ms
91,108 KB
testcase_19 AC 253 ms
113,656 KB
testcase_20 AC 276 ms
181,396 KB
testcase_21 AC 586 ms
386,664 KB
testcase_22 AC 244 ms
68,188 KB
testcase_23 AC 239 ms
113,816 KB
testcase_24 AC 212 ms
97,456 KB
testcase_25 AC 568 ms
394,084 KB
testcase_26 AC 173 ms
57,492 KB
testcase_27 AC 127 ms
55,548 KB
testcase_28 AC 133 ms
57,604 KB
testcase_29 AC 288 ms
142,520 KB
testcase_30 AC 670 ms
450,424 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 203 ms
95,380 KB
testcase_34 MLE -
testcase_35 RE -
testcase_36 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();

		boolean flag[] = new boolean[N+1];
		int check[] = { a,b,c };
		for(int i=0; i<3; i++) {
			for(int j=check[i]; j<=N; j+=check[i]) {
				flag[j] = true;
			}
		}
		
		int count = 0;
		for(int i=1; i<=N; i++) {
			if(flag[i]) count++;
		}
		System.out.println(count);
	}
}
0