답안 #1013099

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1013099 2024-07-03T07:45:45 Z vjudge1 Checker (COCI19_checker) C++17
23 / 110
105 ms 5372 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
int const N=2e5+5;
int const mod=1e9+7;

int bk[N],fr[N];
int n;
bool check(){
	for(int i=1;i<n;i++){
		// if(fr[i+1]==2 || bk[i]==n)
		// 	continue;
		if(fr[i+1]+1>bk[i])
			return 0;
	}
	// if(fr[1]==2 || bk[n]==n)
	// 	return 1;
	if(fr[1]+1>bk[n])
		return 0;
	return 1;
}
int main(){
	int t;
	cin>>t;
	cin>>n;
	string col;
	cin>>col;
	for(int i=1;i<=n;i++){
		fr[i]=2;
		bk[i]=n;
	}
	for (int i = 0; i < n-3; ++i)
	{
		int a,b,c;
		cin>>a>>b>>c;
		if(a>b)
			swap(a,b);
		int ba=(b-a)+1;
		fr[a]=max(fr[a],ba);
		bk[a]=min(bk[a],ba);
		int ab=(n+1)-(b-a);
		fr[b]=max(fr[b],ab);
		bk[b]=min(bk[b],ab);
	}
	// for (int i = 1; i <=n; ++i)
	// 	cout<<fr[i]<<' '<<bk[i]<<endl;
	if(check()==0)
		cout<<"neispravna triangulacija"<<endl;
	else
		cout<<"tocno"<<endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 5348 KB Output is correct
2 Correct 91 ms 5252 KB Output is correct
3 Correct 90 ms 5348 KB Output is correct
4 Correct 90 ms 5348 KB Output is correct
5 Correct 88 ms 5256 KB Output is correct
6 Correct 88 ms 5240 KB Output is correct
7 Correct 87 ms 5368 KB Output is correct
8 Correct 93 ms 5244 KB Output is correct
9 Correct 89 ms 5372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 91 ms 5364 KB Output is correct
2 Correct 89 ms 5368 KB Output is correct
3 Incorrect 105 ms 5328 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -