| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 418970 | jacquesamsel | Rectangles (IOI19_rect) | C++14 | 10 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define vvint vector<vector<int>>
void print_vvint(vector<vector<int>>& grid) {
for (int i = 0; i < grid.size(); i++) {
for (int j = 0; j < grid[i].size(); j++) {
cout << grid[i][j] << " ";
}
cout << endl;
}
}
long long sumUp(int x) {
long long accumulator = 0;
for (int i = 1; i <= x; i++) {
accumulator += i;
}
return accumulator;
}
bool is_valid_vert(vvint& grid, int pos) {
return min(grid[0][pos], grid[2][pos]) > grid[1][pos];
}
bool is_valid_horiz(vvint& grid, int lpos, int rpos, int maxStretch) {
return min(grid[1][lpos-1], grid[1][rpos+1]) > maxStretch;
}
bool can_add(vvint& grid, int rightPos, int maxRow) {
maxRow = max(maxRow, grid[1][rightPos+1]);
if (grid[1][rightPos+1] <= maxRow) return false;
if (max(grid[0][rightPos], grid[2][rightPos]) <= grid[1][rightPos]) return false;
return true;
}
long long count_rectangles(vector<vector<int>> a) {
int n = a.size();
if (n < 3) {
return 0;
}
int m = a[0].size();
if (m < 3) {
return 0;
}
long long accumulator = 0;
// cout << is_valid(a, 2) << endl;
int maxRow = a[1][1];
for (int leftPos = 1; leftPos < m-1; leftPos++) {
int maxStretch = INT32_MIN;
for (int rightPos = leftPos; rightPos < m-1; rightPos++) {
if (!is_valid_vert(a, rightPos)) break;
maxStretch = max(maxStretch, a[1][rightPos]);
if (is_valid_horiz(a, leftPos, rightPos, maxStretch)) {
accumulator++;
// cout << "FOUND FROM " << leftPos << " TO " << rightPos << endl;
};
}
}
return accumulator;
}
컴파일 시 표준 에러 (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... | ||||
