Submission #1280729

#TimeUsernameProblemLanguageResultExecution timeMemory
1280729tkm_algorithmsHop (COCI21_hop)C++20
0 / 110
0 ms332 KiB
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define int ll
#define rep(i, l, n) for(int i = l; i < (n); ++i)
const char nl = '\n';
const int N = 1e3+10;

int32_t main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	
	vector<int> a(n+1), b(n+1);
	rep(i, 1, n+1) {
		cin >> a[i];
		for (int j = 63; j >= 0; --j)
			if ((1ll<<j)&a[i]){b[i] = j;break;}
	}
	
	int who[n+1][n+1];
	memset(who, 0, sizeof who);
	
	rep(i, 1, n+1)
		rep(j, i+1, n+1) {
			if (a[i] == 1)who[i][j] = 2;
			//if (a[j]%a[i] == 0) {
				//if (b[j]/4 == b[i]/4)who[i][j] = 0;
				//else if (b[j]/16 == b[i]/16)who[i][j] = 1;
				//else who[i][j] = 2;
			//}
		}
		
	rep(i, 2, n+1) {
		rep(j, 1, i)cout << who[j][i]+1 << " ";
		cout << nl;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...