Submission #535382

# Submission time Handle Problem Language Result Execution time Memory
535382 2022-03-10T06:47:49 Z l3nl3 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 340 KB
/*#pragma GCC optimize("O3")
#pragma GCC target ("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")*/

#include <bits/stdc++.h>

#define int long long

using namespace std;

const int N = 107;

int n, sx, sy;
vector<int> a[9];

signed main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin >> n;
	for (int t, x, y, i = 1; i <= n; i++) {
		cin >> t >> x >> y;
		a[x].push_back(t);
	}	
	for (int i = 1; i <= 8; i++) {
		sort(a[i].begin(), a[i].end());		
	}
	for (int i = 1; i <= 4; i++) {
		sx += (int)a[i].size() * 100;
		for (int j = 1; j < (int)a[i].size(); j++) {
			if (abs(a[i][j] - a[i][j-1]) <= 10) {
				sx += 50;
			}		
		}		
	}
	cout << sx << ' ';
	for (int i = 5; i <= 8; i++) {
		sy += (int)a[i].size() * 100;
		for (int j = 1; j < (int)a[i].size(); j++) {
			if (abs(a[i][j] - a[i][j-1]) <= 10) {
				sy += 50;
			}		
		}		
	}
	cout << sy;	
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 324 KB Output is correct