Submission #659411

# Submission time Handle Problem Language Result Execution time Memory
659411 2022-11-17T16:26:11 Z Kenpar Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 320 KB
#include "bits/stdc++.h"
using namespace std;

#define ll long long
#define endl '\n'

const ll MOD = 1e9+7;
const ll INF = 1e16;
const ll MAX = 2 * 1e5;

void solve(){
	int n;
	cin>>n;
	ll ans1 = 0, ans2 = 0;

	vector<int> last(9, -11);

	for(int i = 0; i < n; i++){
		int t,a,b;

		cin>>t>>a>>b;

		if(a <= 4) {
			ans1+=100;

			if(t - last[a] <= 10){
				ans1+=50;
			}

			last[a] = t;
		}else{
			ans2+=100;

			if(t - last[a] <= 10){
				ans2+=50;
			}

			last[a] = t;
		}
	}

	cout<<ans1<<" "<<ans2;
}


int main()
{
	cin.tie(NULL);
	ios::sync_with_stdio(NULL);
	int t = 1;

	//cin >> t;

	while(t--){
		//cout<<"Case #"<<t<<" > "<<endl;
		solve();

		cout<<endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 0 ms 320 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 0 ms 320 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 316 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 320 KB Output is correct
13 Correct 0 ms 320 KB Output is correct