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;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
template <typename T> inline bool chmin(T& a, const T b) {a = min(a, b); return (a == b);}
template <typename T> inline bool chmax(T& a, const T b) {a = max(a, b); return (a == b);}
inline void cls() {}
int get(long long x) {
int ret = -1;
for (int i = 0; i < 64; ++i) {
if ((x >> i) & 1) {
ret = i;
}
}
return ret;
}
void solve() {
cls();
int n;
cin >> n;
vector <long long> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = 1; i < n; ++i) {
for (int j = 0; j < i; ++j) {
int x = get(a[j]);
int y = get(a[i]);
if ((x / 4) == (y / 4)) {
cout << "1 ";
} else if ((x / 16) == (y / 16)) {
cout << "2 ";
} else {
cout << "3 ";
}
}
cout << "\n";
}
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef _LOCAL
system("color a");
// freopen("in.txt", "r", stdin);
#endif
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |