| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 751810 | vjudge1 | Art Exhibition (JOI18_art) | C++14 | 0 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define LL long long
using namespace std;
int main()
{
LL n;
scanf("%lld",&n);
pair<LL,LL>arr[n+5];
for(LL a=1;a<=n;a++)
{
LL x,y;
scanf("%lld %lld",&x,&y);
arr[a]=make_pair(x,y);
}
sort(arr+1,arr+n+1);
bool tama=1;
LL awal,tot=0;
LL maks=0;
for(LL a=1;a<=n;a++)
{
if(a==1)
{
tot+=arr[a].second;
maks=max(maks,tot);
awal=a;
}
else
{
tot+=arr[a].second;
if(tot-abs(arr[a].first-arr[awal].first)<0)
{
tot=arr[a].second;
awal=a;
maks=max(tot,maks);
}
maks=max(tot-(arr[a].first-arr[awal].first),maks);
}
// printf("%lld\n",maks);
}
cout<<tot<<endl;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
