답안 #492133

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
492133 2021-12-05T15:07:46 Z LAMPALPHA Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 292 KB
#include "bits/stdc++.h"
#define ll long long
#define endl "\n";
using namespace std;
vector<pair<ll,ll>>lis[10];
void fast(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
signed main()
{
    ll x;
    ll ans1=0,ans2=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        ll r;
        ll a,b;
        cin>>a>>r>>b;
        lis[r].push_back(make_pair(a,b));
    }
    for(int i=0;i<9;i++)
    {
        if(lis[i].size()!=0){
        for(int j=0;j<lis[i].size()-1;j++)
        {
            if(abs(lis[i][j].first-lis[i][j+1].first)<=10)
            {
            if(i<=4)ans1+=150;
            else ans2+=150;}
                 else
            {
                if(i<=4)ans1+=100;
                else ans2+=100;
            }
            }}
            if(lis[i].size()>=1)
            {
                if(i<=4)ans1+=100;
                else ans2+=100;
            }
    }
cout<<ans1<<" "<<ans2;
    }



Compilation message

Main.cpp: In function 'int main()':
Main.cpp:22:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         for(int j=0;j<lis[i].size()-1;j++)
      |                     ~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 288 KB Output is correct
2 Correct 0 ms 292 KB Output is correct
3 Correct 1 ms 288 KB Output is correct
4 Correct 0 ms 288 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 288 KB Output is correct
4 Correct 0 ms 292 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 288 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 292 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 288 KB Output is correct
13 Correct 0 ms 204 KB Output is correct