Submission #646927

# Submission time Handle Problem Language Result Execution time Memory
646927 2022-10-01T06:25:44 Z GudStonks Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 300 KB
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<pair<int, pair<int, int> > >v;
	for(int i = 1, t, a, b; i <= n; i++)
	{
		cin>>t>>a>>b;
		v.push_back({t, {a, b}});
	}
	int ans = 0, ans1 = 0, ar[9] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
	sort(v.begin(), v.end());
	for(int i = 0; i < n; i++)
	{
		int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
		if(a <= 4)
			ans += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0);
		else
			ans1 += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0);
		ar[a] = t;
	}
	cout<<ans<<" "<<ans1;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:17:46: warning: unused variable 'b' [-Wunused-variable]
   17 |   int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
      |                                              ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 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 300 KB Output is correct
13 Correct 1 ms 296 KB Output is correct