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 ...
随机推荐
- 【JVM】2、关于jdk7的MethodHandle类
关于MethodHandle类,这个类是在jdk1.7之后加入的,这个类的作用类似函数指针的意思 这个类中有一个方法 这里我的jdk有一个问题,就是我在进行MethodHandle操作的时候,我们会发 ...
- 设置让ASP.NET管道接收所有类型的请求
在web.config文件添加如下一段配置: <configuration> <system.webServer> <modules runAllManagedModul ...
- New Valid Tracking Metric Now Available in Seller Central
On July 7, Amazon added Valid Tracking Rate as a new metric in Seller Central. This metric shows the ...
- C# Winform打包部署时添加注册表信息实现开机启动
使用VS自带的打包模块可以很方便的对项目进行打包部署,同时我们也可以在安装部署时操作注册表实现开机启动软件.具体实现如下: 1.添加安装部署项目后,鼠标右键安装项目->视图->注册表,HK ...
- windows 80端口被占用的解决方法
参考文献: 文献1: http://wenku.baidu.com/view/af4681bcfd0a79563c1e7289.html 文献2: http://www.2cto.com/os/201 ...
- 简单好用的Toast封装类——EasyToast
我们用toast时不能设置显示的时间,而且不支持在线程中展示toast,下面我对原始的toast进行了封装,这样我们可以很方便的进行toast的使用了. package com.kale.lib.ut ...
- C语言柔性数组
结构中最后一个元素允许是未知大小的数组,这个数组就是柔性数组.但结构中的柔性数组前面必须至少一个其他成员,柔性数组成员允许结构中包含一个大小可变的数组,sizeof返回的这种结构大小不包括柔性数组的内 ...
- C语言-02-基本运算
一.算术运算 种类 1> 加(+),同时可以表示正号 2> 减(-),同时可以表示负号 3> 乘(*) 4>除(/) 5>取余(%) 关于类型转换 1>自动类型转换 ...
- Java 之 内部类
(static修饰的成员属于整个类,而不属于单个对象) 定义:将一个类放到另一个类的内部定义,这个在内部定义的类就叫做内部类(也有的成嵌套类),包含内部类的类被称为外部类(也有的称宿主类). 1.非静 ...
- 设计模式 --- 模型-视图-控制器(Model View Controller)
模型-视图-控制器(Model-View-Controller,MVC)是Xerox PARC在20世纪80年代为编程语言Smalltalk-80发明的一种软件设计模式,至今已广泛应用于用户交互应用程 ...