A. Vova and Train ( Codeforces Round #515 (Div. 3) )
题意:一条 L 长的路,一列车长在这条路的 l 到 r 之间,只有在 v 倍数时有灯,但是在 l 到 r 之间的灯是看不见的,问最大看见的灯的个数?
题解:L / v 表示总共的灯的个数, r / v 、( l - 1 ) / v 表示前 r 、( l - 1 ) 长的路有多少灯,减一下就可以了。
( 难题补不上了,QAQ,写个水题,放松一下)
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t,L,v,l,r,sum,num;
while(~scanf("%d",&t))
{
while(t--)
{
scanf("%d%d%d%d",&L,&v,&l,&r);
sum = 0;
num = 0;
sum = L / v;
num = r / v - (l - 1) / v;
printf("%d\n",sum - num);
}
}
return 0;
}
A. Vova and Train ( Codeforces Round #515 (Div. 3) )的更多相关文章
- Codeforces Round #515 (Div. 3)
Codeforces Round #515 (Div. 3) #include<bits/stdc++.h> #include<iostream> #include<cs ...
- Codeforces Round #515 (Div. 3) 解题报告(A~E)
题目链接:http://codeforces.com/contest/1066 1066 A. Vova and Train 题意:Vova想坐火车从1点到L点,在路上v的整数倍的点上分布着灯笼,而在 ...
- CodeForces Round #515 Div.3 A. Vova and Train
http://codeforces.com/contest/1066/problem/A Vova plans to go to the conference by train. Initially, ...
- Codeforces Round #515 (Div. 3) B. Heaters【 贪心 区间合并细节 】
任意门:http://codeforces.com/contest/1066/problem/B B. Heaters time limit per test 1 second memory limi ...
- CodeForces Round #515 Div.3 B. Heaters
http://codeforces.com/contest/1066/problem/B Vova's house is an array consisting of nn elements (yea ...
- Codeforces Round #515 (Div. 3) E. Binary Numbers AND Sum
E. Binary Numbers AND Sum 题目链接:https://codeforces.com/contest/1066/problem/E 题意: 给出两个用二进制表示的数,然后将第二个 ...
- CodeForces Round #515 Div.3 D. Boxes Packing
http://codeforces.com/contest/1066/problem/D Maksim has nn objects and mm boxes, each box has size e ...
- CodeForces Round #515 Div.3 C. Books Queries
http://codeforces.com/contest/1066/problem/C You have got a shelf and want to put some books on it. ...
- CodeForces Round #515 DIv.3 F. Yet another 2D Walking
http://codeforces.com/contest/1066/problem/F Maksim walks on a Cartesian plane. Initially, he stands ...
随机推荐
- springboot-实现log4j的AOP切面
参考链接: https://www.cnblogs.com/liaojie970/p/7883687.html https://blog.csdn.net/autfish/article/detail ...
- ajax 传递数组参数
一.ajax 传递数组参数 需要添加: traditional: true, let typeIDArr = [,,,,,]; var that = this; var url = '@Url.Act ...
- mysql 设置查看字符集
MySQL查看和修改字符集的方法 一.查看字符集 1.查看MYSQL数据库服务器和数据库字符集 方法一:show variables like '%character%';方法二:show var ...
- Java开发环境之MySql
查看更多Java开发环境配置,请点击<Java开发环境配置大全> 叁章:MySql安装教程 1)去官网下载MySql安装包 https://www.mysql.com/downloads/ ...
- Ubuntu 开发环境搭建
一.修改权限 Ubuntu 用户权限相关命令 - 彭浪 - 博客园 Ubuntu 文件文件夹查看权限和设置权限 - 朝阳的向日葵 - 博客园 二.安装简体中文支持 三.安装搜狗输入法 四.安装Goog ...
- Linux 用户账号与权限管理
在Linux中,如何管理用户.管理权限?请看下文,谢谢配合. 用户.组概述 用户分类 超级用户:root,人为交互最高权限用户,system为最高权限用户. 普通用户:通过管理管理员创建,权限受到一定 ...
- Shell: sh,bash,csh,tcsh等shell的区别(转)
转载自:http://zhidao.baidu.com/question/493376840.html, http://blog.sina.com.cn/s/blog_71261a2d0100wmbj ...
- docker管理监控方案
docker相关管理可分为四类:docker基础功能.docker监控.docker集群管理和docker系统认证管理.docker管理的基础或信息来源都是docker命令行或docker API. ...
- MySQL/MariaDB数据库的视图(VIEW)
MySQL/MariaDB数据库的视图(VIEW) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.视图概述 1>.什么是视图 视图就是一个虚拟的表,保存有实表的查询结果 ...
- aspose将word转pdf时乱码,或者出现小方框问题
通常来讲,出现这种问题一般是因为Linux服务器没有安装中文字体 查看Linux目前的所有字体 fc-list #查看Linux目前的所有中文字体 fc-list :lang=zh #将window ...