Vacations】的更多相关文章

题目链接:C. Vacations 题意:现在有n天的假期,对于第i天有四种情况: 0  gym没开,contest没开 1  gym没开,contest开了 2 gym开了,contest没开 3       gym开了,contest开了 所有题主每天可能就有三种选择,rest,do sport,do contest.题主拒绝连续两天做同样的事情.现在请你安排他的假期,使得题主休息的天数最少. 思路:tag:dp n=100的dp和暴力有什么区别... ... 第i天的三种选择得到的最少休息…
C. Vacations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about…
C. Vacations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about…
Vacations Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was carried out in the Internet on that day.…
题目描述 Vasya has nn days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this nn days: whether that gym opened and whether a contest was carried out in the Internet on that day. For…
题目链接:http://codeforces.com/problemset/problem/699/C C. Vacations time limit per test1 second memory limit per test256 megabytes Problem Description Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the fo…
Description Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was carried out in the Internet on that day…
f[i][0..2]表示第i天休息|运动|比赛最少的休息天数. #include <cstdio> #include <cstring> #include <algorithm> #define N 105 using namespace std; int n,a,f[N][3],ans; int main(){ memset(f,0x3f3f3f3f,sizeof f); f[0][0]=0; scanf("%d",&n); for(int…
题目链接 : http://codeforces.com/problemset/problem/698/A 题目大意: 阿Q有n天假期,假期中有三种安排 休息.健身.比赛.每天有三种选择条件: 0 健身房不开门 没有比赛 1 健身房不开门    有比赛 2 健身房开门     没有比赛  3 健身房开门   有比赛 请给阿Q 合理的安排他的假期[阿Q不能连着两天健身或者连着两天比赛],使得阿Q的休息天数最少. 解题思路: ans=n,最多休息ans天 第一天是3 则a[0]=0,ans--; 只…
题目链接: http://codeforces.com/problemset/problem/698/A http://codeforces.com/problemset/problem/699/C 题目大意: N天,A(健身)或B(做比赛)或休息,每天都有4种情况,A可行B可行,A可行B不行,A不行B可行,AB都不行. 每天选择一种,不能连续两天选择同一种活动(可以连续休息),问最少休息几天. 题目思路: [动态规划] f[i][j]表示前i天,最后一天状态为j的最多休息天数(最少天数也行),…