Codeforces Round #449 (Div. 1) A. Nephren gives a riddle 模拟.

使用nvm离线安装、管理node多版本以及配置环境变量(亲测) 阅读详情

A. Nephren gives a riddle
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
What are you doing at the end of the world? Are you busy? Will you save us?

Nephren is playing a game with little leprechauns.

She gives them an infinite array of strings, f0… ∞.

f0 is “What are you doing at the end of the world? Are you busy? Will you save us?”.

She wants to let more people know about it, so she defines fi =  “What are you doing while sending “fi - 1”? Are you busy? Will you send “fi - 1”?” for all i ≥ 1.

For example, f1 is

“What are you doing while sending “What are you doing at the end of the world? Are you busy? Will you save us?”? Are you busy? Will you send “What are you doing at the end of the world? Are you busy? Will you save us?”?”. Note that the quotes in the very beginning and in the very end are for clarity and are not a part of f1.

It can be seen that the characters in fi are letters, question marks, (possibly) quotation marks and spaces.

Nephren will ask the little leprechauns q times. Each time she will let them find the k-th character of fn. The characters are indexed starting from 1. If fn consists of less than k characters, output ‘.’ (without quotes).

Can you answer her queries?
Input

The first line contains one integer q (1 ≤ q ≤ 10) — the number of Nephren’s questions.

Each of the next q lines describes Nephren’s question and contains two integers n and k (0 ≤ n ≤ 105, 1 ≤ k ≤ 1018).
Output

One line containing q characters. The i-th character in it should be the answer for the i-th query.
Examples
Input

3
1 1
1 2
1 111111111111

Output

Wh.

Input

5
0 69
1 194
1 139
0 47
1 66

Output

abdef

Input

10
4 1825
3 75
3 530
4 1829
4 1651
3 187
4 584
4 255
4 774
2 474

Output

Areyoubusy

Note

For the first two examples, refer to f0 and f1 given in the legend.

看看别人怎么处理 “的..
1: 用\”
2:用l1,l2,l3方便改.直接分为s1,s2,s3

By eds467, contest: Codeforces Round #449 (Div. 1), problem: (A) Nephren gives a riddle, Accepted, #

#include<cstdio>
#include<cstring>
const char s0[]="What are you doing at the end of the world? Are you busy? Will you save us?",
    s1[]="What are you doing while sending \"",
    s2[]="\"? Are you busy? Will you send \"",
    s3[]="\"?";
int l1,l2,l3,lim;
long long len[100];
char calc(int n,long long k){
    if(!n)return s0[k];
    if(k<l1)return s1[k];
    k-=l1;
    if(n-1>lim||k<len[n-1])return calc(n-1,k);
    k-=len[n-1];
    if(k<l2)return s2[k];
    k-=l2;
    if(n-1>lim||k<len[n-1])return calc(n-1,k);
    k-=len[n-1];
    return s3[k];
}
int main(){
    len[0]=strlen(s0);
    l1=strlen(s1);
    l2=strlen(s2);
    l3=strlen(s3);
    while(len[lim]<1e18){
        lim++;len[lim]=l1+len[lim-1]+l2+len[lim-1]+l3;
    }
    int q;scanf("%d",&q);
    while(q--){
        int n;long long k;
        scanf("%d%lld",&n,&k);
        if(n<=lim&&k>len[n])putchar('.');
        else putchar(calc(n,k-1));
    }
    puts("");
}
数据清洗(Data Cleansing) 数据清洗(Data Cleansing)是指对数据进行处理和纠错,以去除或修复数据集中存在的错误、不致、不完整和冗余的数据,从而使数据更加准确、可靠和有用。数据清洗是数据处理和数据分析中一个非常重要的步骤,它可以帮助我们提高数据的质量,从而提高数据分析和机器学习的准确性和可靠性。数据清洗是一个重要的过程,它可以帮助我们提高数据的质量,从而提高数据分析和机器学习的准确性和可靠性。在实际应用中,我们可以使用一些工具和技术来实现数据清洗,例如 Pandas、NumPy 和 OpenRefine 等。通过数据清洗, 阅读详情

相关推荐

手把手教你用OpenCalib完成激光雷达与相机联合标定:从数据准备到结果可视化

本文详细介绍了使用OpenCalib工具链中的lidar2camera模块完成激光雷达与相机联合标定的全流程,包括数据准备、标定命令执行、结果验证与可视化。通过实战指南,帮助读者掌握工业级标定技术,提升自动驾驶和机器人领域的传感器融合精度。

weixin_30872499的博客 398

CodeForces - 878D 递归(搜索)

开始有k个生物,有n个属性 支持3种操作: 1.将两个生物合并成一个新的生物,所有属性值为原来的较大值 2.将两个生物合并成一个新的生物,所有属性值为原来的较小值 3.询问i生物的第j个属性值 n<=1e5 k<=12 q<=1e5 Input 三个数 n k q分别表示属性数,生物数以及操作数 之后k行每行n个正整数,表示生物属性(属于[1,1e9]) 之后q行,每行3个...

weixin_44705665的博客 382

企业网络改造必看:如何用华为S5700三层交换机解决多部门隔离通信?

本文详细介绍了如何利用华为S5700三层交换机解决企业多部门网络隔离与通信需求。通过划分VLAN实现逻辑隔离,并配置三层路由实现受控互通,结合ACL进行精细访问控制,构建安全高效的企业网络。文章提供了从拓扑规划、地址分配到核心配置的完整实战指南。

weixin_29260291的博客 260

B-Code For 1 Codeforces 768【递归】 好题!

题意:起初,序列中仅有数n,if(n!=0 && n!=1) 在原来的位置补充3个元素n/2 n/%2 n/2 。 直至该序列用仅有0和1。现在问区间[l,r]有多少个1思路:一开始想用vector模拟,感觉实现起来很麻烦,很繁琐。 去网上看了题解,首先要求出对于当前的n,一共能拆分成多少个元素(仅为0和1),那么区间长度就是[1,len]确定下来。接着去枚举每一个位置的值是0还是1(递归)。

Haipai1998的博客 628

基于Cesium的北斗卫星轨道实时可视化系统开发实践

本文详细介绍了基于Cesium的北斗卫星轨道实时可视化系统开发实践,涵盖系统架构设计、轨道计算实现、后端服务开发及前端可视化实现等关键环节。通过优化算法和数据流设计,系统实现了厘米级精度的卫星轨道实时渲染,适用于导航卫星系统的科研与工程应用。

j7k8l的博客 520

软件测试 | 手把手教你如何使用 Charles 抓包工具(电脑+手机端)

软件测试 | 手把手教你如何使用 Charles 抓包工具(电脑+手机端)一、Charles简介二、Charles下载与安装三、Charles配置(1)Charles-PC端的配置如下:(2)过滤网络请求:(3)Charles抓取HTTPS请求包前置条件:(4)Charles抓取HTTPS双向认证包:关注我,免费领取学习资料 嘿。大家好,我是4U: 做过 APP 测试的同学都会接触抓包工具,通过抓包工具可以获取到客户端与服务端接口的交互数据,在实际测试APP的过程中,我们往往会发现服务端返回 的参数字段错

leboxy的博客 4151

codeforces:A. Nephren gives a riddle【字符串套娃 + 递归or迭代 + 记忆化搜索预处理提速】

递归迭代套娃记忆化搜索预处理py递归爆栈,可以迭代。

小楼一夜听春雨 288

FPGA中参数化SPI接口设计与Verilog实现

SPI(串行外设接口)作为嵌入式系统的核心通信协议,通过全双工、高速率特性在FPGA与Flash、ADC等外设交互中占据重要地位。参数化设计通过抽象时钟极性、数据位宽等可配置维度,采用分层架构实现硬件复用,显著提升开发效率。Verilog实现需重点处理跨时钟域同步和可配置帧结构,结合AXI总线集成与UVM验证方法学,可构建适应工业控制、物联网网关等场景的高可靠SPI解决方案。

ciya3282的博客 1406

Codeforces Round #313 D. Equivalent Strings(DFS)

D. Equivalent Strings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Today on a lecture about strings Gera

叶孤心的专栏 1124

miniDP与DP管脚定义差异详解及设计避坑指南

本文详细解析了Mini DisplayPort与标准DisplayPort接口在管脚定义上的核心差异,通过对比表格直观展示了两者20针脚的不同排列方式,特别是高速差分信号线的分布。文章结合真实设计案例,为硬件工程师提供了从原理图设计、PCB布局到信号完整性考量及故障排查的完整避坑指南,强调绝不能将两者视为简单的物理缩小版。

weixin_29248653的博客 362

通用抓取算法AnyGrasp(Graspnet)——本地部署并测试自定义输入数据

背景:GraspNet在数据采集方面,首先将相机固定到机械臂末端,对同一个场景拍摄256个不同的角度,同时场景中的每个物体都会提前采集好3D模型,之后将其投射到仿真环境中,在仿真环境中,对抓取位姿进行打标签,如此完成数据的采集。在运行官方的测试示例时,使用的是路径下的输入数据,可以分析下。color.png(输入):rgb图像(输出):输出的生成抓取位姿的图像depth.png(输入):和当前rgb图像对应的深度图像(保存格式是单通道uint16)meta.mat。

boss-dog 1327

Codeforces 768B Code For 1 【递归】

传送门:Codeforces 768B 题意: 给你一个数n,如果n!=0&&n!=1,就将他换成n/2,n%2,n/2三个数,然后一直对这个序列里的数(>1)进行这个操作,知道这个序列只剩0和1。 给你一个范围[l,r][l,r][l,r],问你这个范围里有几个1。 题解: 对于给出的数n,我们是可以判断最后这个序列的长度len的(每次len*2+1),然后在 [...

Waiting For You 801

EtherCAT主站IGH-- 49 -- 搭建xenomai系统及自己的IGH主站

以上就是搭建xenomai系统及自己的IGH主站的内容。有不明白的地方欢迎留言;有建议欢迎留言,我后面编写文档好改进。创作不容,如果文档对您有帮助,记得给个赞。

常驻客栈的博客--嵌入式EtherCAT 3155

Codeforces Round #449 (Div. 2)C. Nephren gives a riddle

链接:http://codeforces.com/contest/897/problem/C 题意:字符串的递归。f0=What are you doing at the end of the world? Are you busy? Will you save us?           s1=What are you doing while sending "     ...

aisongdan0899的博客 173

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Codeforces Round #449 (Div. 2) C. Nephren gives a riddle

C. Nephren gives a riddle time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output What are you doing at the end of the world? Are you busy? Will ...

indiewar's blogs(wust_lzl) 187

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Codeforces Round #449 (Div. 2). C. Nephren gives a riddle

C. Nephren gives a riddle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output What are you doing at the end of

1988的博客 528

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

CF&&CC百套计划1 Codeforces Round #449 A. Nephren gives a riddle

http://codeforces.com/contest/896/problem/A 第i个字符串嵌套第i-1个字符串 求第n个字符串的第k个字母 dfs #include<map> #include<cstdio> #include<iostream> using namespace std; typedef long...

weixin_33786077的博客 178

Codeforces Round #449 (Div. 2) C. Nephren gives a riddle 递归

http://codeforces.com/contest/897/problem/C 又是正视了自己的递归水平,55555。 题意:递归又递归的字符串   下面q个询问,第fn个字符串的第k个字符是啥,如果fn没k这么长就是. 做法:递归长度,n很大,先处理n,如果n k一直很大,可以先判断他是在哪个范围,至少得突破最左边的边缘区,就是34那一块,所以 先不断减小n,k达

twh233的算法blog 312

Codeforces Round #449 (Div. 2) C. Nephren gives a riddle (DFS)

2017.12.4  烟台正是 大雪纷飞,漫天飞舞,  这是今年的第四场雪, 大雪纷纷何所似?未若柳絮因风起  ?   C. Nephren gives a riddle time limit per test 2 seconds memory limit per test 256 megabytes input standard input

Sizaif's 小屋 244

【Codeforces】Chloe and the sequence (递归)

题解: 将序列写出来可以发现规律,1 + 2x 的位置值都是 1,2 + 4x 的位置的值都是 2,4 + 8x 的位置的数都是 3,8 + 16x 的位置的数都是 4……,因此按照这个规律就可以知道第k个数是谁了。并且由题意可以知道n到1的数量是逐渐增加的,可以利用递归函数进行取余从n向下查找这个元素是什么。 AC: #include<iostream> #include<cmath> #include<algorithm> using namespace st

skill_Carney的博客 571

CodeForces 83 D.Numbers(数论+递归)

Description 问区间[a,b][a,b][a,b]中以kkk为最小因子的数的个数,不考虑111为因子 Input 三个整数a,b,k(1≤a≤b≤2⋅109,2≤k≤2⋅109)a,b,k(1≤a≤b≤2⋅109,2≤k≤2⋅109)a,b,k(1\le a\le b\le 2\cdot 10^9,2\le k\le 2\cdot 10^9) Output 输出该区间中满足条件...

ZSQ 462

Codeforces1003 E. Tree Constructing(递归构造,cf2100)

【代码】Codeforces1003 E. Tree Constructing(递归构造,cf2100)

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz 521

CodeForces 630C Lucky Numbers(递归)

C. Lucky Numbers time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output The numbers of all offices in the new bui

Shyazhut 617

CodeForces 549D (暴力、模拟)

D. Haar Features time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The first algorithm for detecting a face on the image

hahahaha 1066

CodeForces 768 B.Code For 1(递归)

Description 初始序列只有nnn一个元素,每次操作会把序列中每个大于111的元素xxx变成⌊x2⌋,x%2,⌊x2⌋⌊x2⌋,x%2,⌊x2⌋\lfloor\frac{x}{2}\rfloor,x\%2,\lfloor\frac{x}{2}\rfloor,直至序列所有数字变成000或111为止,问操作结束后序列第lll个元素到第rrr个元素之间有多少111 Input 三个整数n,...

ZSQ 961

Codeforces 1419B. Stairs 递归

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结 前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。 提示:以下是本篇文章正文内容,下面案例可供参考 一、pandas是什么? 示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。 二、使用步骤 1.引入库 代码

A_2Bpencils的博客 340
上一篇: Codeforces Round #312 (Div. 2) E. A Simple Task 线段树(未敲)
下一篇: Codeforces Round #384 (Div. 2)E.Vladik and cards【二分+状压dp】(未敲)
sega_handsome
博客等级 码龄10年 7粉丝 164原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值