(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 #537769

#TimeUsernameProblemLanguageResultExecution timeMemory
537769jamezzzHop (COCI21_hop)C++17
110 / 110
27 ms1288 KiB
#include <bits/stdc++.h> using namespace std; #define sf scanf #define pf printf typedef long long ll; int n,pos[1005]; ll x[1005]; int main(){ sf("%d",&n); for(int i=1;i<=n;++i)sf("%lld",&x[i]); for(int i=1;i<=n;++i){ pos[i]=1; for(int j=1;j<i;++j){ if(x[i]%x[j]==0)pos[i]=max(pos[i],pos[j]+1); } } for(int i=2;i<=n;++i){ for(int j=1;j<i;++j){ if(x[i]%x[j]!=0){ pf("1 "); continue; } if(pos[i]/4==pos[j]/4)pf("1 "); else if(pos[i]/16==pos[j]/16)pf("2 "); else pf("3 "); } pf("\n"); } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:12:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  sf("%d",&n);
      |    ^
Main.cpp:13:25: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  for(int i=1;i<=n;++i)sf("%lld",&x[i]);
      |                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...