codeforces 665A Buses Between Cities
简单题
- #include<cstdio>
- #include<cstring>
- #include<cmath>
- #include<vector>
- #include<map>
- #include<stack>
- #include<queue>
- #include<string>
- #include<algorithm>
- using namespace std;
- int a,ta,b,tb;
- int hh,mm;
- int f(int st,int en,int ss,int ee)
- {
- if(ee<=st) return ;
- if(en<=ss) return ;
- return ;
- }
- int main()
- {
- scanf("%d%d",&a,&ta);
- scanf("%d%d",&b,&tb);
- scanf("%d:%d",&hh,&mm);
- int st=hh*+mm;
- int en=hh*+mm+ta;
- int t=;
- int ans=;
- while()
- {
- int ss=*+t*b;
- int ee=ss+tb;
- if(ss>=*) break;
- if(f(st,en,ss,ee)==) ans++;
- t++;
- }
- printf("%d\n",ans);
- return ;
- }
codeforces 665A Buses Between Cities的更多相关文章
- Codeforces 665A. Buses Between Cities 模拟
A. Buses Between Cities time limit per test: 1 second memory limit per test: 256 megabytes input: s ...
- codeforces 665A A. Buses Between Cities(水题)
题目链接: A. Buses Between Cities time limit per test 1 second memory limit per test 256 megabytes input ...
- Educational Codeforces Round 12 A. Buses Between Cities 水题
A. Buses Between Cities 题目连接: http://www.codeforces.com/contest/665/problem/A Description Buses run ...
- Codeforces C. Jzzhu and Cities(dijkstra最短路)
题目描述: Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- Educational Codeforces Round 12 A. Buses Between Cities
题意: 从A到B的汽车每隔 a 分钟发车一次,从A到B要ta分钟. 从B到A汽车每隔b分钟发车一次,从B到A要ta分钟. Simion从A出发,问他在A->B的途中共遇到了多少辆车. 汽车都是从 ...
- Codeforces 1101F Trucks and Cities dp (看题解)
Trucks and Cities 一个很显然的做法就是二分然后对于每个车贪心取check, 这肯定会TLE, 感觉会给人一种贪心去写的误导... 感觉有这个误导之后很难往dp那个方向靠.. dp[ ...
- [Codeforces 449B] Jzzhu and Cities
[题目链接] https://codeforces.com/contest/449/problem/B [算法] 最短路 时间复杂度 : O(N ^ 2) [代码] #include<bits/ ...
- codeforces 449B Jzzhu and Cities (Dij+堆优化)
输入一个无向图<V,E> V<=1e5, E<=3e5 现在另外给k条边(u=1,v=s[k],w=y[k]) 问在不影响从结点1出发到所有结点的最短路的前提下,最多可以 ...
- Codeforces 450D Jzzhu and Cities [heap优化dij]
#include<bits/stdc++.h> #define MAXN 100050 #define MAXM 900000 using namespace std; struct st ...
随机推荐
- php mysql数据库 分页与搜索
<?php/** * Created by coder meng. * User: coder meng * Date: 2016/8/29 10:27 */header("Conte ...
- MySQL安装--ubuntu
1. 执行命令: $ apt-get install mysql-server 执行上述命令会自动安装mysql-client,mysql-common等包. 2. 安装过程中会让你给root账号设置 ...
- tsung: an open-source multi-protocol distributed load testing tool
ROPERTIES::type: KnowledgeBase_Cloud:END: 开源.多协议.分布式的压力测试工具 Item Summary tsung-recorder start 通过p ...
- Go-file
两个包具有文件操作的相关方法,一个是os,一个是syscall,其中os中的相关方法是对syscall相关方法的封装,推荐使用os中的相关方法.文件的打开文件的第一步操作实际上是创建,但是由于文件的打 ...
- crontab如何设置秒级别的定时【转载】
* * * * * date > /home/gamester88/test/nihao.txt * * * * * (sleep 10 && date >> /ho ...
- NET:交换机的背板带宽,交换容量,包转发率区别
交换机的背板带宽,交换容量,包转发率区别 背板带宽指的是背板整个的交换容量,交换容量指cpu的交换容量,包转发指的是三层转发的容量 一.背板带宽 1.交换机背板带宽含义 交换机的背板带宽也叫背板容量, ...
- java 数组变量与数组对象
数组是否必须初始化 对于这个问题,关键在于要弄清楚数组变量和数组对象的差别.数组变量是存放在栈内存中的,数组对象是存放在堆内存中的.数组变量只是一个引用变量,他能够指向实际的数组对象. 所谓的数组初始 ...
- 深入理解javascript执行上下文(Execution Context)
本文转自:http://blogread.cn/it/article/6178 在这篇文章中,将比较深入地阐述下执行上下文 - Javascript中最基础也是最重要的一个概念.相信读完这篇文章后,你 ...
- UIScreen的scale属性
用来表示显示屏的像素密度与点坐标系统之间的关系.通过该属性,我们可以把视图中逻辑坐标系统里的点坐标转换成设备的物理像素坐标.在配有Retina显示屏的设备中,scale值是2.0,而在非Retina显 ...
- C语言根据函数名调用对应的函数
通过函数指针定义,调用时加上参数 struct Command { const char *name; const char *desc; // return -1 to force monitor ...