제출 #388741

#제출 시각아이디문제언어결과실행 시간메모리
388741Pichon5삶의 질 (IOI10_quality)C++17
40 / 100
5091 ms3808 KiB
#include "quality.h" #include <bits/stdc++.h> #define vi vector<vi> #define ll long long int #define pb push_back using namespace std; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { //R rows //C columns // H de hight //W de weihght int M[3001][3001]; for(int i=1;i<=R*C;i++){ for(int j=0;j<R;j++){ for(int k=0;k<C;k++){ M[j][k]=0; if(Q[j][k]>i)M[j][k]=1; if(Q[j][k]<i)M[j][k]=-1; } } for(int j=0;j<R;j++){ for(int k=0;k<C;k++){ if(j)M[j][k]+=M[j-1][k]; if(k)M[j][k]+=M[j][k-1]; if(j>0 && k>0)M[j][k]-=M[j-1][k-1]; } } for(int j=0;j+H<=R;j++){ for(int k=0;k+W<=C;k++){ int sum=M[j+H-1][k+W-1]; if(j)sum-=M[j-1][k+W-1]; if(k)sum-=M[j+H-1][k-1]; if(j>0 && k>0)sum+=M[j-1][k-1]; if(sum==0){ return i; } } } } }

컴파일 시 표준 에러 (stderr) 메시지

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
#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...