제출 #520705

#제출 시각아이디문제언어결과실행 시간메모리
520705peti1234Rectangles (IOI19_rect)C++17
0 / 100
2598 ms348 KiB
#include <bits/stdc++.h> using namespace std; bool jo(int a, int b, int c, int d, vector<vector<int>> &r) { // (a, b) a bal felso, (c, d) a jobb also sarok for (int sor=a; sor<=c; sor++) { int mini=1e9; for (int oszlop=b; oszlop<=d; oszlop++) { mini=min(mini, r[sor][oszlop]); } if (r[sor][b-1]<=mini || r[sor][d+1]<=mini) return 0; } for (int oszlop=b; oszlop<=d; oszlop++) { int mini=1e9; for (int sor=a; sor<=c; sor++) { mini=min(mini, r[sor][oszlop]); } if (r[a-1][oszlop]<=mini || r[c+1][oszlop]<=mini) return 0; } cout << "jo " << a << " " << b << " " << c << " " << d << "\n"; return 1; } long long count_rectangles(vector<vector<int>> r) { int n=r.size(), m=r[0].size(), db=0; for (int i=1; i<n; i++) { for (int j=i; j<n-1; j++) { for (int k=1; k<m; k++) { for (int l=k; l<m; l++) { if (jo(i, k, j, l, r)) { db++; } } } } } return db; }
#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...