From 337b49cf5a36577b994d7d56f4ebc952871886d1 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Mon, 15 Aug 2016 15:55:41 +0800 Subject: [PATCH] Create 1018.cpp --- POJ/1018.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 POJ/1018.cpp diff --git a/POJ/1018.cpp b/POJ/1018.cpp new file mode 100644 index 0000000..31f76c3 --- /dev/null +++ b/POJ/1018.cpp @@ -0,0 +1,79 @@ +#include +#include +#include + +#include +using namespace std; +#define INF 0x3f3f3f3f +#define NINF 0xc0c0c0c0 +struct _device +{ + int b,p; +}; +_device info[105][205]; +int infocnt[105]; + +int GlobalMin=INF; +int GlobalLinerMin; + +int LinerMax[105]; + +int main() +{ + int t; + scanf("%d",&t); + while(t--) + { + int n; + scanf("%d",&n); + /// Input & Find Global Min + for(int i=0;i B and P is the min. + int minp=INF; + int minb=INF; + for(int j=0;j=B) + { + if(minp>info[i][j].p) + { + minp=info[i][j].p; + minb=min(minb,info[i][j].b); + } + } + } + PSUM+=minp; + BMIN=min(BMIN,minb); + } + MaxRate=max(MaxRate,(double)BMIN/PSUM); + } + printf("%.3f\n",MaxRate); + } + return 0; +}