Submission #974869

#TimeUsernameProblemLanguageResultExecution timeMemory
974869vjudge1Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector < vector < int >> a ( 9 ); for ( int i = 1; i <= n; i++){ int time, t1, t2; cin >> time >> t1 >> t2; a[t1].push_back(time); } ll ta = 0, tb = 0; for ( int i = 1; i <= 8; i++){ ll now = -1e9; for ( int j = 0; j < a[i].size(); j++){ if ( i <= 4 ){ if ( a[i][j] - now <= 10){ ta += 150; now = a[i][j]; } else{ ta += 100; now = a[i][j]; } } else{ if ( a[i][j] - now <= 10 ){ tb += 150; now = a[i][j]; } else{ tb += 100; now = a[i][j]; } } } } cout << ta << " " << tb << endl; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:21:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         for ( int j = 0; j < a[i].size(); j++){
      |                          ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...