CF #351 A. Bear and Game(简单题)
来源:互联网 发布:20世纪太阳黑子数据 编辑:程序博客网 时间:2024/05/16 01:24
题目链接
题意:给出时长是90分钟的电影,每一分钟可能是有趣的或者无趣的,现在升序给出,有趣的时间点,一旦连续的无趣时间达到15分钟,就会结束观看,问最多的观看时间。 直接模拟
#include<bits/stdc++.h>using namespace std;#define LL long long#define cl(a,b) memset(a,b,sizeof(a))#define pb push_back#define gcd __gcdconst int maxn = 100010;const LL inf =1LL<<50;const LL mod1 = 1000000007;int main(){ int n;scanf("%d",&n); int sum=0,last=0; for(int i=0;i<n;i++){ int x;scanf("%d",&x); if(x-last<=15){ sum=x;last=x; } } printf("%d\n",min(sum+15,90)); return 0;}
0 0
- CF #351 A. Bear and Game(简单题)
- CF Bear and Game
- 【codeforces】-#351A--Bear and Game(第一次cf,错到哭,还是有点开心的,嘿嘿)
- A. Bear and Game
- 【Codeforces Round】351A - Bear and Game(水)
- codeforcs 351 A. Bear and Game
- CF 573A(Bear and Poker-GCD)
- CF 685A Bear and Reverse Radewoosh
- 【Codeforces Round #351 Div. 2】 673A Bear and Game
- A. Vasya and Petya's Game(cf第一题)
- CodeForces - 673A Bear and Game (模拟)水
- CodeForces 673A Bear and Game
- CodeForces 673 A Bear and Game
- CodeForces 673A Bear and Game
- 【CodeForces】[673A]Bear and Game
- CodeForces 673 A Bear and Game
- CodeForces 673A Bear and Game
- CF#195(div2) A:Vasily the Bear and Triangle
- 7.29数据库函数
- 在CentOS中安装思维导图软件XMind
- php 正则中的"i,m,s,x,e"分别表示什么
- Eclipse中导入外部jar包
- Fragment中实现ActionBar的方法
- CF #351 A. Bear and Game(简单题)
- phpexcel打印设置
- Android Fragment 生命周期onCreatView、onViewCreated
- nginx运行过程中删除log文件无效
- 安卓:如何在其他类里调用activity的方法
- Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
- 集成支付宝钱包支付iOS SDK的方法与经验
- 5.Spark Streaming流计算框架的运行流程源码分析
- Git 的 .gitignore 配置