이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#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... |