Submission #247241

#TimeUsernameProblemLanguageResultExecution timeMemory
247241tictaccatRectangles (IOI19_rect)C++14
10 / 100
7 ms512 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(std::vector<std::vector<int> > a) { int n = a.size(); int m = a[0].size(); if (n <= 2) return 0; int cnt = 0; for (int i = 0; i < m-1; i++) { int mx = a[1][i+1]; if (mx >= a[1][i]) continue; for (int j = i+2; j < m; j++) { //cout << "! " << a[0][2] << "\n"; if (a[0][j-1] <= a[1][j-1] || a[2][j-1] <= a[1][j-1]) break; if (a[1][j] > mx) { mx = a[1][j]; cnt++; //cout << i << " " << j << "\n"; if (mx >= a[1][i]) break; } } } return cnt; }
#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...