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

#TimeUsernameProblemLanguageResultExecution timeMemory
235989cfalasQuality Of Living (IOI10_quality)C++14
100 / 100
3658 ms120904 KiB
#include "quality.h" #include<bits/stdc++.h> using namespace std; #define MID (l+r)/2 int rectangle(int n, int m, int P, int q, int a[3001][3001]){ int l=0, r=n*m+1; int mm; while(l<=r){ int b[n][m] = {}; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(a[i][j]>MID) b[i][j] = 1; else if(a[i][j]<MID) b[i][j]=-1; } } int p[n+1][m+1] = {}; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ p[i][j] = p[i-1][j] + p[i][j-1] - p[i-1][j-1] + b[i-1][j-1]; } } bool poss = false; for(int i=P;i<=n;i++){ for(int j=q;j<=m;j++){ if(p[i][j] - p[i-P][j] - p[i][j-q] + p[i-P][j-q] <= 0) poss = true; } } if(poss) mm = MID, r = MID-1; else l = MID+1; } return mm; }

Compilation message (stderr)

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:32:9: warning: 'mm' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return mm;
         ^~
#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...