답안 #156807

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
156807 2019-10-07T13:37:09 Z AKaan37 Rectangles (IOI19_rect) C++17
10 / 100
8 ms 504 KB
#include "rect.h"
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <cstdio>
#include <unistd.h>
#include <cassert>
#include <string>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t;
int cev;
string s;
vector<int> v;

long long count_rectangles(std::vector<std::vector<int> > v) {
	cev=0;
	if(v.size()==3){
		for(int i=1;i<(int)v.size()-1;i++){
			for(int j=1;j<(int)v[i].size()-1;j++){
				int mx=0;
				for(int k=j;k<(int)v[i].size()-1;k++){
					mx=max(mx,v[i][k]);
					if(v[i][k]>=v[i-1][k] || v[i][k]>=v[i+1][k])break;
					if(mx<v[i][j-1] && mx<v[i][k+1])cev++;
				}
			}
		}
	}
	else{
		for(int i=1;i<(int)v.size()-1;i++){
			for(int j=1;j<(int)v[i].size()-1;j++){
				int mx1=0;
				
				for(int ii=i;ii<(int)v.size()-1;ii++){
					int mx=0;
					mx1=max(mx,v[ii][j]);
					for(int k=j;k<(int)v[i].size()-1;k++){
						mx=max(mx,v[ii][k]);
						
						if(mx1<v[ii][j-1] && mx1<v[ii][k+1] && mx<v[ii-1][k] && mx<v[ii+1][k]){
							cev++;
							//~ cout<<i<<" : : "<<ii<<" : : "<<j<<" : : "<<k<<" "<<mx<<" "<<mx1<<endl;
						}
						
					}
				}
			}
		}
	}
	return cev;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 376 KB Output is correct
2 Correct 6 ms 504 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 504 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 504 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 0 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -