結果

問題 No.294 SuperFizzBuzz
ユーザー koyoprokoyopro
提出日時 2015-10-24 02:19:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 190 ms / 5,000 ms
コード長 662 bytes
コンパイル時間 1,351 ms
コンパイル使用メモリ 143,884 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 05:19:38
合計ジャッジ時間 3,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 190 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 12 ms
4,348 KB
testcase_09 AC 105 ms
4,352 KB
testcase_10 AC 107 ms
4,348 KB
testcase_11 AC 175 ms
4,348 KB
testcase_12 AC 177 ms
4,352 KB
testcase_13 AC 182 ms
4,348 KB
testcase_14 AC 190 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

#define REP(i, n) for(int i=0; i<(n); i++)

int N,T;
signed main()
{
    cin >> N;
    int num = 0;
    int ans = 0;
    REP(i,1<<25) {
        if (i < 7) continue;
        if (__builtin_popcount(i) % 3 == 0) {
            if (++num == N) {
                ans = i;
                break;
            }
        }
    }
    bool check = false;
    REP(i,26) {
        if (ans & 1<<(25-i)) {
            if (!check) {
                check = true;
                continue;
            }
            cout << 5;
        } else if (check) {
            cout << 3;
        }
    }
    cout << 5 << endl;
    return 0;
}
0