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 ...
随机推荐
- Codeforces 237C
题目: Description You've decided to carry out a survey in the theory of prime numbers. Let us remind y ...
- csuoj1009
AC代码: #include <iostream>#include <iomanip>using namespace std;//计算数学期望值,可以自己直接通过数组的方式来实 ...
- Java中判断字符串中相同字符的个数
public static int countStr(String str1, String str2) { int counter=0; if (str1.indexOf(str2) == -1) ...
- 远程连接(ssh安装)
更新源列表打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码"--& ...
- Nmap的使用【转载】
1.NMap工具 主要功能:探测主机是否在线.扫描主机开放端口和嗅探网络服务,用于网络探测和安全扫描. NMap支持很多扫描技术,例如:UDP.TCPconnect().TCPSYN(半开扫描).ft ...
- Boost的VS开发环境搭建
1. 下载并解压Boost C++ Libs 下载地址: SourceForge:http://sourceforge.net/projects/boost/files/boost/1.48.0/ B ...
- Android:SQLite无法update/insert/delete数据(数据库被locked)
//在频繁范围数据库进行读写操作后,会发生增删改数据都无效的问题,查询一般正常. mDatabase.beginTransaction(); try { Log.v(TAG,"locked: ...
- STM32F407的硬件I2C
源:STM32F407的硬件I2C 我使用的是STM32的固件库. 硬件模块使用之前必须配置其参数,I2C的配置如下: void IIC_Config(void) { GPIO_InitTypeDef ...
- 自定义switch开关
自定义一个switch开关 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- tiny210V2 Uboot kernel filesystem 烧写和启动
1.sd启动 将u-boot镜像写入SD卡 将SD卡通过读卡器接上电脑(或直接插入笔记本卡槽),通过"cat /proc/partitions"找出SD卡对应的设备,我的设备节点是 ...