# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143973 | tincamatei | Rectangles (IOI19_rect) | C++14 | 2 ms | 396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
using namespace std;
bool goodRect(int i, int j, int exp) {
return j - i - 1 > 0 && exp >= j - i - 1;
}
long long subtask5(const vector<vector<int> > &matr) {
int N = matr.size(), M = matr[0].size();
int exp = 0;
int top = 0;
long long rez = 0LL;
vector<int> stiva(M);
for(int c = 0; c < M; ++c) {
bool eq = false;
while(top > 0 && matr[1][c] >= matr[1][stiva[top - 1]]) {
rez = rez + goodRect(stiva[top - 1], c, exp);
if(matr[1][c] == matr[1][stiva[top - 1]])
eq = true;
--top;
}
if(!eq && top > 0)
rez = rez + goodRect(stiva[top - 1], c, exp);
stiva[top++] = c;
if(matr[0][c] > matr[1][c] && matr[2][c] > matr[1][c])
++exp;
else
exp = 0;
}
return rez;
}
long long count_rectangles(std::vector<std::vector<int> > a) {
int N;
N = a.size();
if(N == 3)
return subtask5(a);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |