Submission #382270

#TimeUsernameProblemLanguageResultExecution timeMemory
382270NONAMEHop (COCI21_hop)C++17
110 / 110
87 ms1388 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...