简单题

  1. #include<cstdio>
  2. #include<cstring>
  3. #include<cmath>
  4. #include<vector>
  5. #include<map>
  6. #include<stack>
  7. #include<queue>
  8. #include<string>
  9. #include<algorithm>
  10. using namespace std;
  11.  
  12. int a,ta,b,tb;
  13. int hh,mm;
  14.  
  15. int f(int st,int en,int ss,int ee)
  16. {
  17. if(ee<=st) return ;
  18. if(en<=ss) return ;
  19. return ;
  20. }
  21.  
  22. int main()
  23. {
  24. scanf("%d%d",&a,&ta);
  25. scanf("%d%d",&b,&tb);
  26. scanf("%d:%d",&hh,&mm);
  27.  
  28. int st=hh*+mm;
  29. int en=hh*+mm+ta;
  30.  
  31. int t=;
  32. int ans=;
  33.  
  34. while()
  35. {
  36. int ss=*+t*b;
  37. int ee=ss+tb;
  38. if(ss>=*) break;
  39. if(f(st,en,ss,ee)==) ans++;
  40. t++;
  41. }
  42.  
  43. printf("%d\n",ans);
  44. return ;
  45. }

codeforces 665A Buses Between Cities的更多相关文章

  1. Codeforces 665A. Buses Between Cities 模拟

    A. Buses Between Cities time limit per test: 1 second memory  limit per test: 256 megabytes input: s ...

  2. codeforces 665A A. Buses Between Cities(水题)

    题目链接: A. Buses Between Cities time limit per test 1 second memory limit per test 256 megabytes input ...

  3. Educational Codeforces Round 12 A. Buses Between Cities 水题

    A. Buses Between Cities 题目连接: http://www.codeforces.com/contest/665/problem/A Description Buses run ...

  4. Codeforces C. Jzzhu and Cities(dijkstra最短路)

    题目描述: Jzzhu and Cities time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  5. Educational Codeforces Round 12 A. Buses Between Cities

    题意: 从A到B的汽车每隔 a 分钟发车一次,从A到B要ta分钟. 从B到A汽车每隔b分钟发车一次,从B到A要ta分钟. Simion从A出发,问他在A->B的途中共遇到了多少辆车. 汽车都是从 ...

  6. Codeforces 1101F Trucks and Cities dp (看题解)

    Trucks and Cities 一个很显然的做法就是二分然后对于每个车贪心取check, 这肯定会TLE, 感觉会给人一种贪心去写的误导... 感觉有这个误导之后很难往dp那个方向靠.. dp[ ...

  7. [Codeforces 449B] Jzzhu and Cities

    [题目链接] https://codeforces.com/contest/449/problem/B [算法] 最短路 时间复杂度 : O(N ^ 2) [代码] #include<bits/ ...

  8. codeforces 449B Jzzhu and Cities (Dij+堆优化)

    输入一个无向图<V,E>    V<=1e5, E<=3e5 现在另外给k条边(u=1,v=s[k],w=y[k]) 问在不影响从结点1出发到所有结点的最短路的前提下,最多可以 ...

  9. Codeforces 450D Jzzhu and Cities [heap优化dij]

    #include<bits/stdc++.h> #define MAXN 100050 #define MAXM 900000 using namespace std; struct st ...

随机推荐

  1. php mysql数据库 分页与搜索

    <?php/** * Created by coder meng. * User: coder meng * Date: 2016/8/29 10:27 */header("Conte ...

  2. MySQL安装--ubuntu

    1. 执行命令: $ apt-get install mysql-server 执行上述命令会自动安装mysql-client,mysql-common等包. 2. 安装过程中会让你给root账号设置 ...

  3. tsung: an open-source multi-protocol distributed load testing tool

     ROPERTIES::type: KnowledgeBase_Cloud:END: 开源.多协议.分布式的压力测试工具   Item Summary tsung-recorder start 通过p ...

  4. Go-file

    两个包具有文件操作的相关方法,一个是os,一个是syscall,其中os中的相关方法是对syscall相关方法的封装,推荐使用os中的相关方法.文件的打开文件的第一步操作实际上是创建,但是由于文件的打 ...

  5. crontab如何设置秒级别的定时【转载】

    * * * * * date > /home/gamester88/test/nihao.txt * * * * * (sleep 10 && date >> /ho ...

  6. NET:交换机的背板带宽,交换容量,包转发率区别

    交换机的背板带宽,交换容量,包转发率区别 背板带宽指的是背板整个的交换容量,交换容量指cpu的交换容量,包转发指的是三层转发的容量 一.背板带宽 1.交换机背板带宽含义 交换机的背板带宽也叫背板容量, ...

  7. java 数组变量与数组对象

    数组是否必须初始化 对于这个问题,关键在于要弄清楚数组变量和数组对象的差别.数组变量是存放在栈内存中的,数组对象是存放在堆内存中的.数组变量只是一个引用变量,他能够指向实际的数组对象. 所谓的数组初始 ...

  8. 深入理解javascript执行上下文(Execution Context)

    本文转自:http://blogread.cn/it/article/6178 在这篇文章中,将比较深入地阐述下执行上下文 - Javascript中最基础也是最重要的一个概念.相信读完这篇文章后,你 ...

  9. UIScreen的scale属性

    用来表示显示屏的像素密度与点坐标系统之间的关系.通过该属性,我们可以把视图中逻辑坐标系统里的点坐标转换成设备的物理像素坐标.在配有Retina显示屏的设备中,scale值是2.0,而在非Retina显 ...

  10. C语言根据函数名调用对应的函数

    通过函数指针定义,调用时加上参数 struct Command { const char *name; const char *desc; // return -1 to force monitor ...