【Codeforces Round #351 Div. 2】 673A Bear and Game

原创 2016年08月28日 21:30:35

Description
Bear Limak likes watching sports on TV. He is going to watch a game today. The game lasts 90 minutes and there are no breaks.
Each minute can be either interesting or boring. If 15 consecutive minutes are boring then Limak immediately turns TV off.
You know that there will be n interesting minutes t1, t2, …, tn. Your task is to calculate for how many minutes Limak will watch the game.


【题目分析】
只要读懂题意,没有人做不出来的题目。纯模拟的题目好啊,妙啊!


【代码】

#include <cstdio>
#include <iostream>
#include <string>
int n,a[1001];
int min(int a,int b){return a<b?a:b;}
int main()
{
    int n,x,last=0,ans=15;
    scanf("%d",&n);
    for (int i=1;i<=n;++i){
        scanf("%d",&x);
        if (last+15>=x) ans=x+15;
        else break;
        last=x;
    }
    printf("%d\n",min(ans,90));
    return 0;
}
版权声明:标注来源之后可随意引用[请记得添加友链]

Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) D. Bear and Two Paths

D. Bear and Two Paths time limit per test 2 seconds memory limit per test 256 megabytes ...

【codeforces】-#351A--Bear and Game(第一次cf,错到哭,还是有点开心的,嘿嘿)

A. Bear and Game time limit per test 2 seconds memory limit per test 256 megabytes input stand...

Codeforces Round #356 (Div. 2) D. Bear and Tower of Cubes

D. Bear and Tower of Cubes time limit per test 2 seconds memory limit per test 256 megabytes...

Codeforces Round #226 (Div. 2) C. Bear and Prime Numbers(暴力)

题目链接:点击打开链接 题意:给n个数, m次询问, 每次询问时一个区间[l, r]。 求这个区间中的所有素数,能被n个数中的几个数整除的累加和。 思路:没想到什么好办法, 直接筛出素数以后直接暴...

Codeforces Round #356 (Div. 2)-B. Bear and Finding Criminals(模拟)

B. Bear and Finding Criminals time limit per test 2 seconds memory limit per test 256 me...

Codeforces Round #226 (Div. 2) B. Bear and Strings

B. Bear and Strings time limit per test 1 second memory limit per test 256 megabytes input sta...

Codeforces Round #226 (Div. 2)A. Bear and Raspberry

A. Bear and Raspberry time limit per test 1 second memory limit per test 256 megabytes ...

Codeforces Round #318 (Div. 2) E - Bear and Drawing

题意:有一颗n个点的树,然后有两行列数无限的点,问这颗树能否画出。能画出输出Yes,否则输出No在纸上画一画可以知道,首先对于一个点,它衍生出来的最左边的那个点和最右边的那个点可以衍生出>2个点,这个...
  • CHCXCHC
  • CHCXCHC
  • 2015年09月09日 23:36
  • 241

Codeforces Round #226 (Div. 2) C. Bear and Prime Numbers

C. Bear and Prime Numbers time limit per test 2 seconds memory limit per test 512 megabytes in...

Codeforces Round #226 (Div. 2) C. Bear and Prime Numbers(素数筛法)

Recently, the bear started studying data structures and faced the following problem. You are given ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:【Codeforces Round #351 Div. 2】 673A Bear and Game
举报原因:
原因补充:

(最多只允许输入30个字)