From e6db2c3a9e004fefa90b23b99c6c78a44be25f72 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Tue, 23 Aug 2016 16:40:25 +0800 Subject: [PATCH] Create 1821.cpp --- POJ/1821.cpp | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 POJ/1821.cpp diff --git a/POJ/1821.cpp b/POJ/1821.cpp new file mode 100644 index 0000000..59f3206 --- /dev/null +++ b/POJ/1821.cpp @@ -0,0 +1,100 @@ +#include +#include +#include +#include +#include +#include +using namespace std; +#define MAXWORKER 110 +#define MAXBENCH 16005 + +#define dprintf(x,args...) +struct _worker +{ + int L,P,S; +}; +bool operator < (const _worker& inca,const _worker& incb) +{ + return inca.S>>>>>> i=%d\n",i); + //list pbus; + static_list_front=0; + static_list[0]=max(0,worker[i].S-worker[i].L); + static_list_end=1; + + for(int j=1;j<=N;j++) + { + dprintf(">>> j=%d (i=%d)\n",j,i); + + dp[i][j]=max(dp[i-1][j],dp[i][j-1]); + + /// i-th Worker cannot reach j-th bench + /// !!! Must include 'equal' (=) !!! + if(worker[i].L+worker[i].S<=j) continue; + + while(static_list_front