[Codeforces673A]Bear and Game(水题,思路)
题目链接:http://codeforces.com/contest/673/problem/A
题意:一个人看一个90分钟的节目,然后告诉你一些有趣的时刻。这个人假如在15分钟内还没有看到有趣的时刻,那他就关电视。问这个人能看多长时间的电视。
记下两两节目的时间差,起始是0终止是90不要忘记。然后扫一遍就好,最后如果超出90要输出90。
/*
━━━━━┒ギリギリ♂ eye!
┓┏┓┏┓┃キリキリ♂ mind!
┛┗┛┗┛┃\○/
┓┏┓┏┓┃ /
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath>
using namespace std;
#define fr first
#define sc second
#define cl clear
#define BUG puts("here!!!")
#define W(a) while(a--)
#define pb(a) push_back(a)
#define Rlf(a) scanf("%llf", &a);
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define Cin(a) cin >> a
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Clr(a, x) memset((a), (x), sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a))
#define lrt rt << 1
#define rrt rt << 1 | 1
#define pi 3.14159265359
#define RT return
#define lowbit(x) x & (-x)
#define onenum(x) __builtin_popcount(x)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef map<string, int> msi;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<vl> vvl;
typedef vector<bool> vb; const int maxn = ;
int n;
int t[maxn];
int s[maxn]; int main() {
// FRead();
Cls(s);
Rint(n);
Rep(i, n) Rint(t[i]);
Rep(i, n) {
if(i == ) {
s[i] = t[i];
continue;
}
s[i] = t[i] - t[i-];
}
s[n] = - s[n-];
int ret = ;
Rep(i, n+) {
if(s[i] <= ) {
ret += s[i];
}
else {
ret += ;
break;
}
}
printf("%d\n", ret > ? : ret);
RT ;
}
[Codeforces673A]Bear and Game(水题,思路)的更多相关文章
- NYOJ-525一道水题思路及详解
一道水题 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 今天LZQ在玩一种小游戏,但是这游戏数有一点点的大,他一个人玩的累,想多拉一些人进来帮帮他,你能写一个程序帮帮他 ...
- codeforces 673A A. Bear and Game(水题)
题目链接: A. Bear and Game time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 1) B. Bear and Blocks 水题
B. Bear and Blocks Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/573/pr ...
- Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) A. Bear and Game 水题
A. Bear and Game 题目连接: http://www.codeforces.com/contest/673/problem/A Description Bear Limak likes ...
- 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 megabytes inpu ...
- Acdream 1111:LSS(水题,字符串处理)
LSS Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStati ...
- poj 1007:DNA Sorting(水题,字符串逆序数排序)
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 80832 Accepted: 32533 Des ...
- poj 1006:Biorhythms(水题,经典题,中国剩余定理)
Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 110991 Accepted: 34541 Des ...
- poj 1002:487-3279(水题,提高题 / hash)
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 236746 Accepted: 41288 Descr ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
随机推荐
- npm,grunt,less,sass,typescript
typescript http://www.typescriptlang.org sass http://sass-lang.com/ less http://lesscss.org/ bow ...
- matlab实现雅可比、高斯塞德尔、后项误差计算
稀疏矩阵生成: function [a, b] = aparsesetup(n) e = ones(n, 1); n2 = n / 2; a = spdiags([-e 3*e -e], -1:1, ...
- 【BZOJ 3504】[Cqoi2014]危桥
Description Alice和Bob居住在一个由N座岛屿组成的国家,岛屿被编号为0到N-1.某些岛屿之间有桥相连,桥上的道路是双 向的,但一次只能供一人通行.其中一些桥由于年久失修成为危桥,最多 ...
- mysql 的存储过程调试软件
免费下载链接:http://download.csdn.net/detail/meiyoudao/6371137 需要注册 调试还是 F10 类似的
- [转载+原创]Emgu CV on C# (七) —— Emgu CV on 轮廓检测
轮廓检测 对于查找轮廓我们一般要对图像Canny检测.但是对于很特殊的场合其实我们还可以直接对二值化的图像进行轮廓的提取. 关键函数 1. cvFindContours Retrieves conto ...
- JS中的className含义
问题描述: JS中的className含义 问题解决: className说明: className属性可以设置和返回元素的class属性 可以有两种方法来获取对象的c ...
- Entity Framework 基础
在忙碌中渡过了5,6,7 月份,现在些抽点时间对Entity Framework的使用做一些基础的回忆. Entity Framework 是什么? Entity Framework(EF)和我们所熟 ...
- bzoj 3907: 网格 组合数学
3907: 网格 Time Limit: 1 Sec Memory Limit: 256 MBSubmit: 13 Solved: 7[Submit][Status][Discuss] Descr ...
- 【Memcache】下载和安装
下载: Win7 64bit 系统 下载过过很多版本,都无法安装,最后到这里下载,成功安装: http://blog.couchbase.com/memcached-windows-64-bit-pr ...
- 【锋利的JQuery-学习笔记】菜单栏及其2级菜单
效果图: 鼠标移动到菜单项后如下: html: <div id="nav" class="mainNav"> <ul class=" ...