简单题。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
char c=getchar(); x=;
while(!isdigit(c)) c=getchar();
while(isdigit(c)) {x=x*+c-''; c=getchar();}
} int n,k;
int a[]; int main()
{
scanf("%d%d",&n,&k);
for(int i=;i<=n;i++) scanf("%d",&a[i]);
int L=,R=n,pos;
while(L<=R)
{
int mid=(L+R)/;
LL num=(LL)(+mid)*(LL)mid/(LL);
if(num>=(LL)k) R=mid-,pos=mid;
else L=mid+;
} k=k-(+pos-)*(pos-)/;
printf("%d\n",a[k]); return ;
}

CodeForces 670B Game of Robots的更多相关文章

  1. Codeforces Round #350 (Div. 2)解题报告

    codeforces 670A. Holidays 题目链接: http://codeforces.com/contest/670/problem/A 题意: A. Holidays On the p ...

  2. Codeforces Round #335 (Div. 2) B. Testing Robots 水题

    B. Testing Robots Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606 ...

  3. Codeforces Round #350 (Div. 2) B. Game of Robots 水题

    B. Game of Robots 题目连接: http://www.codeforces.com/contest/670/problem/B Description In late autumn e ...

  4. Codeforces Beta Round #8 B. Obsession with Robots 暴力

    B. Obsession with Robots 题目连接: http://www.codeforces.com/contest/8/problem/B Description The whole w ...

  5. Codeforces Round #335 (Div. 2)B. Testing Robots解题报告

                                                                                               B. Testin ...

  6. Codeforces 1045G AI robots [CDQ分治]

    洛谷 Codeforces 简单的CDQ分治题. 由于对话要求互相看见,无法简单地用树套树切掉,考虑CDQ分治. 按视野从大到小排序,这样只要右边能看见左边就可以保证互相看见. 发现\(K\)固定,那 ...

  7. Codeforces Round #495 (Div. 2) C. Sonya and Robots

    http://codeforces.com/contest/1004/problem/C 题意: 在一行上有n个数字,现在在最左边和最右边各放置一个机器人,左右机器人各有一个数字p和q.现在这两个机器 ...

  8. Sonya and Robots(CodeForces 1004C)

    Since Sonya is interested in robotics too, she decided to construct robots that will read and recogn ...

  9. codeforces ~ 1004 C Sonya and Robots (dp)

    C. Sonya and Robots time limit per test 1 second memory limit per test 256 megabytes input standard ...

随机推荐

  1. 使用TotoriseSVN的分支/标签功能

    使用TotoriseSVN的分支/标签功能 http://blog.sina.com.cn/s/blog_5383588c0100o1oo.html 原来在新建一个项目文件夹后,再把Trunk.Bra ...

  2. git命令与github使用

    GitHub 是一个类似 SourceForge 的免费项目管理及分享的服务平台,要想使用 github,用户可以免费注册成为 github 注册用户,之后使用git命令进行操作使用.github 的 ...

  3. 读写ini文件

    C# 使用文件流来读写ini文件 背景 之前采用ini文件作为程序的配置文件,觉得这种结构简单明了,配置起来也挺方便.然后操作方式是通过WindowsAPI,然后再网上找到一个基于WindowsAPI ...

  4. 圆形头像以及一些常见需求形状自定义ImageView组件

    在实际开发中,我们经常会遇到这样的需求,就是无论图片长啥样,我们都要其显示成圆形.圆形加一个边框.矩形加边框,带圆角的矩形等等,lib和demo下载地址:https://github.com/mapl ...

  5. Slide-out Sidebar Menu

    IOS学习之路十(仿人人滑动菜单Slide-out Sidebar Menu) 2013-09-03 22:13 by lixingle, 270 阅读, 0 评论, 收藏, 编辑 最近滑动菜单比较流 ...

  6. easyui datagrid自定义操作列

    通过formatter方法给Jquery easyui 的datagrid 每行增加操作链接 我们都知道Jquery的EasyUI的datagrid可以添加并且自定义Toolbar, 这样我们选择一行 ...

  7. <c:if>判断两个<c:forEach>里的数据是否相等

    问题:两个<c:forEach>嵌套,里面循环的值和外面的值进行比较(里层里的PARENTID是否等于外层的ID),如果相等就显示. <c:forEach items="$ ...

  8. 什么是Numpy的ndarray

    什么是Numpy的ndarray 首先,Numpy的核心是ndarray. 然后,ndarray本质是数组,其不同于一般的数组,或者Python 的list的地方在于它可以有N 维(dimention ...

  9. CXF.bat

    @echo off rem ------------------------------------------------------------------- rem CXF Environmen ...

  10. EZOJ 网同14(蛋蛋与北大信科-Splay的颜色分离,寻找结点所在子树)

    蛋蛋与北大信科 总时限 10s 内存限制 256MB 出题人 lydrainbowcat 提交情况 1/25 背景 琰琰(孩纸们读作:蛋蛋)是妙峰书苑的一名萌萌哒教师,她的夫君(孩纸们称之为:北大信科 ...