結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
|
提出日時 | 2018-06-15 03:02:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 321 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 63,744 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-07 14:18:10 |
合計ジャッジ時間 | 3,062 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 9 TLE * 1 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int k; main() { cin>>k; for(int i=2;;i++) { int n=i*(i-1)/2; if(k%n==0&&__builtin_popcount(k/n)==1) { int l=__builtin_ctz(k/n); cout<<i+l<<endl; cout<<1; for(int j=0;j<i-1;j++)cout<<" 1"; for(int j=0;j<l;j++)cout<<" 0"; cout<<endl; return 0; } } }