結果

問題 No.311 z in FizzBuzzString
ユーザー h_tyokinuhatah_tyokinuhata
提出日時 2016-01-19 20:08:32
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 344 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 73,856 KB
実行使用メモリ 62,148 KB
最終ジャッジ日時 2023-10-25 02:40:44
合計ジャッジ時間 6,163 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
62,000 KB
testcase_01 AC 127 ms
57,524 KB
testcase_02 AC 130 ms
57,396 KB
testcase_03 AC 128 ms
57,560 KB
testcase_04 AC 127 ms
57,496 KB
testcase_05 AC 128 ms
57,320 KB
testcase_06 AC 119 ms
56,264 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		long N = sc.nextLong();

		long cnt1 = 0, cnt2 = 0;
		
		for(long i = 1; i <= N; i++) {
			if(i % 3 == 0) {
				cnt1++;
			}
			if(i % 5 == 0) {
				cnt2++;
			}
		}
		
		System.out.println(cnt1 * 2 + cnt2 * 2);
	}
}
0