Submission #851488

# Submission time Handle Problem Language Result Execution time Memory
851488 2023-09-20T00:55:40 Z cjtsai Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 600 KB
#include<iostream>
#include <algorithm>
#include <vector>
#define ff first
#define ss second
#define piii pair<int, pair<int, int>>
using namespace std;
signed main(){
	int n;cin>>n;
	vector<piii> li(n);
	for(int i=0; i<n; i++){
		int a, b, c;cin>>a>>b>>c;
		li[i]={a, {b, c}};
	}

	int ta=0, tb=0;
	vector<int> is(9, -10000);
	for(int i=0; i<n; i++){
		int at=li[i].ff, aa=li[i].ss.ff, ab=li[i].ss.ss;
		if(at-10<=is[aa]){
			if(aa>4&&ab<5) {tb+=150;is[aa]=at;}
			if(aa<5&&ab>4) {ta+=150;is[aa]=at;}
		}else{
			if(aa>4&&ab<5) {tb+=100;is[aa]=at;}
			if(aa<5&&ab>4) {ta+=100;is[aa]=at;}
		}
	}
	cout<<ta<<' '<<tb;
	
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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 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
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 600 KB Output is correct