Submission #1047742

# Submission time Handle Problem Language Result Execution time Memory
1047742 2024-08-07T15:29:44 Z vjudge1 Rectangles (IOI19_rect) C++17
10 / 100
1 ms 348 KB
#include "rect.h"

#include <bits/stdc++.h>
using namespace std;

const int lim=3000;

long long count_rectangles(std::vector<std::vector<int> > a) {
	int n=a.size();
	int m=a[0].size();
	if(n<3)return 0;
	if(n==3){
		vector<int>st;
		long int ans=0;
		for(int i=0;i<m;i++){
			if(1<st.size())
				for(int j=int(st.size())-2;0<=j;j--){
					if(a[1][st[j+1]]<a[1][i]){
						ans++;
					}else{
						break;
					}
				}
			while(st.size()&&a[1][st.back()]<a[1][i]){
				st.pop_back();
			}
			if(a[0][i]<=a[1][i]||a[2][i]<=a[1][i]){
				st.clear();
			}
			st.push_back(i);
		}
		return ans;
	}
	return -1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -