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

#TimeUsernameProblemLanguageResultExecution timeMemory
645693asdfghjklQuality Of Living (IOI10_quality)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include<vector> using namespace std; bool binar (vector<vector<int>> A, vector<vector<int>> B, int R, int C, int H, int W, int k); int main () { int R, C, H, W, k, mn=1; cin>>R>>C>>H>>W; int mx=R*C; vector<vector<int>> A(R, vector<int>(C)); vector<vector<int>> B(R, vector<int>(C)); for (int i=0; i<R; i++) { for (int o=0; o<C; o++) { cin>>A[i][o]; } } while (mn!=mx) { k=(mx+mn)/2; if (binar (A,B,R,C,H,W,k)==1) mx=k-1; else mn=k+1; } cout<<mn; return 0; }; bool binar (vector<vector<int>> A, vector<vector<int>> B, int R, int C, int H, int W, int k) { bool x=0; bool pref[R][C]; for (int i=0; i<R; i++) { for (int o=0; o<C; o++) { if (A[i][o]<k) B[i][o]=1; else B[i][o]=0; if (i==0&&o==0) pref [i][o]==B[i][o]; else if (i==0&&o>0) pref [i][o]==B[i][o]+pref[i][o-1]; else if (i>0&&o==0) pref [i][o]==B[i][o]+pref[i-1][o]; else pref[i][o]=pref[i-1][o]+pref[i][o-1]-pref[i-1][o-1]+B[i][o]; } } for (int i=0; i<R-H; i++) { for (int o=0; o<C-W; o++) { if ((pref[i+H][o+W]-pref[i-1][o+W]-pref[i+H][o-1]+pref[i-1][o-1])>=(H*W)/2) x=1; } } return x; }

Compilation message (stderr)

quality.cpp: In function 'bool binar(std::vector<std::vector<int> >, std::vector<std::vector<int> >, int, int, int, int, int)':
quality.cpp:40:32: warning: value computed is not used [-Wunused-value]
   40 |    if  (i==0&&o==0) pref [i][o]==B[i][o];
quality.cpp:41:48: warning: value computed is not used [-Wunused-value]
   41 |            else     if  (i==0&&o>0) pref [i][o]==B[i][o]+pref[i][o-1];
      |                                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
quality.cpp:42:48: warning: value computed is not used [-Wunused-value]
   42 |           else      if  (i>0&&o==0) pref [i][o]==B[i][o]+pref[i-1][o];
      |                                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccFDVtGA.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccIJy59w.o:quality.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccFDVtGA.o: in function `main':
grader.cpp:(.text.startup+0xe9): undefined reference to `rectangle(int, int, int, int, int (*) [3001])'
collect2: error: ld returned 1 exit status