답안 #633646

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
633646 2022-08-23T00:05:34 Z rc_catunta Ljeto (COCI21_ljeto) C++14
50 / 50
1 ms 296 KB
#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

int main(){
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    vector<vi> v;
    v.assign(8,vi());
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int t,a,b;
        cin>>t>>a>>b;
        v[a-1].push_back(t);
    }
    // TEAM PINEAPPLE
    int pin=0;
    for(int i=0;i<=3;i++){
        pin+=(v[i].size()*100);
        //cout<<v[i].size()<<"\n";
        if(v[i].size()<2) continue;
        for(int j=0;j<v[i].size()-1;j++){
            if(v[i][j+1]-v[i][j]<=10) pin+=50;
        }
    }
    // TEAM BLUEBERRY
    int blue=0;
    for(int i=4;i<=7;i++){
        blue+=(v[i].size()*100);
        if(v[i].size()<2) continue;
        for(int j=0;j<v[i].size()-1;j++){
            if(v[i][j+1]-v[i][j]<=10) blue+=50;
        }
    }
    cout<<pin<<" "<<blue<<"\n";
    return 0;
}

Compilation message

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