# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
991585 |
2024-06-02T14:34:16 Z |
qrn |
Ljeto (COCI21_ljeto) |
C++14 |
|
1 ms |
604 KB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ep emplace_back
#define ins insert
#define fi first
#define er erase
#define se second
template<class IStr, class T>
IStr& operator>>(IStr& is, vector<T>& v) { for (auto& x : v) is >> x; }
#define give(v) \
cout << v << endl; \
return;
#define print(a) \
for (auto v : a) \
{ \
cout << v << " "; \
} \
cout << endl;
#define vs vector<string>
#define vi vector<int>
#define vb vector<bool>
#define pii pair<int, int>
#define vvi vector<vector<int>>
#define sz(x) x.size()
#define vpii vector<pair<int, int>>
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define ALL(x) x.begin(), x.end()
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define out cout << endl
#define impos cout << -1 << endl
#define int long long
const long double pi = 2 * acosl(0);
const int inf = 1e9 + 7;
const int mod = inf;
const int szz = 3e5 + 5;
struct spray{
int t;
int a;
int b;
};
void solve(){
int events;
cin >> events;
vector<pair<int,pii>>v; // time, shooter, killed
for(int round = 0; round < events; round++){
spray rr;
cin >> rr.t >> rr.a >> rr.b;
v.pb({rr.t, {rr.a, rr.b}});
}
sort(ALL(v));
int sol = 0, sag = 0;
for(int i = 0; i < events; i++){
if(v[i].se.fi <= 4){
sol += 100;
if(i != 0){
if(v[i].fi - v[i-1].fi <= 10 && v[i-1].se.fi == v[i].se.fi){
sol += 50;
}
}
} else {
sag += 100;
if(i != 0){
if(v[i].fi - v[i-1].fi <= 10 && v[i].se.fi == v[i-1].se.fi){
sag += 50;
}
}
}
}
cout << sol << " " << sag << endl;
}
signed main(){
SPEED;
int tst = 1;
// cin >> tst;
for(int cs = 1; cs <= tst; cs++){
solve();
}
// cerr << "\nTime Elapsed: " << (long double)clock() << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
1 ms |
604 KB |
Output is correct |
# |
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 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
604 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |