제출 #1334124

#제출 시각아이디문제언어결과실행 시간메모리
1334124NAMINLjeto (COCI21_ljeto)C++20
50 / 50
1 ms344 KiB
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N;
	cin >> N;
	vector<pair<int,pair<int,int>>> event(N);
	for(int i=0;i<N;i++){
		cin >> event[i].first >> event[i].second.first >> event[i].second.second;
	}
	sort(event.begin(),event.end());
	int s1 = 0,s2=0;
	for(int i=0;i<N;i++){
		if(event[i].second.first<5){
			s1+=100;
			for(int j=i-1;j>=0;j--){
				if(event[j].second.first<5){
					if(event[i].second.first==event[j].second.first
							&&event[i].first-event[j].first<=10){
						s1+=50;
						break;
					}
				}
			}
		}
		else{
			s2+=100;
			for(int j=i-1;j>=0;j--){
				if(event[j].second.first>=5){
					if(event[i].second.first==event[j].second.first
							&&event[i].first-event[j].first<=10){
						s2+=50;
						break;
					}
				}
			}
		}
	}
	cout << s1 << ' ' << s2 << endl;
}


#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...