CodeForces 670B Game of Robots
简单题。
#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的更多相关文章
- Codeforces Round #350 (Div. 2)解题报告
codeforces 670A. Holidays 题目链接: http://codeforces.com/contest/670/problem/A 题意: A. Holidays On the p ...
- 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 ...
- 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 ...
- Codeforces Beta Round #8 B. Obsession with Robots 暴力
B. Obsession with Robots 题目连接: http://www.codeforces.com/contest/8/problem/B Description The whole w ...
- Codeforces Round #335 (Div. 2)B. Testing Robots解题报告
B. Testin ...
- Codeforces 1045G AI robots [CDQ分治]
洛谷 Codeforces 简单的CDQ分治题. 由于对话要求互相看见,无法简单地用树套树切掉,考虑CDQ分治. 按视野从大到小排序,这样只要右边能看见左边就可以保证互相看见. 发现\(K\)固定,那 ...
- Codeforces Round #495 (Div. 2) C. Sonya and Robots
http://codeforces.com/contest/1004/problem/C 题意: 在一行上有n个数字,现在在最左边和最右边各放置一个机器人,左右机器人各有一个数字p和q.现在这两个机器 ...
- Sonya and Robots(CodeForces 1004C)
Since Sonya is interested in robotics too, she decided to construct robots that will read and recogn ...
- 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 ...
随机推荐
- Memcached安装配置最大使用内存
Memcached安装配置最大使用内存 项目做了很多,虽然用memcached的项目也有很多.但是没有太关注安装memcached细节问题 最近做了一个项目,把很多东西都放到memcached缓存中, ...
- 【IOS开发】搜索和排序(好友列表,通讯录的实现,searchbar)
一.效果图: 二.概述 实现一个好友列表,可以分为男女两个选项,并且实现搜索和排序功能.我的数据是放在plist文件中. 三.代码简述 代码结构如图,首先自定义一个Cell. cell.h #impo ...
- ioc和aop
IOC容器的基本原理 ioc又称为控制反转.或者依赖注入.为什么叫控制反转呢? 可以这样来看.软件开发中会有很多的类,这些类在一起完成复杂的功能.这些类之间存在了耦合的关系.就如同很多的齿轮,啮合 ...
- [转]Installing Snow Leopard (Client) on VMware Fusion 6.0.3
Source: http://inficererk.wordpress.com/2014/05/29/installing-snow-leopard-client-on-vmware-fusion-6 ...
- [转]Whirlwind Tour of ARM Assembly
ref:http://www.coranac.com/tonc/text/asm.htm 23.1. Introduction Very broadly speaking, you can divid ...
- “git push”后返回“Error 403”解决方法
问题描述: 1,mac ox系统,terminal上运行命令git push出现403错误: 2,代码是在别人的github(暂且叫origin branch吧)上克隆的,修改和添加了部分代码后欲提交 ...
- WINCE 电池状态(C#)
WINCE 电池状态(C#) 分类: 电量 2013-04-18 12:08 397人阅读 评论(1) 收藏 举报 ...
- oracle中backup模式
在数据库打开的情况下备份(归档模式),把表空间或者数据库置于backup 模式下, 如: SQL> alter database begin backup; Database altered ...
- C#代码搜索器
WEBUS2.0 In Action - [源代码] - C#代码搜索器 最近由于工作的需要, 要分析大量C#代码, 在数万个cs文件中搜索特定关键词. 这是一项非常耗时的工作, 用Notepad++ ...
- ajax简单后台交互
ajax简单后台交互 1,扯淡 单身的生活,大部分时间享受自由,小部分时间忍受寂寞. 生活有时候,其实蛮苦涩,让人难以下咽.那些用岁月积累起来的苦闷,无处宣泄,在自己的脑海里蔓延成一片片荆棘,让你每每 ...