# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
974262 | 2024-05-03T07:00:35 Z | vjudge1 | Ljeto (COCI21_ljeto) | C++17 | 1 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back bool cmp(pair<ll,ll>a, pair<ll,ll>b){ if (a.first>b.first)return false; else if (a.first==b.first && a.second>b.second) return false; return true; } signed main(){ ll n; cin>>n; ll elang=0, bebek=0; vector<ll> time; vector< pair<ll,ll>> arr, brr; for (int i=0; i<n;i++){ ll t,a,b; cin>>t>>a>>b; time.push_back(t); if (a<5)arr.pb({a,t}); else brr.pb({b,t}); } ll bonusa=0; sort(arr.begin(),arr.end()); sort(brr.begin(),brr.end()); for (int i=1; i<arr.size();i++){ // cout<<arr[i1-].first<<" "<<arr[i].second; if (arr[i].first==arr[i-1].first){ if (arr[i].second <= arr[i-1].second+10) bonusa+=50; } } ll bonusb=0; for (int i=1; i<brr.size();i++){ if (brr[i].first==brr[i-1].first){ if (brr[i].second <= brr[i-1].second+10) bonusb+=50; } } cout<<arr.size()*100 + bonusa<<" "<<brr.size()*100 + bonusb<<endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | 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 | 344 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Incorrect | 0 ms | 348 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |