ural 1219. Symbolic Sequence
2015-10-19 21:22
381 查看
1219. Symbolic Sequence
Time limit: 1.0 secondMemory limit: 64 MB
Your program is to output a sequence of 1 000 000 lowercase Latin letters. This sequence should satisfy the following restrictions:
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
For this problem no input is provided.Output
In a single line of the output write some sequence, which satisfies the properties described above.Problem Author: Pavel Atnashev, Leonid Volkov, text by Pavel Atnashev
Problem Source: The Seventh Ural State University collegiate programming contest
Tags: unusual problem (hide tags for unsolved problems)
Difficulty: 120
题意:不说
分析:1、随机生成,基本上有很大概率是对的
2、随便构造一个就好,我是三个三个枚举的、。。。
#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 = 0; char Ch = ' '; while(!(Ch >= '0' && Ch <= '9')) Ch = getchar(); while(Ch >= '0' && Ch <= '9') { Ret = Ret*10+Ch-'0'; Ch = getchar(); } return Ret; } int Cnt = 0; inline void Input() { } inline void Solve() { For(i, 1, 333333) printf("%c%c%c", (i/676)%26+'a', (i/26)%26+'a', i%26+'a'); puts("a"); } int main() { #ifndef ONLINE_JUDGE SetIO("D"); #endif Input(); Solve(); return 0; }
View Code
相关文章推荐
- iOS之UI随笔-视图控制器的生命周期
- 通过ida dump Uinity3D的加密dll
- JS模块化工具requirejs教程(二):基本知识
- UIControl及其子类
- ueditor使用经验
- iOS之UI基础---frame和bounds的区别
- iOS中 UITextView文本视图 技术分享
- iOS中 UITextView文本视图 技术分享
- iOS UIViewContentMode各类效果
- SyBaseのPowerBuilder12.5.1 打开dw时退出 解决方法
- UI23_基类
- Chapter5-标准I/O库(下)-「APUE读书笔记」
- 从头学Qt Quick(1) --体验快速构建动态效果界面
- UI23_多线程
- 从头学Qt Quick(2)-- QML语法从一个简单的例子说起
- UI22_UICollectionView
- UIView
- Quick Sort源码
- UIPopoverController 指向 UIBarButtonItem 并缓慢消失
- UI21_豆瓣数据库