From ca540fb153818a3795a419d09c6063a5b5ff58a0 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Wed, 23 Aug 2017 18:10:46 +0800 Subject: [PATCH] Create 3253.cpp --- POJ/3253.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 POJ/3253.cpp diff --git a/POJ/3253.cpp b/POJ/3253.cpp new file mode 100644 index 0000000..d2d0a85 --- /dev/null +++ b/POJ/3253.cpp @@ -0,0 +1,51 @@ +#include +#include +#include + +#include +#include +#include +#include +using namespace std; + +typedef long long ll; + +#define MAXN 20000 + +int N; +int L[MAXN+1]; + +void solve() +{ + priority_queue< int,vector,greater > bus; + for(int i=0;i1) + { + int A=bus.top(); + bus.pop(); + int B=bus.top(); + bus.pop(); + + int C=A+B; + ans+=C; + + bus.push(C); + } + + printf("%I64d\n",ans); +} + +int main() +{ + scanf("%d",&N); + for(int i=0;i