Codeforces Round #274 (Div. 2)-C. Exams】的更多相关文章

A. Exams Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/A Description Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera…
http://codeforces.com/contest/479/problem/C C. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Student Valera is an undergraduate student at the University. His end of term exams are…
题意:给\(n\)场考试的时间,每场考试可以提前考,但是记录的是原来的考试时间,问你如何安排考试,使得考试的记录时间递增,并且最后一场考试的时间最早. 题解:因为要满足记录的考试时间递增,所以我们用结构体记录两个时间,并按第一个时间排序,然后遍历考试时间,\(ans\)记录上次考试的时间,我们每次将两个时间和\(ans\)比一下,如果提前考试的时间比\(ans\)小,说明我们一定不能提前考试(因为时间已经晚了),否则就提前考掉. 代码: struct misaka{ int a,b; bool…
Codeforces Round #377 (Div. 2) D. Exams    题意:给你n个考试科目编号1~n以及他们所需要的复习时间ai;(复习时间不一定要连续的,可以分开,只要复习够ai天就行了)   然后再给你m天,每天有一个值di; 其中,di==0代表这一天没有考试(所以是只能拿来复习的); 若di不为0,则di的值就代表第i天可以考编号为di的科目 ;(当然这一天也可以不考而拿来复习) .  问你最少能在第几天考完所有科目,无解则输出-1. 题解:首先,先想想最暴力的方法:从…
题目地址:http://codeforces.com/contest/479 这次自己又仅仅能做出4道题来. A题:Expression 水题. 枚举六种情况求最大值就可以. 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include &…
D. Exams Problem Description: Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m. About every day we know exam for which one of m subjects can be passed on that day. Perhap…
D. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m. Ab…
A http://codeforces.com/contest/479/problem/A 枚举情况 #include<cstdio> #include<algorithm> using namespace std; int main(){ int a,b,c; while(~scanf("%d%d%d",&a,&b,&c)){ ; ans=max(ans,a+b+c); ans=max(ans,a*b*c); ans=max(ans,a…
C. Riding in a Lift Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/C Description Imagine that you are in a building that has exactly n floors. You can move between the floors in a lift. Let's number the floors f…
B. Long Jumps Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/B Description Valery is a PE teacher at a school in Berland. Soon the students are going to take a test in long jumps, and Valery has lost his favorit…