Submission #633641

# Submission time Handle Problem Language Result Execution time Memory
633641 2022-08-23T00:01:36 Z rc_catunta Ljeto (COCI21_ljeto) C++14
0 / 50
0 ms 212 KB
#include <iostream>
#include <vector>
using namespace std;

int main(){
    int x;cin>>x;
    vector <vector <int> > dis;
    dis.assign(8+1,vector<int>());
    for(int i=0;i<x;i++){
        int t,a,b;cin>>t>>a>>b;
        dis[a-1].push_back(t);
    }
    int cont=0,contt=0;
    for(int i=0;i<4;i++){
        for(int j=0;j<dis[i].size();j++){
            if(j==0){
                cont+=100;
            }else{
                if(dis[i][j-1]>=(dis[i][j]-10)){
                    cont+=150;
                }else{
                    cont+=100;
                }
            }
        }        
    }
    for(int i=4;i<8;i++){
        for(int j=0;j<dis[i].size();j++){
            if(j==0){
                cont+=100;
            }else{
                if(dis[i][j-1]>=(dis[i][j]-10)){
                    contt+=150;
                }else{
                    contt+=100;
                }
            }
        }        
    }
    cout<<cont<<" "<<contt;
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:15:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for(int j=0;j<dis[i].size();j++){
      |                     ~^~~~~~~~~~~~~~
Main.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |         for(int j=0;j<dis[i].size();j++){
      |                     ~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -