This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
llo n;
llo it[1001];
llo val[1001];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n;
llo ind=-1;
llo co=0;
for(llo i=0;i<n;i++){
cin>>it[i];
if(ind==-1){
ind=i;
}
if(it[i]>=2*it[ind]){
ind=i;
co++;
}
val[i]=co;
}
if(co>=60){
while(true){
continue;
}
}
/* for(llo i=0;i<n;i++){
cout<<val[i]<<",";
}
cout<<endl;*/
int dd=6;
/*if(n<=30){
dd=5;
}*/
for(llo i=1;i<n;i++){
for(llo j=0;j<i;j++){
/* if(val[j]==co-1 or val[j]==co or val[j]==co-2){
cout<<3<<" ";
continue;
}*/
if((val[i]/4)==(val[j]/4)){
cout<<1<<" ";
}
else if((val[j]/16)==(val[i]/16)){
cout<<2<<" ";
}
else{
cout<<3<<" ";
}
continue;
if((val[i]/dd)==(val[j]/dd)){
if((val[i]/dd)%3==0){
cout<<1<<" ";
}
else if((val[i]/dd)%3==1){
cout<<2<<" ";
}
else{
cout<<3<<" ";
}
}
else{
set<int> xx;
xx.insert((val[i]/dd)%3);
xx.insert((val[j]/dd)%3);
if(xx.find(0)==xx.end()){
cout<<1<<" ";
}
else if(xx.find(1)==xx.end()){
cout<<2<<" ";
}
else{
cout<<3<<" ";
}
}
/* else{
cout<<3<<" ";
}*/
/*cout<<(val[j]%3)+1<<" ";*/
}
cout<<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |