結果

問題 No.311 z in FizzBuzzString
ユーザー jimanojimano
提出日時 2017-05-07 13:14:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 53 ms / 1,500 ms
コード長 520 bytes
コンパイル時間 1,979 ms
コンパイル使用メモリ 74,588 KB
実行使用メモリ 53,300 KB
最終ジャッジ日時 2023-10-25 02:50:35
合計ジャッジ時間 3,114 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,300 KB
testcase_01 AC 52 ms
53,292 KB
testcase_02 AC 51 ms
53,292 KB
testcase_03 AC 51 ms
53,268 KB
testcase_04 AC 52 ms
53,300 KB
testcase_05 AC 52 ms
53,280 KB
testcase_06 AC 51 ms
53,292 KB
testcase_07 AC 53 ms
53,292 KB
testcase_08 AC 53 ms
53,280 KB
testcase_09 AC 52 ms
53,280 KB
testcase_10 AC 52 ms
51,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			long n = Long.parseLong(br.readLine());

			long FizzBuzz = (n / 15);
			long Fizz = (n / 3) - FizzBuzz; 
			long Buzz = (n / 5) - FizzBuzz;
			long cnt = FizzBuzz * 4 + Fizz * 2 + Buzz *2;
			System.out.println(cnt);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
0