Submission #899656

#TimeUsernameProblemLanguageResultExecution timeMemory
899656KarootLjeto (COCI21_ljeto)C++17
50 / 50
1 ms604 KiB
#include <iostream> #include <cmath> #include <unordered_map> #include <map> #include <set> #include <queue> #include <vector> #include <string> #include <iomanip> #include <algorithm> #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using namespace std; typedef long long ll; ll linf = 1e15+1; inline void scoobydoobydoo(){ ios::sync_with_stdio(false); ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } vector<pair<int, int> > v[8]; int main(){ scoobydoobydoo(); int n; cin >> n; for (int i = 0; i < n; i++){ int t, a, b; cin >> t >> a >> b; a--; b--; v[a].push_back({t, b}); } int pineapple = 0, blueberries = 0; for (int i = 0; i < 4; i++){ sort(all(v[i])); pineapple += v[i].size()*100; for (int j = 1; j < v[i].size(); j++)pineapple += (v[i][j].first <= v[i][j-1].first+10)*50; } for (int i = 4; i < 8; i++){ sort(all(v[i])); blueberries += v[i].size()*100; for (int j = 1; j < v[i].size(); j++)blueberries += (v[i][j].first <= v[i][j-1].first+10)*50; } cout << pineapple << " " << blueberries << endl; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:43:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |         for (int j = 1; j < v[i].size(); j++)pineapple += (v[i][j].first <= v[i][j-1].first+10)*50;
      |                         ~~^~~~~~~~~~~~~
Main.cpp:49:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |         for (int j = 1; j < v[i].size(); j++)blueberries += (v[i][j].first <= v[i][j-1].first+10)*50;
      |                         ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...