Codeforces Beta Round #4 (Div. 2 Only) B. Before an Exam_html/css_WEB-ITnose

WBOY
풀어 주다: 2016-06-24 11:53:11
원래의
1187명이 탐색했습니다.

继续刷水题,不能再错了!!


题目大意:

要求在n天内学习t小时,给出每一天可以学习的最小时间和最大时间。问能不能实现,若可以输出时间表。



解题思路:

水题一个,保证在区间范围内的情况下直接贪心。



下面是代码:

#include <set>#include <map>#include <queue>#include <math.h>#include <vector>#include <string>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <cctype>#include <algorithm>#define eps 1e-10#define pi acos(-1.0)#define inf 107374182#define inf64 1152921504606846976#define lc l,m,tr 0 ? (x) : -(x))#define clear1(A, X, SIZE) memset(A, X, sizeof(A[0]) * (min(SIZE,sizeof(A))))#define clearall(A, X) memset(A, X, sizeof(A))#define memcopy1(A , X, SIZE) memcpy(A , X ,sizeof(X[0])*(SIZE))#define memcopyall(A, X) memcpy(A , X ,sizeof(X))#define max( x, y )  ( ((x) > (y)) ? (x) : (y) )#define min( x, y )  ( ((x) t)    {        puts("NO");    }    else    {        puts("YES");        t-=downlim;        for(int i=0;i<d if>=da[i].max1-da[i].min1)            {                printf("%d ",da[i].max1);                t-=da[i].max1-da[i].min1;            }            else if(t==0)            {                printf("%d ",da[i].min1);            }            else if(t<da printf t="0;" return>  <br>  <br>  <p></p> </da></d></algorithm></cctype></iostream></stdlib.h></string.h></stdio.h></string></vector></math.h></queue></map></set>
로그인 후 복사
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!