# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
914508 | Tuanlinh123 | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 345 ms | 104616 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define fi first
#define se second
using namespace std;
const ll maxn=200005;
ll A[maxn], H[maxn], C[maxn], deg[maxn];
map<ll, ll> cnt[maxn];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n, sum=0; cin >> n;
for (ll i=1; i<=n; i++)
cin>>A[i]>>H[i]>>C[i], sum+=C[i], deg[A[i]]++;
queue <ll> q;
for (ll i=1; i<=n; i++)
if (!deg[i]) q.push(i);
auto Merge=[&](map<ll, ll> &a, map<ll, ll> &b)
{
if (a.size()<b.size()) swap(a, b);
for (pll i:b) a[i.fi]+=i.se;
};
auto Fix=[&](map<ll, ll> &a, ll H, ll C)
{
a[H]+=C; auto it=a.lower_bound(H);
while (it!=a.begin())
{
컴파일 시 표준 에러 (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... |