# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974425 | vjudge1 | Ljeto (COCI21_ljeto) | C++17 | 1 ms | 356 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
const ll M = 1e9+7;
int main() {
ll n,b=0,e=0;cin >> n;vector <vector<ll>> arr(9,vector<ll>());
while(n--){
ll a,b,c;cin >> a >> b >> c;
arr[b].push_back(a);
}for (ll i = 1; i <= 8; i++)
{
sort(arr[i].begin(),arr[i].end());
}for (ll i = 1; i <= 4; i++)
{
ll lt=-1;
for(ll tmp : arr[i]){
if(lt!=-1&&abs(lt-tmp)<=10)b+=150;
else b+=100;lt=tmp;
}
}for (ll i = 5; i <= 8; i++)
{
ll lt=-1;
for(ll tmp : arr[i]){
if(lt!=-1&&abs(lt-tmp)<=10)e+=150;
else e+=100;lt=tmp;
}
}cout << b << " " << e;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |