結果
| 問題 |
No.294 SuperFizzBuzz
|
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2015-10-24 00:12:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 999 ms / 5,000 ms |
| コード長 | 527 bytes |
| コンパイル時間 | 405 ms |
| コンパイル使用メモリ | 54,920 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 04:17:26 |
| 合計ジャッジ時間 | 7,037 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <iostream>
using namespace std;
void output( int n, int i ){
for( int j = n - 1; j >= 0; j-- ){
cout << (((i >> j) % 2) ? 5 : 3);
}
cout << endl;
}
int main()
{
int x;
cin >> x;
x--;
int n;
for( int n = 1; n < 26; n++ ){
for( int i = 0; i < (1 << n); i++ ){
if( i % 2 == 0 )
continue;
int digitSum = 0;
for( int j = 0; j < n; j++ )
digitSum += (((i >> j) % 2) ? 5 : 3);
if( digitSum % 3 == 0 ){
if( !x ){
output(n, i);
return 0;
}
x--;
}
}
}
return 0;
}
startcpp