結果
| 問題 | No.688 E869120 and Constructing Array 2 |
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-04-04 06:51:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 596 bytes |
| 記録 | |
| コンパイル時間 | 3,128 ms |
| コンパイル使用メモリ | 274,500 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-06-30 03:57:32 |
| 合計ジャッジ時間 | 7,873 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 2 WA * 7 TLE * 1 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144499999994;
ll mod=1000000007;
int main(){
ll k;
cin >> k;
ll x=0;
while (k%2==0)
{
k/=2;
x+=1;
}
vector<ll>a={1,1};
for (ll i = 0; i < x; i++)
{
a.push_back(0);
}
for (ll i = 0; i < k-2; i++)
{
a.push_back(1);
}
cout << a.size() << endl;
for (ll i = 0; i < a.size(); i++)
{
cout << a[i] << ' ';
}
cout << endl;
}
hiro71687k