結果

問題 No.311 z in FizzBuzzString
ユーザー takutakutakutaku
提出日時 2020-09-17 14:07:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,500 ms
コード長 519 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 74,432 KB
実行使用メモリ 57,708 KB
最終ジャッジ日時 2023-10-25 03:02:04
合計ジャッジ時間 4,181 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,576 KB
testcase_01 AC 129 ms
57,672 KB
testcase_02 AC 129 ms
57,464 KB
testcase_03 AC 130 ms
57,380 KB
testcase_04 AC 133 ms
57,704 KB
testcase_05 AC 129 ms
57,476 KB
testcase_06 AC 131 ms
57,556 KB
testcase_07 AC 129 ms
57,684 KB
testcase_08 AC 130 ms
57,580 KB
testcase_09 AC 133 ms
57,480 KB
testcase_10 AC 130 ms
57,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
	    
	    // 標準入力を受け取る
	    Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        
        long count15 = n / 15;
        long count5 = n / 5 - count15;
        long count3 = n / 3 - count15;
        
        long result = 4 * count15 + 2 * count5 + 2 * count3;
        
        System.out.println(result);
	}
}

// 提出一覧からヒントを頂きました。申し訳ございません。
0