锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久国产精品-久久精品,久久免费小视频,精品久久久无码中文字幕http://m.shnenglu.com/luyulaile/category/10564.htmlI canzh-cnThu, 09 Jul 2009 18:48:56 GMTThu, 09 Jul 2009 18:48:56 GMT60joj 2228 Crossed ladders 浜屽垎娉曟眰瑙f柟紼?/title><link>http://m.shnenglu.com/luyulaile/archive/2009/07/08/89559.html</link><dc:creator>luis</dc:creator><author>luis</author><pubDate>Wed, 08 Jul 2009 11:30:00 GMT</pubDate><guid>http://m.shnenglu.com/luyulaile/archive/2009/07/08/89559.html</guid><wfw:comment>http://m.shnenglu.com/luyulaile/comments/89559.html</wfw:comment><comments>http://m.shnenglu.com/luyulaile/archive/2009/07/08/89559.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/luyulaile/comments/commentRss/89559.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/luyulaile/services/trackbacks/89559.html</trackback:ping><description><![CDATA[<div id="sk2ww24" class=prob_text> <p>A narrow street is lined with tall buildings. An x foot long ladder is rested at the base of the building on the right side of the street and leans on the building on the left side. A y foot long ladder is rested at the base of the building on the left side of the street and leans on the building on the right side. The point where the two ladders cross is exactly c feet from the ground. How wide is the street? <br> <center><img src="http://acm.jlu.edu.cn/joj/images/problems/2228_1.jpg"></center> <p> </p> <h3>Input Specification</h3> <p>Each line of input contains three positive floating point numbers giving the values of x, y, and c. </p> <h3>Output Specification</h3> <br> <p>For each line of input, output one line with a floating point number giving the width of the street in feet, with three decimal digits in the fraction. </p> <h3>Sample Input</h3> <pre>30 40 10 12.619429 8.163332 3 10 10 3 10 10 1 </pre> <h3>Sample Output</h3> <pre>26.033 7.000 8.000 9.798 </pre> </div> <br>joj嫻嬭瘯鏁版嵁寰堝急錛屽彲鑳藉湪鍏朵粬oj涓婅繃涓嶄簡錛屾牴鎹笁瑙掑艦鐩鎬技寰楀嚭浠ヤ笅鍏充簬w鐨勬柟紼嬶紝瑙錛岀涓嬈$敤浜屽垎娉曪紝涓嶉敊銆?br>f(w) = c - sqrt((y*y-w*w)*(x*x-w*w))/(sqrt(y*y-w*w) + sqrt(x*x -w*w))<br><br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">cstdlib</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">iomanip</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">math.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">f(w) = c - sqrt((y*y-w*w)*(x*x-w*w))/(sqrt(y*y-w*w) + sqrt(x*x -w*w))</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">  </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> func(</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> x,</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> y,</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> c)<br>  {<br>    </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> wdown</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0.0</span><span style="COLOR: #000000">,wup,w,fw;<br>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(x</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">y)<br>    wup</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">y;<br>    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br>    wup</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">x;<br>    w</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">wup</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">2.0</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br>    {<br>        fw</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">c</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">sqrt((y</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">y</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">w)</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(x</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">x</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">w))</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">(sqrt(y</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">y</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">w) </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> sqrt(x</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">x </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">w</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">w));<br>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(fw</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">0.0001</span><span style="COLOR: #000000">)<br>         {<br>                wup</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">w;<br>                w</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(wup</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">wdown)</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;<br>         }<br>        </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br>        {<br>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(fw</span><span style="COLOR: #000000"><-</span><span style="COLOR: #000000">0.0001</span><span style="COLOR: #000000">)<br>            {<br>                wdown</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">w;<br>                w</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(wup</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">wdown)</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;<br>            }<br>            </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br>            {<br>                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> w;<br>            }<br>        }<br>    }<br>        <br>   }<br> </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()          <br>{  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">freopen("s.txt","r",stdin);<br>  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">freopen("key.txt","w",stdout);</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">  </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> x,y,c;<br></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">( cin</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">x</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">y</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">c)<br>{<br>    cout</span><span style="COLOR: #000000"><<</span><span style="COLOR: #0000ff">fixed</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">setprecision(</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">func(x,y,c)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">endl;<br>}<br><br>  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">system("PAUSE");</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">  </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">   </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>  }<br><br></span></div> <img src ="http://m.shnenglu.com/luyulaile/aggbug/89559.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/luyulaile/" target="_blank">luis</a> 2009-07-08 19:30 <a href="http://m.shnenglu.com/luyulaile/archive/2009/07/08/89559.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>joj 1995: Energy 姹傝繛緇瓙涓蹭嬌鍜屾渶澶?/title><link>http://m.shnenglu.com/luyulaile/archive/2009/07/04/89209.html</link><dc:creator>luis</dc:creator><author>luis</author><pubDate>Sat, 04 Jul 2009 01:27:00 GMT</pubDate><guid>http://m.shnenglu.com/luyulaile/archive/2009/07/04/89209.html</guid><wfw:comment>http://m.shnenglu.com/luyulaile/comments/89209.html</wfw:comment><comments>http://m.shnenglu.com/luyulaile/archive/2009/07/04/89209.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/luyulaile/comments/commentRss/89209.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/luyulaile/services/trackbacks/89209.html</trackback:ping><description><![CDATA[<p>Energy</p> <hr> <p> <table cellSpacing=3 cellPadding=3 width="75%" border=1> <colgroup style="COLOR: red; TEXT-ALIGN: center" span=7> <tbody> <tr> <th height=40>Status</th> <th>In/Out</th> <th>TIME Limit</th> <th>MEMORY Limit</th> <th>Submit Times</th> <th>Solved Users</th> <th>JUDGE TYPE</th> </tr> <tr> <td align=middle height=40><span id=probinfo_placeholder><img height=20 src="http://acm.jlu.edu.cn/joj/images/ok1.gif" width=20></span></td> <td>stdin/stdout</td> <td>3s</td> <td>10240K</td> <td>717</td> <td>196</td> <td>Standard</td> </tr> </tbody> </table> </p> <div id="c2oissc" class=prob_text> <p>Mr. Jojer is a very famous chemist. He is doing a research about behavior of a group of atoms. Atoms may have different energy and energy can be positive or negative or zero, e.g. 18 or -9. Absolute value of energy can not be more than 100. Any number of continuous atoms can form an atom-group. Energy of an atom-group is defined by the sum of energy of all the atoms in the group. All the atoms form an atom-community which is a line formed by all the atoms one by one. Energy of an atom-community is defined by the greatest energy of an atom-group that can be formed by atoms in the atom-community. The problem is, given an atom-community, to calculate its energy.</p> <h3>Input</h3> <p>The input contains several test cases. Each test case consists of two lines describing an atom-community. The first line of each test case contains an integer N(N<=1000000), the number of atoms in the atom-community. The second line of each test case contains N integers, separated by spaces, each representing energy of an atom, given in the order according to the atom-community. The last test case marks by N=-1, which you should not proceed.</p> <h3>Output</h3> <p>For each test case(atom-community description), print a single line containing the energy.</p> <h3>Sample Input</h3> <pre>5 8 0 6 4 -1 -1</pre> <h3>Sample Output</h3> <pre>18</pre> </div> <p><br>鐞嗚В棰樻剰寰堥噸瑕侊紝棰樼洰鐨勬剰鎬濇槸璇?鍦╩涓腑閫?nbsp;  榪炵畫鐨刵涓猘tom鑳介噺鍊?浣垮叾鏈澶с?br>紼嬪簭涓璼umtemp錛宻um銆俿umtemp紜畾鐨勬槸鍏跺乏杈圭晫錛宻um紜畾鍏跺彸杈圭晫銆?br>sumtemp紜畾宸﹁竟鍓峮涓暟涔嬪拰涓鴻礋鐨勬渶澶х殑n錛屼笖絎琻涓暟鏄劇劧涓鴻礋錛岀劧鍚庝粠n+1寮濮嬮夋暟銆?br>sum紜畾浜嗗彸杈圭晫浣垮叾鏈澶с?br>姹傚拰鏈澶ч兘鍙互鐢ㄨ繖縐嶆濊礬錛侊紒錛侊紒錛侊紒錛侊紒錛侊紒<br>涓句緥<br>1錛?錛?4錛?錛?錛?2錛?錛?錛?6錛?錛?3錛?錛?0<br>璇風湅sumt1=1,sum=1<br>sumt2=2;sum=1+2=3;<br>sum3=sum2-4=-1;鍒檚umtemp=0;sum涓嶅彉銆?br>sum4=sumtemp+4;sum<sum4,sum=4;<br>sum5=sumtemp+2錛泂um<sum5,sum=6<br>鎬諱箣sum鍙湁鍦╯um<sumtemp鏃舵墠淇敼銆俿umtemp<0鍒欐竻0.<br>涓緇磀p.<br>#include"stdio.h"<br>int main()<br>{<br> freopen("s.txt","r",stdin);<br>  freopen("key.txt","w",stdout);<br> int n;<br> int a;<br> while(scanf("%ld",&n),n!=-1)<br> {  <br>      long long  sum=-0x7fffffff,sumtemp=-0x7fffffff;<br>   for(long i=0;i<n;i++)<br>   { <br>    scanf("%d",&a);<br>    if(sumtemp>0)<br>   sumtemp+=a;<br>    else<br>   sumtemp=a;<br>    if(sumtemp>sum)<br>   sum=sumtemp;</p> <p>   }<br>   printf("%lld\n",sum);</p> <p> }<br> return 0;<br>}</p> <img src ="http://m.shnenglu.com/luyulaile/aggbug/89209.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/luyulaile/" target="_blank">luis</a> 2009-07-04 09:27 <a href="http://m.shnenglu.com/luyulaile/archive/2009/07/04/89209.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>joj 1966 Super Market III 甯︽湁鏈熼檺鐨勪綔涓氭帓搴忛棶棰?璐績http://m.shnenglu.com/luyulaile/archive/2009/07/02/89066.htmlluisluisThu, 02 Jul 2009 05:11:00 GMThttp://m.shnenglu.com/luyulaile/archive/2009/07/02/89066.htmlhttp://m.shnenglu.com/luyulaile/comments/89066.htmlhttp://m.shnenglu.com/luyulaile/archive/2009/07/02/89066.html#Feedback0http://m.shnenglu.com/luyulaile/comments/commentRss/89066.htmlhttp://m.shnenglu.com/luyulaile/services/trackbacks/89066.html

A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of time for being sold. A selling schedule is an ordered subset of products Sell ≤ Prod such that the selling of each product x∈Sell, according to the ordering of Sell, completes before the deadline dx or just when dx expires. The profit of the selling schedule is Profit(Sell)=Σx∈Sellpx. An optimal selling schedule is a schedule with a maximum profit.
For example, consider the products Prod={a,b,c,d} with (pa,da)=(50,2), (pb,db)=(10,1), (pc,dc)=(20,2), and (pd,dd)=(30,1). The possible selling schedules are listed in table 1. For instance, the schedule Sell={d,a} shows that the selling of product d starts at time 0 and ends at time 1, while the selling of product a starts at time 1 and ends at time 2. Each of these products is sold by its deadline. Sell is the optimal schedule and its profit is 80.


Write a program that reads sets of products from an input text file and computes the profit of an optimal selling schedule for each set of products.

 

Input

A set of products starts with an integer 0 <= n <= 10000, which is the number of products in the set, and continues with n pairs pi di of integers, 1 <= pi <= 10000 and 1 <= di <= 10000, that designate the profit and the selling deadline of the i-th product. White spaces can occur freely in input. Input data terminate with an end of file and are guaranteed correct.

Output

For each set of products, the program prints on the standard output the profit of an optimal selling schedule for the set. Each result is printed from the beginning of a separate line.

Sample Input

4  50 2  10 1   20 2   30 1
7  20 1   2 1   10 3  100 2   8 2
5 20  50 10

 

Sample Output

80
185

 

Hint

The sample input contains two product sets. The first set encodes the products from table 1. The second set is for 7 products. The profit of an optimal schedule for these products is 185.


#include<iostream>
#include<cstdlib>
using namespace std;
#define MAX 10001
#define min(a,b) ((a)<(b) ? (a) : (b))
int father[MAX];
int p[MAX];
int result[MAX];
struct job{
     int value;
     int T;
  }JOB[MAX];
bool operator <(job job1,job job2)
 {
  if(job1.value>job2.value)
  return true;
  else
  return false;
 } 
 int find(int x)  //·µ»ØµÚ£Ø½ÚµãËùÊô¼¯ºÏµÄ¸ù½áµã
  {
int px=x;
while(p[px]>=0)
   px=p[px];
int tmp;
while(p[x]>=0)//ӦΪ³õֵΪ¸º
{
   tmp=p[x];
   p[x]=px;
   x=tmp;
}
return px;
}

   void UNION(int x,int y)
{
x=find(x);
y=find(y);
if(x==y)
   return ;
int tmp=p[x]+p[y];
if(p[x]>p[y])
{
   p[y]=tmp;
   p[x]=y;
}
else
{
   p[x]=tmp;
   p[y]=x;
}
}
 
  int main()
  {
  freopen("s.txt","r",stdin);
  freopen("key.txt","w",stdout);
  int num,temp=0;
  while(cin>>num)
  {
  memset(result,0,num);
  int i,l,j,k=0;
  for( i=0;i<num;i++)
  {
   cin>>JOB[i].value>>JOB[i].T;
   father[i]=i;
   p[i]=-1;
  }
  sort(JOB,JOB+num);
  for(i=0;i<num;i++)
  {
   j=find(min(JOB[i].T,num-1));//
   if(father[j]!=0)
       {
     k++;
     result[k]=i;
        l=find(father[j]-1);
        UNION(l,j);
        father[j]=father[l];
    }
  }
  i=0;
  for(j=1;j<=k;j++)
  { 
   i+=JOB[result[j]].value;}
    cout<<i<<endl;
   }

  //system("PAUSE");
  return   0;
  }
瀵圭潃璇炬湰鍐欏緱錛岃嚜宸遍兘鐪嬩笉鎬庝箞鎳傘?/p>

luis 2009-07-02 13:11 鍙戣〃璇勮
]]>
joj 1157 Station Balance 姘?/title><link>http://m.shnenglu.com/luyulaile/archive/2009/07/01/88970.html</link><dc:creator>luis</dc:creator><author>luis</author><pubDate>Wed, 01 Jul 2009 02:54:00 GMT</pubDate><guid>http://m.shnenglu.com/luyulaile/archive/2009/07/01/88970.html</guid><wfw:comment>http://m.shnenglu.com/luyulaile/comments/88970.html</wfw:comment><comments>http://m.shnenglu.com/luyulaile/archive/2009/07/01/88970.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/luyulaile/comments/commentRss/88970.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/luyulaile/services/trackbacks/88970.html</trackback:ping><description><![CDATA[#include<iostream><br>#include<cstdlib><br>#include<iomanip><br>#include<algorithm> <br>#include<math.h><br>using namespace std;<br><br>  int main()<br>  {<br>//freopen("s.txt","r",stdin);<br>// freopen("key.txt","w",stdout);<br>  int n,m;<br>  int a[12];<br>  int time=0;<br>  while(cin>>n>>m)<br>  {<br>int i,j;<br>double k;<br>memset(a,0,sizeof(a));<br>time++;<br>double sum=0.0;<br>double temp=0.0;<br>for(i=0;i<m;i++)<br>{<br>cin>>a[i];<br>sum+=a[i];<br>}<br>sum/=n;<br>sort(a,a+2*n);//????a[0]????a[2n-1] <br>for(j=0;j<n;j++)<br>{<br>k=a[j]+a[2*n-j-1]-sum;<br>if(k>0)<br>        temp+=k;<br>    else<br>     temp-=k;<br>    }<br>    cout<<"Set #"<<time<<endl;<br>        cout<<"IMBALANCE = "<<fixed<<setprecision(5)<<temp<<endl<<endl;<br>  }<br><br>  //system("PAUSE");<br>  return   0;<br>  }<br>1錛岃璁″埌鍑忔硶娉ㄦ剰鏄惁鏄痙ouble綾誨瀷<br>2錛岃涓嶈緇濆鍊鹼紝abs(),include<math.h><br>3,cout<<fixed<<setprecision(5)鑳戒繚闅滃皬鏁扮偣鍚庢湁錛?錛夊嚑浣嶅皬鏁? <img src ="http://m.shnenglu.com/luyulaile/aggbug/88970.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/luyulaile/" target="_blank">luis</a> 2009-07-01 10:54 <a href="http://m.shnenglu.com/luyulaile/archive/2009/07/01/88970.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>joj 2387 Fix the stick璐績綆楁硶錛岀敤鍒頒簡鎺掑簭浼樺寲http://m.shnenglu.com/luyulaile/archive/2009/05/16/83111.htmlluisluisSat, 16 May 2009 03:41:00 GMThttp://m.shnenglu.com/luyulaile/archive/2009/05/16/83111.htmlhttp://m.shnenglu.com/luyulaile/comments/83111.htmlhttp://m.shnenglu.com/luyulaile/archive/2009/05/16/83111.html#Feedback0http://m.shnenglu.com/luyulaile/comments/commentRss/83111.htmlhttp://m.shnenglu.com/luyulaile/services/trackbacks/83111.html#include<iostream>
#include
<cstdlib>
using namespace std;
int MIN;
struct P
{
    
int  b;
    
int e;
    
int visited;
}arr[
10000];
int comp(const void *arg1, const void *arg2)
{
    
return (*(struct P *)arg1).e < (*(struct P *)arg2).e;
}


  
void func(int LEN,int N,int i,int sb)//LEN鏄渶鍙寵竟閭d釜鐐癸紝N鏄晫闄愶紝i鏄紑濮嬫敮鎸佺殑鐐癸紝Nsb鏄鏁?nbsp;
  {
    MIN
=sb;    
    
int start=LEN;    
      
if(LEN>0)
     {
        
while(i<N)
        {
           
if(arr[i].e<LEN)break;
            
else
          {
              
if(arr[i].b<start)
                start
=arr[i].b;
          }     
            i
++;
        }  
        func(start,N,i,sb
+1);
    }    
  }
  
int main()
  {
//freopen("s.txt","r",stdin);
//freopen("key.txt","w",stdout);    
  int LEN,N,j,temp1,temp2;
  cin
>>LEN>>N;
  
while(LEN!=0)
  {
        MIN
=10000;
        
for(j=0;j<N;j++)
        {
        cin
>>temp1>>temp2;
        arr[j].b
=temp1-temp2;
        arr[j].e
=temp1+temp2;
        }
        qsort(arr, N, 
sizeof(arr[0]), comp);
        func(LEN,N,
0,0);
        cout
<<MIN<<endl;
        cin
>>LEN>>N;
  }

  
//system("PAUSE");
  return   0;
  }


luis 2009-05-16 11:41 鍙戣〃璇勮
]]>
国产L精品国产亚洲区久久| 国产精品熟女福利久久AV| 亚洲色欲久久久久综合网 | 欧美午夜A∨大片久久 | 91精品国产乱码久久久久久| www.久久99| 亚洲国产精品成人久久蜜臀| 久久久久亚洲AV无码观看| 精品国际久久久久999波多野| 色综合久久中文综合网| 婷婷久久五月天| 9191精品国产免费久久| 久久笫一福利免费导航| 久久国产高清字幕中文| 亚洲精品综合久久| 丁香五月网久久综合| 久久亚洲AV成人无码软件| 久久午夜电影网| 人人狠狠综合久久88成人| 久久婷婷五月综合97色| 久久国产精品偷99| 久久九九精品99国产精品| 欧美与黑人午夜性猛交久久久| 久久精品欧美日韩精品| 99精品国产免费久久久久久下载| 久久婷婷国产麻豆91天堂| 97热久久免费频精品99| 久久精品国产男包| 亚洲国产成人精品91久久久 | 亚洲国产视频久久| 久久99热这里只有精品国产| 久久久久亚洲AV无码专区体验| 国内精品伊人久久久影院| 亚洲欧洲精品成人久久曰影片| 国产一区二区三精品久久久无广告 | 亚洲综合伊人久久综合| 国产99久久久国产精品小说| 手机看片久久高清国产日韩| 久久久久亚洲精品天堂久久久久久 | 久久ZYZ资源站无码中文动漫 | 久久久久一级精品亚洲国产成人综合AV区 |