結果
| 問題 |
No.294 SuperFizzBuzz
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-30 20:04:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 737 bytes |
| コンパイル時間 | 827 ms |
| コンパイル使用メモリ | 95,752 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 02:31:54 |
| 合計ジャッジ時間 | 32,321 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | AC * 11 TLE * 1 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0;
for (int i = 2; i <= 24; i++) {
for (int bit = 0; bit < (1 << i); bit++) {
string s = "";
int co = 0;
for (int j = 0; j < i; j++) {
if (bit & (1 << j)) {
co++;
s += '5';
}
else{
s += '3';
}
}
co++;
reverse(s.begin(), s.end());
s += '5';
if (co % 3 == 0) {
ans++;
if (ans == n) {
cout << s << endl;
return 0;
}
}
}
}
}