浪在ACM集训队寒假集训第一场

 


A#
 

题目链接:
 

B#
 

题目链接:

 

C - Function Height CodeForces - 1036A
You are given a set of 2n+12n+1 integer points on a Cartesian plane. Points are numbered from 00 to 2n2n inclusive. Let PiPi be the ii-th point. The xx-coordinate of the point PiPi equals ii. The yy-coordinate of the point PiPi equals zero (initially). Thus, initially Pi=(i,0)Pi=(i,0).
 

The given points are vertices of a plot of a piecewise function. The jj-th piece of the function is the segment PjPj+1PjPj+1.
 

In one move you can increase the yy-coordinate of any point with odd xx-coordinate (i.e. such points are P1,P3,…,P2n−1P1,P3,…,P2n−1) by 11. Note that the corresponding segments also change.
 

For example, the following plot shows a function for n=3n=3 (i.e. number of points is 2⋅3+1=72⋅3+1=7) in which we increased the yy-coordinate of the point P1P1 three times and yy-coordinate of the point P5P5 one time:
 


Let the area of the plot be the area below this plot and above the coordinate axis OX. For example, the area of the plot on the picture above is 4 (the light blue area on the picture above is the area of the plot drawn on it).
 

Let the height of the plot be the maximum yy-coordinate among all initial points in the plot (i.e. points P0,P1,…,P2nP0,P1,…,P2n). The height of the plot on the picture above is 3.
 

Your problem is to say which minimum possible height can have the plot consisting of 2n+12n+1 vertices and having an area equal to kk. Note that it is unnecessary to minimize the number of moves.
 

It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding 10181018.
 

Input
The first line of the input contains two integers nn and kk (1≤n,k≤10181≤n,k≤1018) — the number of vertices in a plot of a piecewise function and the area we need to obtain.
 

Output
Print one integer — the minimum possible height of a plot consisting of 2n+12n+1 vertices and with an area equals kk. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding 10181018.
 

Examples
Input
4 3
Output
1
Input
4 12
Output
3
Input
999999999999999999 999999999999999986
Output
1
Note
One of the possible answers to the first example:

 

The area of this plot is 3, the height of this plot is 1.
 

There is only one possible answer to the second example:

The area of this plot is 12, the height of this plot is 3.
 

题目大意:输入两个整数n,k(1≤n,k≤1018),然后在坐标轴上从0到2n个点上找出若干个面积为k的三角形,在所有三角形高尽量低的情况下最高的高,显然当n>=k的时候,一个三角形 所以输出1
当n<=k的时候,求k/n
1>能整除的话 输出k/n
2>不能整除的话 输出k/n+1
 


/*
* @Date: 2018-12-24 16:44:23
* @URL:
* @LastEditors: YiJieShuSheng
* @LastEditTime: 2019-01-17 16:17:20
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,k;
cin>>n>>k;
if(n>=k)cout<<1<<"\n";
else{
if(k%n==0)cout<<k/n<<"\n";
else cout<<k/n+1<<"\n";
}
return 0;
}


 

D#
 

题目链接:
 

E#
 

题目链接:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gy-7

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值