답안 #974296

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974296 2024-05-03T07:41:17 Z vjudge1 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,pair<int,int>> pll;
int main()
{
	int n,db,dc,ansb=0,ansc=0,sb=0,sc=0;
	cin>>n;
	pll a[n];
	pll b[n];
	pll c[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i].first>>a[i].second.first>>a[i].second.second;
		if(a[i].second.first<=4)
		{
			b[sb].first=a[i].second.first;
			b[sb].second.first=a[i].first;
			b[sb].second.second=a[i].second.second;
			sb++;
		}
		else
		{
			c[sc].first=a[i].second.first;
			c[sc].second.first=a[i].first;
			c[sc].second.second=a[i].second.second;
			sc++;
		}
	}
	sort(b,b+sb);
	sort(c,c+sc);
	if(sb>0)
	{
		db=b[0].second.first;
		ansb+=100;
	}
	if(sc>0)
	{
		dc=c[0].second.first;
		ansc+=100;
	}
	for(int i=1;i<sb;i++)
	{
		if(b[i].first==b[i-1].first)
		{
			if(b[i].second.first<=db+10)
			{
				ansb+=150;
			}
			else
			{
				ansb+=100;
			}
		}
		else
		{
			ansb+=100;
		}
		db=b[i].second.first;
	}
	for(int i=1;i<sc;i++)
	{
		if(c[i].first==c[i-1].first)
		{
			if(c[i].second.first<=dc+10)
			{
				ansc+=150;
			}
			else
			{
				ansc+=100;
			}
		}
		else
		{
			ansc+=100;
		}
		dc=c[i].second.first;
	}
	cout<<ansb<<" "<<ansc<<" ";
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 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 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 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 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct