(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #377827

#TimeUsernameProblemLanguageResultExecution timeMemory
377827kshitij_sodaniHop (COCI21_hop)C++14
110 / 110
54 ms1516 KiB
//#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...