您的位置:首页 > 产品设计 > UI/UE

ural 1219. Symbolic Sequence

2015-10-19 21:22 381 查看

1219. Symbolic Sequence

Time limit: 1.0 second
Memory 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: