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>
#define int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 1e3+5;
int to[N][N];
int getnum(int i, int j){
if(__lg(i)/4==__lg(j)/4){
return 1;
}else if(__lg(i)/16==__lg(j)/16){
return 2;
}else{
return 3;
}
}
signed main(){
fastio
int n;
cin >> n;
int arr[n];
for(auto &x : arr) cin >> x;
for(int i = 0;i < n;i++){
for(int j = 0;j < i;j++){
to[i][j] = getnum(arr[i],arr[j]);
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < i;j++){
cout << to[i][j] << " ";
}
cout << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |