結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
![]() |
提出日時 | 2020-11-10 10:19:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 532 bytes |
コンパイル時間 | 587 ms |
コンパイル使用メモリ | 69,492 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 17:19:34 |
合計ジャッジ時間 | 1,569 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 1 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int K; cin >> K; for (int x = 0; x <= 30; x++){ for (int y = 0; y <= 30 - x; y++){ if (((y * (y - 1) / 2) << x) == K){ vector<int> b; for (int i = 0; i < x; i++){ b.push_back(0); } for (int i = 0; i < y; i++){ b.push_back(1); } int N = b.size(); cout << N << endl; for (int i = 0; i < N; i++){ cout << b[i]; if (i < N - 1){ cout << ' '; } } cout << endl; return 0; } } } }