[codevs2640] Pages printed

Source: Internet
Author: User

Greedy, don't know how to think about the master difficulty

Some details need to be dealt with: first, note that one line may have multiple annotations, and the original value is paid as 1 with the INC record.

Another array to save more than K (=0= just feel more convenient, anyway, weak data), for each page (anyway not more than N, who said you must have a solution, is human nature, hum), with the pointer D record printed to the first page

Finally from 1 to N sweep again, you can put it, can't put on the next page

Code

varf,t:Array[0.. the] ofLongint;        D,r,k,n,all,x,y,i,j:longint; beginreadln (n,k);                READLN (All);  fori:=1  toN Dot[i]:=1;  fori:=1  toN Dof[i]:=K; D:=1;  fori:=1  toAll Do                beginreadln (x, y); T[X]:=t[x]+y; End;  fori:=1  toN Do                begin                        ifF[d]>=t[i] ThenDec (f[d],t[i])Else beginInc (d); Dec (F[d],t[i]);End; End;         Writeln (d); End.

Like on the collection, Vic private qq:1064864324, add me to discuss issues together, and progress

[codevs2640] Pages printed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.