Submission #884810

#TimeUsernameProblemLanguageResultExecution timeMemory
884810IsamLjeto (COCI21_ljeto)C++17
0 / 50
1 ms496 KiB
#include<bits/stdc++.h> #ifdef DEBUG #include "debug.h" #else #define debug(...) void(37) #endif using namespace std; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N; cin >> N; array<vector<int>, 9> A; for(register int i = 0, a, b, t; i < N; ++i){ cin >> t >> a >> b; if((a <= 4 && b <= 4) || (a > 4 && b > 4)) continue; A[a].emplace_back(t); // ou } for(register int i = 1; i <= 8; ++i){ sort(A[i].begin(), A[i].end()); } long long pinneapple(0), blueberry(0); for(register int i = 1; i <= 4; ++i){ vector<int> tmp = A[i]; pinneapple += 1ll * (int)tmp.size() * 100; for(register int j = 1; j < (int)tmp.size(); ++j){ auto it = upper_bound(tmp.begin(), tmp.end(), tmp[j] - 10); if(it == tmp.begin()) continue; --it; int l = it - tmp.begin() + 1; // cout<<l<<endl; pinneapple += 1ll * 50 * l; } } for(register int i = 5; i <= 8; ++i){ vector<int> tmp = A[i]; blueberry += 1ll * (int)tmp.size() * 100; for(register int j = 1; j < (int)tmp.size(); ++j){ auto it = upper_bound(tmp.begin(), tmp.end(), tmp[j] - 10); if(it == tmp.begin()) continue; --it; int l = it - tmp.begin(); blueberry += 1ll * 50 * l; } } cout << pinneapple << ' ' << blueberry << '\n'; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:16:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |  for(register int i = 0, a, b, t; i < N; ++i){
      |                   ^
Main.cpp:16:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |  for(register int i = 0, a, b, t; i < N; ++i){
      |                          ^
Main.cpp:16:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |  for(register int i = 0, a, b, t; i < N; ++i){
      |                             ^
Main.cpp:16:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |  for(register int i = 0, a, b, t; i < N; ++i){
      |                                ^
Main.cpp:21:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |  for(register int i = 1; i <= 8; ++i){
      |                   ^
Main.cpp:25:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |  for(register int i = 1; i <= 4; ++i){
      |                   ^
Main.cpp:28:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |   for(register int j = 1; j < (int)tmp.size(); ++j){
      |                    ^
Main.cpp:37:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |  for(register int i = 5; i <= 8; ++i){
      |                   ^
Main.cpp:40:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |   for(register int j = 1; j < (int)tmp.size(); ++j){
      |                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...