#include <bits/stdc++.h>
/**
author : Farid
**/
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define f first
#define s second
#define pii pair<int , int>
#define pll pair<ll , ll>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define psi pair<string , int>
#define pci pair<char , int>
#define pic pair<int , char>
#define pis pair<int , string>
#define psl pair<string , ll>
#define pcl pair<char , ll>
#define plc pair<ll , char>
#define pls pair<ll , string>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ins insert
#define sl s.length()
#define END return 0
#define speed ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define all(x) (x).begin() , (x).end()
#define oo 1e9
#define rep(i,a,b) for(int i=a ; i<b ; i++)
#define repll(i,a,b) for(ll i=a ; i<b ; i++)
#define mrep(i,a,b) for(int i=a ; i>=b ; i--)
#define int ll
using namespace std;
///*****************************************************************
///---------------------------SOLUTION------------------------------
///*****************************************************************
void solve(){
int n;
cin >> n;
vector<pair<int , pii>> player1 , player2;
for(int i=0 ; i<n ; i++){
int time , p1 , p2;
cin >> time >> p1 >> p2;
if(p1 <= 4){
player1.pb({time , {p1 , p2}});
}
else{
player2.pb({time , {p1 , p2}});
}
}
sort(all(player1));
sort(all(player2));
int point1 = 0 , point2 = 0;
if(player1.size() > 1){
for(int i=1 ; i<player1.size() ; i++){
if(player1[i].f <= (player1[i-1].f + 10) && player1[i].s.f == player1[i-1].s.f){
point1 += 150;
}
else{
point1 += 100;
}
}
}
if(player2.size() > 1){
for(int i=1 ; i<player2.size() ; i++){
if(player2[i].f <= (player2[i-1].f + 10) && player2[i].s.f == player2[i-1].s.f){
point2 += 150;
}
else{
point2 += 100;
}
}
}
if(player1.size() > 0){
point1 += 100;
}
if(player2.size() > 0){
point2 += 100;
}
cout << point1 << " " << point2;
}
signed main(){
speed;
solve();
END;
}
Compilation message
Main.cpp: In function 'void solve()':
Main.cpp:64:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
64 | for(int i=1 ; i<player1.size() ; i++){
| ~^~~~~~~~~~~~~~~
Main.cpp:74:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
74 | for(int i=1 ; i<player2.size() ; i++){
| ~^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 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 |
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 |
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 |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |