제출 #348004

#제출 시각아이디문제언어결과실행 시간메모리
348004beksultan04Rectangles (IOI19_rect)C++14
37 / 100
5053 ms34060 KiB
#include "rect.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; #define lol long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define scanl(a) scanf("%lld",&a); #define scanll(a,b) scanf("%lld %lld",&a, &b); #define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define scan1(a) scanf("%d",&a); #define scan2(a,b) scanf("%d %d",&a, &b); #define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c); #define all(s) s.begin(),s.end() #define allr(s) s.rbegin()Ñ,s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); #define eps 1e-12 const int N = 3e5+12,INF=1e9+7; vector <vector <int> > a; bool is(int r1,int r2,int c1,int c2){ int i,j; for (i=r1;i<=r2;++i){ for (j=c1;j<=c2;++j){ int mn = min(a[i][c1-1],min(a[i][c2+1],min(a[r1-1][j],a[r2+1][j]))); if (mn <= a[i][j])ret 0; } } ret 1; } lol count_rectangles(vector<vector<int> > a) { ::a = a; int n=a.size(),m = a[0].size(),i,j,ans=0,r1,r2,c1,c2; for (r1=1;r1<n-1;++r1){ for (r2=r1;r2<n-1;++r2){ for (c1=1;c1<m-1;++c1){ for (c2=c1;c2<m-1;++c2){ ans += is(r1,r2,c1,c2); } } } } return ans; } /* 6 5 4 8 7 5 6 7 4 10 3 5 9 7 20 14 2 9 14 7 3 6 5 7 5 2 7 4 5 13 5 6 */

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

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:41:36: warning: unused variable 'i' [-Wunused-variable]
   41 |     int n=a.size(),m = a[0].size(),i,j,ans=0,r1,r2,c1,c2;
      |                                    ^
rect.cpp:41:38: warning: unused variable 'j' [-Wunused-variable]
   41 |     int n=a.size(),m = a[0].size(),i,j,ans=0,r1,r2,c1,c2;
      |                                      ^
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...