From 305b08a8aec5b95d96b5d00c5bcca1f7cfc62150 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Wed, 8 Jun 2016 09:30:40 +0800 Subject: [PATCH] Create 1064.cpp --- QUSTOJ/1064.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 QUSTOJ/1064.cpp diff --git a/QUSTOJ/1064.cpp b/QUSTOJ/1064.cpp new file mode 100644 index 0000000..eef51b6 --- /dev/null +++ b/QUSTOJ/1064.cpp @@ -0,0 +1,21 @@ +#include +#include +using namespace std; +const int N=20010; +struct line{int l,r;}s[N]; +int n,head,tail; +long long ans; +bool cmp(line a,line b){return a.l==b.l? a.r=s[i+1].l) s[i+1].l=s[i].l,s[i+1].r=max(s[i].r,s[i+1].r); + else ans+=s[i].r-s[i].l; + } + ans+=s[n].r-s[n].l; + printf("%lld",ans); + return 0; +}