ural 1219. Symbolic Sequence
1219. Symbolic Sequence
Memory limit: 64 MB
- Every letter occurs not more than 40 000 times in the sequence;
- Every possible subsequence with two letters length occurs not more than 2 000 times;
- Every possible subsequence with three letters length occurs not more than 100 times;
Input
Output
Problem Source: The Seventh Ural State University collegiate programming contest
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name) {
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint() {
int Ret = ;
char Ch = ' ';
while(!(Ch >= '' && Ch <= '')) Ch = getchar();
while(Ch >= '' && Ch <= '') {
Ret = Ret*+Ch-'';
Ch = getchar();
}
return Ret;
} int Cnt = ; inline void Input() { } inline void Solve() {
For(i, , )
printf("%c%c%c", (i/)%+'a', (i/)%+'a', i%+'a');
puts("a");
} int main() {
#ifndef ONLINE_JUDGE
SetIO("D");
#endif
Input();
Solve();
return ;
}
ural 1219. Symbolic Sequence的更多相关文章
- 记忆化搜索(DP+DFS) URAL 1183 Brackets Sequence
题目传送门 /* 记忆化搜索(DP+DFS):dp[i][j] 表示第i到第j个字符,最少要加多少个括号 dp[x][x] = 1 一定要加一个括号:dp[x][y] = 0, x > y; 当 ...
- URAL 1183 Brackets Sequence
URAL 1183 思路:区间dp,打印路径,详见http://www.cnblogs.com/widsom/p/8321670.html 代码: #include<iostream> # ...
- Ural 1183 Brackets Sequence(区间DP+记忆化搜索)
题目地址:Ural 1183 最终把这题给A了.. .拖拉了好长时间,.. 自己想还是想不出来,正好紫书上有这题. d[i][j]为输入序列从下标i到下标j最少须要加多少括号才干成为合法序列.0< ...
- URAL 1133. Fibonacci Sequence
题目链接 #include <cstdio> #include <string> #include <cstring> #include <iostream& ...
- URAL 1183 Brackets Sequence(DP)
题目链接 题意 : 给你一串由括号组成的串,让你添加最少的括号使该串匹配. 思路 : 黑书上的DP.dp[i][j] = min{dp[i+1][j-1] (sh[i] == sh[j]),dp[i] ...
- URAL 1133 Fibonacci Sequence(数论)
题目链接 题意 :给你第 i 项的值fi,第 j 项的值是 fj 让你求第n项的值,这个数列满足斐波那契的性质,每一项的值是前两项的值得和. 思路 :知道了第 i 项第j项,而且还知道了每个数的范围, ...
- URAL DP第一发
列表: URAL 1225 Flags URAL 1009 K-based Numbers URAL 1119 Metro URAL 1146 Maximum Sum URAL 1203 Scient ...
- 递推DP URAL 1081 Binary Lexicographic Sequence
题目传送门 题意:问第k个长度为n的01串是什么(不能有相邻的1) 分析:dp[i][0/1] 表示前i个,当前第i个放1或0的方案数,先预处理计算,dp[i][1]只能有dp[i-1][0]转移过来 ...
- ural 1247. Check a Sequence
1247. Check a Sequence Time limit: 0.5 secondMemory limit: 64 MB There is a sequence of integer numb ...
随机推荐
- UVa 11462 Age Sort
解题报告:给若干个居民的年龄排序,年龄的范围在1到100之间,输入的总人数在0到200W.这题要注意的输入的文件约有25MB,而内存限制为2MB,所以如果人数是像200W这样多的话,甚至都不能把它们都 ...
- 滚动光效shader
Shader "Custom/LightMove" { Properties { _MainTex ("Base (RGB)", 2D) = "whi ...
- 关于用Max导出Unity3D使用的FBX文件流程注解
原地址:http://hi.baidu.com/phpstyle/item/c167a4c0694670b10d0a7b87 关于用Max导出Unity3D使用的FBX文件流程注解(转载) (2011 ...
- hiho一下第91周《Events Arrangement》(前半部分)
题目大意 现在有一场持续时间为M的游乐会,在游乐会上有N种不同的表演节目,同一时间只能有一个节目进行表演. 每种节目最多可以表演K次,且每种节目具有自己的三个属性值a[i],b[i],c[i]. 当一 ...
- Coursera台大机器学习技法课程笔记02-Dual Support Vector Machine
这节课讲的是SVM的对偶问题,比较精彩的部分:为何要使用拉格朗日乘子以及如何进行对偶变换. 参考:http://www.cnblogs.com/bourneli/p/4199990.html http ...
- 影像工作站的数据库安装错误之Win7系统下pg服务无法启动
1.关闭批处理 2.修改 PG安装路径下的Data文件下的pg_hba.conf文件中去掉IPv6的井号,如下图 3.结束pg进程 4.重启PG服务.
- 基于DCMTK的DICOM相关程序编写攻略
2008年09月10日 星期三 15:35 基于DCMTK的DICOM相关程序编写攻略 前言: 由于现在的医学影像设备的图像存储和传输正在逐渐向DICOM标准靠拢,在我们进行医学图像处理的过程中,经常 ...
- ZJOI Day 2 游记
---恢复内容开始--- 去ZJOI Day 2打了一会酱油...各种神犇大爷都来屠,南外的小朋友也来屠我们了真是感动...没有看到毛爷爷真是可惜.. Day[-1] 早上还在上课,吃完中饭立马跑去找 ...
- MySQL关闭过程详解和安全关闭MySQL的方法
MySQL关闭过程详解和安全关闭MySQL的方法 www.hongkevip.com 时间: -- : 阅读: 整理: 红客VIP 分享到: 红客VIP(http://www.hongkevip.co ...
- 简单方便地扩充Python的系统路径
参考: http://www.elias.cn/Python/PythonPath?from=Develop.PythonPath http://v2in.com/pth-file-usage-in- ...