Submission #884814

# Submission time Handle Problem Language Result Execution time Memory
884814 2023-12-08T13:23:43 Z Isam Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 452 KB
#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);
	}
	long long pinneapple(0), blueberry(0);
	for(register int i = 1; i <= 4; ++i){
		pinneapple += 1ll * 100 * (int)A[i].size();
		for(register int j = 1; j < (int)A[i].size(); ++j) if(A[i][j] - A[i][j-1] <= 10) pinneapple += 50;
	}
	for(register int i = 5; i <= 8; ++i){
		blueberry += 1ll * 100 * (int)A[i].size();
		for(register int j = 1; j < (int)A[i].size(); ++j) if(A[i][j] - A[i][j-1] <= 10) blueberry += 50;
	}
	cout << pinneapple << ' ' << blueberry << '\n';
	return 0;
}

Compilation message

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:22:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |  for(register int i = 1; i <= 4; ++i){
      |                   ^
Main.cpp:24:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   24 |   for(register int j = 1; j < (int)A[i].size(); ++j) if(A[i][j] - A[i][j-1] <= 10) pinneapple += 50;
      |                    ^
Main.cpp:26:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |  for(register int i = 5; i <= 8; ++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)A[i].size(); ++j) if(A[i][j] - A[i][j-1] <= 10) blueberry += 50;
      |                    ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 452 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 452 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct