結果

問題 No.311 z in FizzBuzzString
ユーザー YatsukuYatsuku
提出日時 2015-12-22 19:13:54
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 422 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 75,320 KB
実行使用メモリ 58,004 KB
最終ジャッジ日時 2023-10-25 02:38:54
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,284 KB
testcase_01 AC 134 ms
57,516 KB
testcase_02 AC 135 ms
57,504 KB
testcase_03 AC 131 ms
57,720 KB
testcase_04 AC 134 ms
57,560 KB
testcase_05 AC 133 ms
57,568 KB
testcase_06 AC 132 ms
57,564 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class No_311 {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);		
		int num = stdIn.nextInt();

		int count = 0;
		int i = 1;
		for (Integer.toUnsignedLong(i); i <= Integer.toUnsignedLong(num); i++) {
			if ((i % 3 == 0) && (i % 5 == 0)) {
				count += 4;
			}
			else if (i % 3 == 0 || i % 5 == 0) {
				count += 2;
			}
		}
		System.out.println(count);
	}
}
0