Submission #1176932

#TimeUsernameProblemLanguageResultExecution timeMemory
1176932Ekber_EkberLjeto (COCI21_ljeto)C++20
50 / 50
1 ms328 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp> 
#define GOOD_LUCK ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define itn int
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define ins insert
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define count1 __builtin_popcount
#define all(v) v.begin(), v.end()
#define unset unordered_set
#define unmap unordered_map
#define pqueue priority_queue
#define ordered_set_less tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ordered_set_greater tree<int, null_type, greater<int>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;

struct point{
	
};

int ctoi(char x) {
	return (int)x - '0';
}

int sumab(int a, int b) {
	return (a + b) * (b - a + 1) / 2;
}

int gcd(int a, int b) {
	return (b == 0 ? a : gcd(b, a % b));
}

int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

int compress(int n, vector <int> &v) {
	vector <pair<int, int>> x(n);
	for (int i=0; i < n; i++) {
		x[i] = {v[i], i};
	}
	sort(all(x));
	int nxt=1;
	for (int i=0; i < n-1; i++) {
		if (x[i].ff == x[i+1].ff) {
			x[i].ff = nxt;
		}
		else x[i].ff = nxt++;
	}
	x[x.size()-1].ff = nxt;
	for (int i=0; i < n; i++) {
		swap(x[i].ff, x[i].ss);
	}
	sort(all(x));
	for (int i=0; i < n; i++) {
		v[i] = x[i].ss;
	}
	return nxt;
}

int compress_p(int n, vector <pair<int, int>> &v) {
	vector <pair<int, int>> q;
	for (int i=0; i < n; i++) {
		q.pb({v[i].ff, i});
		q.pb({v[i].ss, i});
	}
	sort(all(q));
	int nxt=0;
	for (int i=0; i < 2 * n - 1; i++) {
		if (q[i].ff == q[i+1].ff) q[i].ff = nxt;
		else q[i].ff = nxt++;
	}
	q.back().ff = nxt;
	for (auto &i : q) swap(i.ff, i.ss);
	sort(all(q));
	for (int i=0; i < 2*n; i+=2) {
		v[i/2].ff = q[i].ss;
		v[i/2].ss = q[i+1].ss;
	}
	return nxt;
}

void timelimit() {
	int x = 1e+9;
	while (x--) x++;
}

void runtime() {
	int x = 1, y = 0;
	cout << x / y;
}

constexpr int MAX = 2e+5 + 3, INF = 2e+9, MOD = 1e+9 + 7, K = 18;

int temp, temp1, temp2, temp3;

void _() {
	int n;
	cin >> n;
	array<vector<int>, 4> t1, t2;
	int s1, s2;
	s1 = s2 = 0;
	for (int i=0; i < n; i++) {
	    int a, b, c;
	    cin >> a >> b >> c;
	    if (b <= 4) {
	        t1[b-1].pb(a);
	        s1++;
	    }
	    else t2[b-5].pb(a), s2++;
	}
	s1 *= 100, s2 *= 100;
	sort(all(t1));
	sort(all(t2));
	for (int i=0; i < 4; i++) {
	    for (int j=1; j < t1[i].size(); j++) {
	        s1 += (t1[i][j] - t1[i][j-1] <= 10 ? 50 : 0);
	    }
	}
	for (int i=0; i < 4; i++) {
	    for (int j=1; j < t2[i].size(); j++) {
	        s2 += (t2[i][j] - t2[i][j-1] <= 10 ? 50 : 0);
	    }
	}
	cout << s1 << ' ' << s2;
}

signed main() {

	GOOD_LUCK

//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	freopen("log.txt", "w", stderr);
	srand(time(0));

	int tests=1;
//	cin >> tests;
	for (int i=1; i <= tests; i++) {
//		cout << "Case #" << i << ": ";
		_();
//		cout << endl;
	}
	
//	int n;
//	while (cin >> n) {
//		_(n);
//		cout << endl;
//	}

	return 0;
}
// Problem X
// by Ekber_Ekber
/*

*/

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:143:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  143 |         freopen("log.txt", "w", stderr);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...