| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1364277 | mythofys | Grilled Bottle (KAISTRUN26SPRING_D) | C++20 | 196 ms | 16664 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define inf 4000000000000000000
#define mod 998244353
#define siz 524288
struct A
{
ll f,v;
}d[200005];
bool cmp(A i,A j)
{
return i.f < j.f;
}
priority_queue < ll > pq;
multiset < ll > s;
ll a[200005];
int main()
{
ll i,j,k,n,m,ans = 0;
scanf("%lld %lld",&n,&m);
for(i=1;i<=n;i++)
{
scanf("%lld %lld",&d[i].f,&d[i].v);
s.insert(d[i].f);
}
for(i=1;i<=m;i++)
{
scanf("%lld",&a[i]);
}
for(i=1;i<=m;i++)
{
if(s.lower_bound(a[i]) == s.end())break;
s.erase(s.lower_bound(a[i]));
}
i--;
printf("%lld ",i);
sort(a+1,a+i+1);
sort(d+1,d+1+n,cmp);
ll tail = n;
for(;i>=1;i--)
{
while(d[tail].f >= a[i])
{
pq.push(d[tail].v);
tail--;
}
ans += pq.top();
pq.pop();
}
printf("%lld",ans);
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
