結果

問題 No.294 SuperFizzBuzz
ユーザー GrenacheGrenache
提出日時 2015-10-23 23:56:17
言語 Java21
(openjdk 21)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,002 bytes
コンパイル時間 3,853 ms
コンパイル使用メモリ 74,060 KB
実行使用メモリ 58,104 KB
最終ジャッジ日時 2023-10-11 04:50:19
合計ジャッジ時間 10,923 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,816 KB
testcase_01 AC 129 ms
55,892 KB
testcase_02 TLE -
testcase_03 AC 130 ms
55,796 KB
testcase_04 AC 130 ms
56,304 KB
testcase_05 AC 131 ms
55,600 KB
testcase_06 AC 133 ms
56,296 KB
testcase_07 AC 140 ms
56,112 KB
testcase_08 AC 425 ms
56,336 KB
testcase_09 AC 3,351 ms
56,124 KB
testcase_10 AC 3,340 ms
55,800 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder294 {

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

        int n = sc.nextInt();

        int cnt = 0;
        out:
        for (int i = 1; i < 26; i++) {
        	for (int k = 0; k < 0x1 << i; k++) {
        		int tmp = 0;
        		for (int l = i - 1; l >= 0; l--) {
        			if ((k & 0x1 << l) == 0) {
        				tmp += 3;
        			} else {
        				tmp += 5;
        			}
        		}
        		if (tmp % 3 == 0 && (k & 0x1) != 0) {
        			cnt++;
        			if (cnt == n) {
        				String btmp = "";
                		for (int l = i - 1; l >= 0; l--) {
                			if ((k & 0x1 << l) == 0) {
                				btmp += "3";
                			} else {
                				btmp += "5";
                			}
                		}
        				System.out.println(btmp.toString());
        				break out;
        			}
        		}
        	}
        }

        sc.close();
    }
}
0