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、随便构造一个就好,我是三个三个枚举的、。。。
1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <deque> 6 #include <vector> 7 #include <queue> 8 #include <iostream> 9 #include <algorithm> 10 #include <map> 11 #include <set> 12 #include <ctime> 13 using namespace std; 14 typedef long long LL; 15 typedef double DB; 16 #define For(i, s, t) for(int i = (s); i <= (t); i++) 17 #define Ford(i, s, t) for(int i = (s); i >= (t); i--) 18 #define Rep(i, t) for(int i = (0); i < (t); i++) 19 #define Repn(i, t) for(int i = ((t)-1); i >= (0); i--) 20 #define rep(i, x, t) for(int i = (x); i < (t); i++) 21 #define MIT (2147483647) 22 #define INF (1000000001) 23 #define MLL (1000000000000000001LL) 24 #define sz(x) ((int) (x).size()) 25 #define clr(x, y) memset(x, y, sizeof(x)) 26 #define puf push_front 27 #define pub push_back 28 #define pof pop_front 29 #define pob pop_back 30 #define ft first 31 #define sd second 32 #define mk make_pair 33 inline void SetIO(string Name) { 34 string Input = Name+".in", 35 Output = Name+".out"; 36 freopen(Input.c_str(), "r", stdin), 37 freopen(Output.c_str(), "w", stdout); 38 } 39 40 inline int Getint() { 41 int Ret = 0; 42 char Ch = ‘ ‘; 43 while(!(Ch >= ‘0‘ && Ch <= ‘9‘)) Ch = getchar(); 44 while(Ch >= ‘0‘ && Ch <= ‘9‘) { 45 Ret = Ret*10+Ch-‘0‘; 46 Ch = getchar(); 47 } 48 return Ret; 49 } 50 51 int Cnt = 0; 52 53 inline void Input() { 54 55 } 56 57 inline void Solve() { 58 For(i, 1, 333333) 59 printf("%c%c%c", (i/676)%26+‘a‘, (i/26)%26+‘a‘, i%26+‘a‘); 60 puts("a"); 61 } 62 63 int main() { 64 #ifndef ONLINE_JUDGE 65 SetIO("D"); 66 #endif 67 Input(); 68 Solve(); 69 return 0; 70 }
时间: 2024-10-22 03:42:44