【NOIP2017练习】跳跃切除子序列(模拟)
题意:


思路:

已放弃
#include <bits/stdc++.h>
typedef long long LL; int main(){
int T; scanf("%d", &T);
while(T--){
int a; char s[];
scanf("%d%s", &a, s);
LL b;
for(b = a;; b += a){
char t[];
sprintf(t, "%lld", b);
if(!strcmp(s, t)) goto finish;
int tl = strlen(t), sl = strlen(s);
int rn = tl - sl;
if(rn < ) continue;
for(int i = ; i <= sl; ++i)
for(int j = , til; (til = i + (rn - ) * j) < tl && j < tl; ++j){
for(int k = , l = ; k < sl; ++k, ++l){
while(l >= i && l <= til && !((l - i) % j)) ++l;
if(s[k] != t[l]) goto fail;
}
goto finish;
fail:;
}
}
finish:
printf("%lld\n", b);
}
// printf("clock %d\n", (int) clock());
return ;
}
【NOIP2017练习】跳跃切除子序列(模拟)的更多相关文章
- 准备NOIP2017 最长公共子序列(模版)
一些概念: (1)子序列: 一个序列A = a1,a2,--an,中任意删除若干项,剩余的序列叫做A的一个子序列.也可以认为是从序列A按原顺序保留任意若干项得到的序列.例如: 对序列 1,3,5, ...
- 【NOIP2017练习】溢出(模拟)
题意: 思路: a*b<=c <====> b<=c div a var ch,maxs,s:ansistring; v,k,i,maxl,l,len,cnt,cas:long ...
- 校际联合Contest
每次开一个坑都像是重新被碾压的预感 最近的新闻,以前很喜欢乔任梁的<复活>...然后他就死了...感觉我再多愁善感一点的话...就要悲伤逆流成河了吧... Contest 09/24(乐滋 ...
- HTML5 2D平台游戏开发#2跳跃与二段跳
在上一篇<Canvas制作时间与行为可控的sprite动画>中已经实现了角色的左右移动,本篇继续实现角色的一系列动作之一:跳跃.先来看看最终效果: 要实现跳跃,必须模拟垂直方向的速度和重力 ...
- Codevs 3289 花匠 2013年NOIP全国联赛提高组
3289 花匠 2013年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题目描述 Description 花匠栋栋种了一排花,每株花都 ...
- 【Unity Shaders】ShadowGun系列之二——雾和体积光
写在前面 体积光,这个名称是God Rays的中文翻译,感觉不是很形象.God Rays其实是Crepuscular rays在图形学中的说法,而Crepuscular rays的意思是云隙光.曙光. ...
- 《Multiplayer Game Programming》阅读笔记
在图书馆发现一本<网络多人游戏架构与编程>-- Joshua Glazer, Sanjay Madhav 著.书挺新的,17年出版的,内容很有趣,翻一翻可以学到不少在<计算机网络&g ...
- Visual->UIElement->FrameworkElement,带来更多功能的同时也带来了更多的限制
在 WPF 或 UWP 中,我们平时开发所遇到的那些 UI 控件或组件,都直接或间接继承自 Framework.例如:Grid.StackPanel.Canvas.Border.Image.Butto ...
- D - Super Jumping! Jumping! Jumping!
Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular i ...
随机推荐
- NSUserDefaults保存用户名和密码
#import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutl ...
- 转】RMySQL数据库编程指南
原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/page/2/ 感谢! Posted: Sep 24, 2013 Ta ...
- [转]在asp.net mvc中使用PartialView返回部分HTML段
本文转自:http://blog.csdn.net/sandy945/article/details/6307750 问题链接: MVC如何实现异步调用输出HTML页面 该问题是个常见的 case, ...
- VM virtualBox设置无缝全屏
设置之前:
- 对象输入输出流ObjectInputStream、ObjectOutputStream(对象序列化与反序列化)
对象的输入输出流 : 主要的作用是用于写入对象信息与读取对象信息. 对象信息一旦写到文件上那么对象的信息就可以做到持久化了 对象的输出流: ObjectOutputStream 对象的输入流: Ob ...
- HTML5——loading
https://www.cnblogs.com/wangmeijian/p/4449150.html https://www.cnblogs.com/yunser/p/canvas-baidu-loa ...
- Sass的的使用三
[Sass]普通变量与默认变量普通变量定义之后可以在全局范围内使用. 默认变量sass 的默认变量仅需要在值后面加上 !default 即可.sass 的默认变量一般是用来设置默认值,然后根据需求来覆 ...
- linux centos 下php的mcrypt扩展
去http://www.sourceforge.net下载Libmcrypt,mhash,mcrypt安装包 libmcrypt(libmcrypt-2.5.8.tar.gz ):mcrypt(mcr ...
- git 出现 The current branch is not configured for pull No value for key branch.master.merge found in configuration
以下是我在网上找到的不错的文章,我参考后已解决我的问题: http://my.oschina.net/robinsonlu/blog/144085 http://www.cnblogs.com/zha ...
- JVM参数说明介绍
1.JVM运行时数据区内存参数说明 2.JVM垃圾收集器参数总结 原文:https://blog.csdn.net/bluuusea/article/details/90697340 ======== ...