結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
stone_725
|
| 提出日時 | 2018-06-14 09:04:16 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 672 bytes |
| コンパイル時間 | 2,043 ms |
| コンパイル使用メモリ | 162,336 KB |
| 実行使用メモリ | 14,052 KB |
| 最終ジャッジ日時 | 2024-10-15 14:41:53 |
| 合計ジャッジ時間 | 6,555 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | WA * 1 RE * 4 TLE * 1 -- * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int getScore[100000];
void hawawa()
{
int n;
cin >> n;
vector<int> ans;
unsigned num = 1;
for (unsigned i = 2; i <= n; i++) {
num *= i;
bitset<32> bits(n - num / 2);
if (bits.count() == 1) {
for (int j = 0; j < 32; j++) {
if (bits[j]) {
ans = vector<int>(j, 0);
break;
}
}
for (int j = 0; j < i; j++) {
ans.push_back(1);
}
break;
}
num /= i - 1;
}
cout << ans.size() << "\n";
for (int i = 0; i + 1 < ans.size(); i++) {
cout << ans[i] << " ";
}
cout << ans[ans.size() - 1] << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
hawawa();
return 0;
}
stone_725