제출 #1068968

#제출 시각아이디문제언어결과실행 시간메모리
1068968RaresFelixRectangles (IOI19_rect)C++17
18 / 100
5076 ms28292 KiB
#include "rect.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vi = vector<int>;

ll count_rectangles(vector<vi> a) {
    int n = int(a.size()), m = int(a[0].size());
    int re = 0;
    for(int x1 = 1; x1 + 1 < n; ++x1)
        for(int x2 = x1; x2 + 1 < n; ++x2)
            for(int y1 = 1; y1 + 1 < m; ++y1)
                for(int y2 = y1; y2 + 1 < m; ++y2) {
                    int ok = 1;
                    for(int i = x1; i <= x2; ++i)
                        for(int j = y1; j <= y2; ++j)
                            ok &= a[i][j] < a[x1 - 1][j] && a[i][j] < a[x2 + 1][j]
                                && a[i][j] < a[i][y1 - 1] && a[i][j] < a[i][y2 + 1];
                    re += ok;
                }

	return re;
}

컴파일 시 표준 에러 (stderr) 메시지

rect.cpp: In function 'll count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:12:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   12 |     for(int x1 = 1; x1 + 1 < n; ++x1)
      |     ^~~
rect.cpp:24:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   24 |  return re;
      |  ^~~~~~
#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...