제출 #1242680

#제출 시각아이디문제언어결과실행 시간메모리
1242680haithamcoderRectangles (IOI19_rect)C++20
10 / 100
4 ms328 KiB
#include "rect.h" #include<bits/stdc++.h> using namespace std; // typedef long long ll; #define ll int #define db(x) cerr << #x << " = " << x << " | " #define dbg(x) cerr << #x << " = " << x << "\n" long long count_rectangles(std::vector<std::vector<int>> a) { ll n = a.size(), m = a[0].size(); if (n <= 2) return 0; long long res = 0; for (ll j = 1; j < m - 1; j++) { if (a[1][j - 1] <= a[1][j]) continue; ll mx = a[1][j]; for (ll k = j; k < m - 1; k++) { // db(j); dbg(k); if (a[0][k] <= a[1][k] || a[2][k] <= a[1][k]) { break; } else { mx = max(mx, a[1][k]); if (a[1][j - 1] <= mx) break; if (a[1][k + 1] <= mx) continue; else res++; } } } return res; }
#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...