제출 #294856

#제출 시각아이디문제언어결과실행 시간메모리
294856mode149256Rectangles (IOI19_rect)C++14
10 / 100
7 ms512 KiB
#include<bits/stdc++.h> #include "rect.h" using namespace std; #define x first #define y second using ll = long long; using vi = vector<int>; using vl = vector<ll>; using vb = vector<bool>; using vii = vector<vi>; using pi = pair<int, int>; using vpi = vector<pi>; const int MX = 2e5 + 100; int N, M; ll count_rectangles(vii a) { N = (int)a.size(); M = (int)a[0].size(); if (N == 3) { vi sum(M, 0); sum[0] = 0; for (int i = 1; i < M - 1; ++i) { sum[i] = sum[i - 1] + int(a[1][i] < a[0][i] and a[1][i] < a[2][i]); } ll ats = 0; int did = 0; vi sk = a[1]; for (int s = 0; s < M - 2; ++s) { did = sk[s + 1]; for (int f = s + 2; sk[s] > did and f < M; ++f) { if (sk[f] > did and sum[f - 1] - sum[s] == f - s - 1) ats++; did = max(did, sk[f]); } } return ats; } return 0; }
#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...