【杭电】[4883]TIANKENG’s restaurant
来源:互联网 发布:js获取当前页面url 编辑:程序博客网 时间:2024/05/01 02:23
首先想到的是开门人关门人那个贪心
然后仔细想想并不完全一样
也是想明白了之前那道NYOJ省赛题为什么错
这里用模拟来做就好了
#include<stdio.h>int main() { int T; scanf("%d",&T); while(T--) { int n; scanf("%d",&n); int cnt[1500]; for(int i=0; i<1500; i++) cnt[i]=0; int x; int sh,sm; int eh,em; for(int i=0; i<n; i++) { scanf("%d %d:%d %d:%d",&x,&sh,&sm,&eh,&em); sh=sh*60+sm; eh=eh*60+em; for(int j=sh; j<eh; j++) { cnt[j]+=x; } } int max=0; for(int i=0; i<1500; i++) if(cnt[i]>max) max=cnt[i]; printf("%d\n",max); } return 0;}//与不AC贪心并不完全相同
题目地址:【杭电】[4883]TIANKENG’s restaurant
0 0
- HDU杭电4883 TIANKENG’s restaurant
- 杭电4883TIANKENG’s restaurant
- 【杭电】[4883]TIANKENG’s restaurant
- 【杭电4883】TIANKENG’s restaurant
- 杭电-4883 TIANKENG’s restaurant
- 【杭电4883】TIANKENG’s restaurant
- 【杭电 4883】TIANKENG’s restaurant
- 杭电4883-TIANKENG’s restaurant(区间覆盖)
- 【杭电oj】4883 - TIANKENG’s restaurant(区间覆盖)
- 4883 TIANKENG’s restaurant
- 杭电4883 TIANKENG’s restaurant(小板凳的问题)
- HDOJ 4883 TIANKENG’s restaurant
- HDU 4883 TIANKENG’s restaurant
- hdu 4883 TIANKENG’s restaurant
- HDU 4883 TIANKENG’s restaurant
- hdu 4883 TIANKENG’s restaurant
- hdu 4883 TIANKENG’s restaurant
- hdoj 4883 TIANKENG’s restaurant
- 绕过CDN查找真实服务器IP方法总结
- JAVA面向对象程序设计中多态特性的概述
- 什么是P问题、NP问题和NPC问题
- oracle 表名是变量,查询结果集为空转为0
- 215. Kth Largest Element in an Array
- 【杭电】[4883]TIANKENG’s restaurant
- codeforce 185 A——Plant
- 二叉树的前序,中序,后序遍历
- [LeetCode 253] Meeting Rooms II
- java.io.InvalidClassException: javax.management.MBeanAttributeInfo; local class incompatible:
- 字符个数统计
- HDOJ 5640 King's Cake
- FreeBSD虚拟机——小折腾
- 找工作——jvm复习(三)