Submission #851484

# Submission time Handle Problem Language Result Execution time Memory
851484 2023-09-20T00:45:50 Z cjtsai Ljeto (COCI21_ljeto) C++14
0 / 50
1 ms 348 KB
#include<iostream>
#include <algorithm>
#include <vector>
#define ff first
#define ss second
#define piii pair<int, pair<int, int>>
using namespace std;
signed main(){
	int n;cin>>n;
	vector<piii> li(n);
	for(int i=0; i<n; i++){
		int a, b, c;cin>>a>>b>>c;
		li[i]={a, {b, c}};
	}
	sort(li.begin(), li.end());
	int ta=0, tb=0;
	vector<int> is(9, -100);
	for(int i=0; i<n; i++){
		int at=li[i].ff, aa=li[i].ss.ff, ab=li[i].ss.ss;
		if(is[aa]>i-10){
			if(aa>4&&ab<5) {tb+=150;is[aa]=i;}
			if(aa<5&&ab>4) {ta+=150;is[aa]=i;}
		}else{
			if(aa>4&&ab<5) {tb+=100;is[aa]=i;}
			if(aa<5&&ab>4) {ta+=100;is[aa]=i;}
		}
	}
	cout<<ta<<' '<<tb;
	
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:19:7: warning: unused variable 'at' [-Wunused-variable]
   19 |   int at=li[i].ff, aa=li[i].ss.ff, ab=li[i].ss.ss;
      |       ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 344 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -