結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー jp_ste
提出日時 2016-02-17 01:44:52
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 435 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 73,976 KB
実行使用メモリ 68,252 KB
最終ジャッジ日時 2024-09-22 07:23:49
合計ジャッジ時間 6,574 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other TLE * 1 -- * 32
権限があれば一括ダウンロードができます

ソースコード

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();
		int count = 0;
		for(int i=1; i<=N; i++) {
			if(i % a == 0) {
				count++;
			} else if(i % b == 0) {
				count++;
			} else if(i % c == 0) {
				count++;
			}	
		}
		System.out.println(count);
	}
}
0