답안 #606776

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
606776 2022-07-26T08:18:22 Z Ferid20072020 Ljeto (COCI21_ljeto) C++14
50 / 50
0 ms 212 KB
#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<ll , pll>> player1 , player2;
   for(int i=0 ; i<n ; i++){
      int time , p1 , p2;
      cin >> time >> p1 >> p2;
      if(p1 <= 4){
         player1.pb(mp(time , mp(p1 , p2)));
      }
      else{
         player2.pb(mp(time , mp(p1 , p2)));
      }
   }
   sort(all(player1));
   sort(all(player2));
   vector<bool>check1(player1.size()+1 , false);
   vector<bool>check2(player2.size()+1 , false);
   int point1 = player1.size() * 100 , point2 = player2.size() * 100;
   if(player1.size() > 1){
      for(int i=0 ; i<player1.size()-1 ; i++){
         for(int j=i+1 ; j<player1.size() ; j++){
            if(player1[j].f <= (player1[i].f + 10) && player1[j].s.f == player1[i].s.f && check1[j] == false){
               point1 += 50;
               check1[j] = true;
            }
         }
      }
   }
   if(player2.size() > 1){
      for(int i=0 ; i<player2.size()-1 ; i++){
         for(int j=i+1 ; j<player2.size() ; j++){
            if(player2[j].f <= (player2[i].f + 10) && player2[j].s.f == player2[i].s.f && check2[j] == false){
               point2 += 50;
               check2[j] = true;
            }
         }
      }
   }
   cout << point1 << " " << point2;
}
signed main(){
   speed;

   solve();

   END;
}



Compilation message

Main.cpp: In function 'void solve()':
Main.cpp:66: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]
   66 |       for(int i=0 ; i<player1.size()-1 ; i++){
      |                     ~^~~~~~~~~~~~~~~~~
Main.cpp:67:27: 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]
   67 |          for(int j=i+1 ; j<player1.size() ; j++){
      |                          ~^~~~~~~~~~~~~~~
Main.cpp:76: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]
   76 |       for(int i=0 ; i<player2.size()-1 ; i++){
      |                     ~^~~~~~~~~~~~~~~~~
Main.cpp:77:27: 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]
   77 |          for(int j=i+1 ; j<player2.size() ; j++){
      |                          ~^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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 0 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 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct