結果

問題 No.294 SuperFizzBuzz
ユーザー Kmcode1Kmcode1
提出日時 2015-10-23 22:59:23
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 171 ms / 5,000 ms
コード長 1,189 bytes
コンパイル時間 1,486 ms
コンパイル使用メモリ 96,916 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-30 07:24:49
合計ジャッジ時間 2,654 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 170 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 97 ms
4,380 KB
testcase_10 AC 97 ms
4,380 KB
testcase_11 AC 157 ms
4,380 KB
testcase_12 AC 162 ms
4,376 KB
testcase_13 AC 166 ms
4,380 KB
testcase_14 AC 171 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_set>
#include<unordered_map>
using namespace std;
string s = "5533533555333355355553555";

string ss;
int main() {
	int n;
	cin >> n;
	long long int mint = 0;
	long long int maxt = 1;
	for (int i = 0;i < s.size();i++) {
		maxt <<= 1LL;
		if (s[i] == '3') {

		}
		else {
			maxt |= 1LL;
		}
	}
	int countt = 0;
	long long int i = 2;
	int ket = 0;
	while (countt < n) {
		int k = __builtin_popcount(i);
		if (k == 1) {
			ket++;
		}
		k--;
		if ((i & 1)) {

		}
		else {
			i++;
			continue;
		}
		if (k % 3 == 0) {
			countt++;
		}
		i++;
	}
	i--;
	while (i > 1LL) {
		if ((i&1LL)) {
			ss.push_back('5');
			//continue;
		}
		else {
			ss.push_back('3');
		}
		i >>= 1;
	}
	reverse(ss.begin(), ss.end());
	cout << ss << endl;
	return 0;
}
0