Submission #492133

#TimeUsernameProblemLanguageResultExecution timeMemory
492133LAMPALPHALjeto (COCI21_ljeto)C++17
50 / 50
1 ms292 KiB
#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 (stderr)

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++)
      |                     ~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...