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;
typedef long long ll;
const int A = 64;
const int N = 1001;
int n, col[A][A], a[N];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
for(int i = 0; i < A; i++)
for(int j = i + 1; j < A; j++)
for(int k = 2; k >= 0; k--)
if (j - i >= (1 << (2 * k))){
col[i][j] = k;
break;
}
cin >> n;
for(int i = 1; i <= n; i++){
ll x;
cin >> x;
a[i] = 63 - __builtin_clzll(x);
}
for(int j = 2; j <= n; j++){
for(int i = 1; i < j; i++)
cout << col[a[i]][a[j]] + 1 << ' ';
cout << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |