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;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int nums; cin >> nums;
vector<ll> vec(nums);
for (int i = 0; i < nums; i++) cin >> vec[i];
vector<int> grp(nums);
ll prevst = 0; int currgrp = -1;
for (int i = 0; i < nums; i++){
if (vec[i] >= prevst * 16) {
currgrp++;
prevst = vec[i];
}
grp[i] = currgrp;
}
for (int i = 1; i < nums; i++){
for (int j = 0; j < i; j++){
if (grp[j] == grp[i]) cout << 1;
else if (grp[i] - grp[j] < 4) cout << 2;
else cout << 3;
cout << ' ';
}
cout << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |