답안 #646926

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
646926 2022-10-01T06:23:21 Z GudStonks Ljeto (COCI21_ljeto) C++17
15 / 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] + 1) <= 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;
      |                                              ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -