UVALive 6181
模拟题,注意细节。。
#include <iostream>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#define mod 1073741824
using namespace std; char a[];
char res[];
int op[]; int main()
{
int t,n,i,k;
scanf("%d",&t);
int cs;
int now;
while(t--)
{
memset(op,,sizeof(op));
memset(a,,sizeof(a));
memset(res,,sizeof(res));
scanf("%d",&cs);
getchar();
gets(a); //scanf("%s",a); scanf("%d",&n);
for(i=;i<n;i++)
scanf("%d",&op[i]);
k=;
int len=strlen(a);
now=op[];
if(now<)
now+=len;
else if(now>=len)
now%=len;
res[k++]=a[now]; for(i=;i<n;i++) //op
{
now+=op[i];
if(now>=len)
now%=len;
if(now<)
now+=len;
res[k++]=a[now];
}
printf("%d %s\n",cs,res);
}
return ;
}
UVALive 6181的更多相关文章
- UVALive - 4108 SKYLINE[线段树]
UVALive - 4108 SKYLINE Time Limit: 3000MS 64bit IO Format: %lld & %llu Submit Status uDebug ...
- UVALive - 3942 Remember the Word[树状数组]
UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...
- UVALive - 3942 Remember the Word[Trie DP]
UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...
- 思维 UVALive 3708 Graveyard
题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...
- UVALive 6145 Version Controlled IDE(可持久化treap、rope)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...
- UVALive 6508 Permutation Graphs
Permutation Graphs Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...
- UVALive 6500 Boxes
Boxes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Pract ...
- UVALive 6948 Jokewithpermutation dfs
题目链接:UVALive 6948 Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...
- 【暑假】[实用数据结构]UVAlive 3135 Argus
UVAlive 3135 Argus Argus Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %l ...
随机推荐
- swift学习笔记之-类型转换
//类型转换 import UIKit /*类型转换(Type Casting) 1.类型转换 可以判断实例的类型,也可以将实例看做是其父类或者子类的实例. 2.类型转换使用 is 和 as 操作符实 ...
- 深入底层逆向分析TDC‘s keygenme(手脱压缩壳)
系统 : Windows xp 程序 : TDC‘s keygenme 程序下载地址 :http://pan.baidu.com/s/1gdWyt6z 要求 : 脱壳 & 注册机编写 使用工具 ...
- IOS开发中(null)与<null>的处理
不小心在开发过程中,得到了(null)以及<null>的返回值,找了好长时间只找到了一个关于<null>的. 由于要根据返回值进行判断,做出必要反应,因此必须知道返回值所代表的 ...
- Masonry介绍与使用实践(快速上手Autolayout)
MagicNumber -> autoresizingMask -> autolayout 以上是纯手写代码所经历的关于页面布局的三个时期 在iphone1-iphone3gs时代 win ...
- XAlign:用于代码对齐的Xcode插件
除下面的插件对齐,xcode自带有cmd+v,在没有复制或者剪切的情况下,直接按cmd+v会有着对齐参数标签冒号的作用. XAlign 是一个 Xcode 的实用插件,用于对齐规范代码.除了插件作者 ...
- Office 2013 激活工具
早上装机,顺便装了下Office 2013,界面还是不错的.网上找了下相关的激活工具. 发现还是独木成林做的最好呀,直接把别人的链接给拿过来好了,下载地址 http://pan.baidu.com/s ...
- UVa 109 - SCUD Busters(凸包计算)
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&pa ...
- 整理了一些常用的jQuery动画事件
部分jQuery常用的动画函数,整理了一下,在做交互式页面的时候挺有用的 .css('a','12px');.css({ a:'12px', b:'#fff'}); .show();.hide() ...
- JavaScript Patterns 3.7 Primitive Wrappers
Primitive value types: number, string, boolean, null, and undefined. // a primitive number var n = 1 ...
- java Hello 出现以下结果:Bad command or the file name 可能是什么原因
没有这个命令或文件名 原因可能是没有成功安装jdk或者没有配置好jdk 的环境变量,或者没有编译相应的文件. 2. 出现以下结果:Exception in thread “main” java.lan ...