답안 #974248

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974248 2024-05-03T06:47:43 Z vjudge1 Ljeto (COCI21_ljeto) C++17
25 / 50
3 ms 604 KB
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;


void solve(){
    ll n; cin>>n;
    vector<pair<ll,pair<ll,ll>>>v(n);
    ll asum=0;
    ll bsum=0;
    for(int i=0;i<n;i++){
        cin>>v[i].first>>v[i].second.first>>v[i].second.second;
        if(v[i].second.first==1 || v[i].second.first==2 || v[i].second.first==3 || v[i].second.first==4){
            asum+=100;
        }
        else{
            bsum+=100;
        }
    }
    vector<vector<ll>>cnt(8);
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(v[i].second.first==v[j].second.first){
                cnt[v[i].second.first-1].push_back(v[j].first-v[i].first);
            }
        }
    }
    for(int i=0;i<8;i++){
        for(int j=0;j<cnt[i].size();j++){
            if(cnt[i][j]<=10){
                if(i==0 || i==1 || i==2 || i==3){
                    asum+=50;
                }
                else{
                    bsum+=50;
                }
            }
        }
    }
    cout<<asum<<' '<<bsum<<endl;
    // ll n,k,b,s; cin>>n>>k>>b>>s;
    // priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>pq;
    // ll arr[n+1];
    // ll perm[n+1];
    // for(int i=1;i<=n;i++){
    //     cin>>perm[i];
    // }
    // for(int i=1;i<=n;i++){
    //     cin>>arr[i];
    // }
    // pq.push({})
}

int main(){
    ll tc; tc=1;
    while(tc--){
        solve();
    }
}

Compilation message

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