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

#TimeUsernameProblemLanguageResultExecution timeMemory
574557mosiashvililukaQuality Of Living (IOI10_quality)C++14
100 / 100
1683 ms175488 KiB
#include<bits/stdc++.h> #include "quality.h" int a,b,c,d,e,i,j,ii,jj,zx,xc,lef,rig,mid,f[3005][3005],H,W,jm[3005][3005],E; int rectangle(int RR, int CC, int HH, int WW, int QQ[3001][3001]) { a=RR;b=CC; H=HH;W=WW; for(i=1; i<=a; i++){ for(j=1; j<=b; j++){ f[i][j]=QQ[i-1][j-1]; } } lef=0;rig=a*b+1; while(1){ if(lef+1>=rig) break; mid=(lef+rig)/2; for(i=1; i<=a; i++){ for(j=1; j<=b; j++){ if(f[i][j]<=mid){ jm[i][j]=1; }else{ jm[i][j]=0; } } } for(i=1; i<=a; i++){ for(j=1; j<=b; j++){ jm[i][j]+=jm[i-1][j]+jm[i][j-1]-jm[i-1][j-1]; } } E=0; for(i=H; i<=a; i++){ for(j=W; j<=b; j++){ zx=jm[i][j]-jm[i-H][j]-jm[i][j-W]+jm[i-H][j-W]; xc=(H*W)/2+1; if(zx>=xc) E=1; } } if(E==1){ rig=mid; }else{ lef=mid; } } return rig; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...