結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| ユーザー |
nmnmnmnmnmnmnm
|
| 提出日時 | 2018-05-19 00:17:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,491 bytes |
| コンパイル時間 | 722 ms |
| コンパイル使用メモリ | 97,184 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 13:44:34 |
| 合計ジャッジ時間 | 2,839 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 9 |
ソースコード
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
#define MOD 1000000007
int main() {
ll k;
cin>>k;
if(k==0){
cout << 1 << endl;
cout << 0 << endl;
return 0;
}
vector<pair<ll,ll> > v;
rep(i,2,31){
v.pb(mp(i*(i-1)/2,i));
}
rep(i,0,v.sz){
if(k%v[i].fi==0){
ll k1 = k/v[i].fi;
ll c = 0;
rep(j,0,100){
if(k1%2==0){
k1/=2;
c++;
}
}
if(k1==1){
vector<ll> ans;
rep(j,0,v[i].se){
ans.pb(1);
}
rep(j,0,c){
ans.pb(0);
}
if(ans.sz<=30){
rep(i,0,ans.sz){
cout << ans[i];
if(i!=ans.sz-1)cout << " ";
}
cout << endl;
return 0;
}
}
}
}
return 0;
}
nmnmnmnmnmnmnm