結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-02-06 14:27:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 938 bytes |
| コンパイル時間 | 758 ms |
| コンパイル使用メモリ | 76,136 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-02 22:41:48 |
| 合計ジャッジ時間 | 2,719 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
int main(){
ll k;
cin >> k;
vector<vector<ll>> a(35 , vector<ll>(35 , 0));
for(int i = 2; i < 35; i++){
a[i][0] = (ll)i * (i - 1) / 2;
}
for(int i = 2; i < 35; i++){
for(int j = 1; j < 35; j++){
a[i][j] = a[i][j - 1] * 2LL;
}
}
vector<int> ans;
int cnt_0 = 0 , cnt_1 = 0;
for(int i = 2; i < 35; i++){
for(int j = 0; j < 35; j++){
if(a[i][j] == k){
cnt_0 = j;
cnt_1 = i;
//cout << cnt_0 << " : " << cnt_1 << endl;
break;
}
}
}
for(int i = 0; i < cnt_0; i++){
cout << "0" << " ";
}
for(int i = 0; i < cnt_1; i++){
cout << "1";
if(i != cnt_1 - 1)cout << " ";
else cout << endl;
}
return 0;
}
mmn15277198