| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1081660 | vjudge1 | Measures (CEOI22_measures) | C++17 | 38 ms | 10712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mod 998244353
#define int long long
#define endl '\n'
using namespace std;
using namespace __gnu_pbds;
using ordered_set = tree<pair<pair<int,int>,int>,null_type,less<pair<pair<int,int>,int>>,rb_tree_tag,tree_order_statistics_node_update>;
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,m,d;
cin>>n>>m>>d;
d*=2;
if(!n){
deque<pair<int,int>>a,b;
int tt=0,l=0,r=0,ans=0;
while(m--){
int x;
cin>>x;
x*=2;
ans+=(a.size()?max(0ll,d-(x-a.back().first)):0);
a.push_back({x,(a.size()?max(0ll,d-(x-a.back().first))+a.back().second:0)});
if(b.size())tt+=max(0ll,d-(x-b.back().first));
b.push_back({x,-tt});
// cout<<ans<<' ';
while(r+1<a.size()||l<r){
if(l<r){
int k=max(a.back().second-a[r].second,(b[0].second+tt)-(b[r].second+tt));
// cout<<r<<' '<<b[0].second-b[r].second<<' ';
if(k<=ans){
ans=k;
l++;
}else break;
}else{
int k=max(a.back().second-a[r+1].second,(b[0].second+tt)-(b[r].second+tt))+max(0ll,d-(a[r+1].first-a[r].first))/2;
if(k<=ans){
ans=k;
r++;
}else break;
}
}
cout<<ans/2;
if(ans&1)cout<<".5";
cout<<' ';
}
}else{
}
}
/*
1
13
7 10 13 |4 |5 10| 8| 3 6 5 |7 10| 2
*/
컴파일 시 표준 에러 (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... | ||||
