---
title: "water~7"
author: "Midnight0101"
date: "2011-08-06T17:15:34Z"
tags: ["water 贪心 poj"]
categories: ["编程语言"]
slug: "water-7"
draft: false
lastmod: "2011-08-06T17:15:34Z"
id: 1141687
url: "https://midnight0101.iteye.com/blog/1141687"
---

poj1328\[url]http://poj.org/problem?id=1328\[/url] 比较简单的贪心，看代码，不细说了~ \[code="c++"] #include #include #include #include using namespace std; struct Space { double left; double right; friend bool operator&lt;(Space a,Space b) { return a.leftspace\[i+1].right) adjust=space\[i+1].right; } } cout&lt;&lt;"Case "&lt;&gt;n&gt;&gt;d; if(n==0 && d==0) break; for(i=0;i&gt;a&gt;&gt;b; if(b&gt;d && flag) { cout&lt;&lt;"Case "&lt;