제출 #152592

#제출 시각아이디문제언어결과실행 시간메모리
152592MylderoRectangles (IOI19_rect)Java
37 / 100
5091 ms28508 KiB
class rect { int[][] a; int n, m; public boolean checkRectangle (int r1, int r2, int c1, int c2) { for (int i = r1; i <= r2; i++) { for (int j = c1; j <= c2; j++) { int t = a[i][j]; if (a[i][c1-1] <= t || a[i][c2+1] <= t || a[r1-1][j] <= t || a[r2+1][j] <= t) return false; } } return true; } public long count_rectangles(int[][] A) { a = A; n = a.length; m = a[0].length; long sum = 0; for (int r1 = 1; r1 < n-1; r1++) { for (int r2 = r1; r2 < n-1; r2++) { for (int c1 = 1; c1 < m-1; c1++) { for (int c2 = c1; c2 < m-1; c2++) { if (checkRectangle(r1, r2, c1, c2)) sum++; } } } } return sum; } }
#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...