結果
問題 | No.688 E869120 and Constructing Array 2 |
ユーザー | とばり |
提出日時 | 2018-08-14 17:40:10 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,492 bytes |
コンパイル時間 | 1,554 ms |
コンパイル使用メモリ | 170,592 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 08:51:18 |
合計ジャッジ時間 | 2,433 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,940 KB |
testcase_03 | AC | 2 ms
6,944 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,944 KB |
testcase_06 | AC | 2 ms
6,940 KB |
testcase_07 | AC | 2 ms
6,944 KB |
testcase_08 | AC | 2 ms
6,948 KB |
testcase_09 | WA | - |
testcase_10 | AC | 2 ms
6,944 KB |
testcase_11 | AC | 2 ms
6,940 KB |
testcase_12 | AC | 2 ms
6,944 KB |
ソースコード
#include <bits/stdc++.h>using namespace std;using int64 = long long;using uint64 = unsigned long long;#define repeat(i, x) for (int64 i = 0; (i) < (x); (i)++)#define rev_repeat(i, x) for (int64 i = (x) - 1; (i) >= 0; (i)--)#define range(i, a, b) for (int64 i = (a); (i) < (b); (i)++)#define traverse(it, ctn) for (auto it = begin(ctn); (it) != end(ctn); (it)++)#define rev_traverse(it, ctn) for (auto it = rbegin(ctn); (it) != rend(ctn); (it)++)template<typename T>ostream& operator<<(ostream& os, vector<T>& vec){os << "[";repeat (i, vec.size()){os << (i == 0 ? "" : ", ") << vec[i];}os << "]";return os;}template<typename T, typename U>ostream& operator<<(ostream& os, pair<T, U>& p){os << "(" << p.first << ", " << p.second << ")";return os;}template<typename T>ostream& operator<<(ostream& os, set<T>& s){os << "{";traverse (it, s){if (it != s.begin()) os << ", ";os << *it;}os << "}";return os;}template<typename K, typename V>ostream& operator<<(ostream& os, map<K, V>& m){os << "{";traverse (it, m){if (it != m.begin()) os << ", ";os << it->first << ": " << it->second;}os << "}";return os;}//// _______ _____ _______ _____ _______ _______ _____ _______ _____ _ _ _______// | | | | | | |_____] |______ | | | | \ / |______// |_____ |_____| | | | | |______ | __|__ | __|__ \/ |______//// _____ ______ _____ ______ ______ _______ _______ _______ _____ __ _ ______ /// |_____] |_____/ | | | ____ |_____/ |_____| | | | | | | | | \ | | ____ /// | | \_ |_____| |_____| | \_ | | | | | | | | __|__ | \_| |_____| .int main(){cin.tie(nullptr);ios::sync_with_stdio(false);int64 K;cin >> K;vector<int64> b;int bOneNum = 0, bZeroNum = 0;range (oneNum, 2, 31){range (len, oneNum, 31){int64 zeroNum = len - oneNum;if ((oneNum * (oneNum - 1)) / 2 * (1LL << zeroNum) == K){bOneNum = oneNum;bZeroNum = zeroNum;}}}repeat (i, bOneNum) { b.push_back(1); }repeat (i, bZeroNum) { b.push_back(0); }cout << b.size() << endl;for (int64 e : b){cout << e << " ";}cout << endl;return 0;}