# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
916386 | Jakub_Wozniak | Permutation (APIO22_perm) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
vector <int> v;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long t , n , m , f , xa, ya , xb , yb;
cin >> t;
while(t--)
{
cin >> n; long long akt = 200; bool b = 0;
while(n)
{
if(n == 1)break;
if(n%2)
{
v.push_back(0);
}
v.push_back(akt);
n /= 2;
akt--;
}
cout << v.size() << '\n';
for(int i = 0 ; i < v.size() ; i++)
{
cout << v[v.size()-i-1] << ' ';
}
cout << '\n';
v.clear();
}
return 0;
}