Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. #pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,tune=native")
  2. //#pragma GCC optimize("SEX_ON_THE_BEACH")
  3. #pragma GCC optimize("fast-math")
  4. #pragma GCC optimize("unroll-loops")
  5. #pragma comment(linker, "/STACK:36777216")
  6.  
  7. #define _CRT_SECURE_NO_WARNINGS
  8.  
  9. #include <set>
  10. #include <map>
  11. #include <deque>
  12. #include <cmath>
  13. #include <queue>
  14. #include <cassert>
  15. #include <random>
  16. #include <bitset>
  17. #include <iomanip>
  18. #include <numeric>
  19. #include <time.h>//////////////
  20. #include <ctime>
  21. #include <string>
  22. #include <cstdio>
  23. #include <vector>
  24. #include <cstdlib>
  25. #include <iostream>
  26. #include <algorithm>
  27. #include <unordered_map>
  28. #include <unordered_set>
  29. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  30. #define endl '\n'
  31. #define mp make_pair
  32. #define pbc push_back
  33. #define pob pop_back()
  34. #define empb emplace_back
  35. #define queuel queue<long long>
  36. #define all(x) (x).begin(), (x).end()
  37. #define rall(x) (x).rbegin(), (x).rend()
  38. #define matrix vector<vector<ll>>
  39. #define pin(p) cin >> p.first >> p.second;
  40. #define rev(v) reverse(v.begin(), v.end());
  41. #define mx(v) max_element(v.begin(), v.end());
  42. #define mn(v) min_element(v.begin(), v.end());
  43. #define sout(s, c) for (auto i : s) cout << i << c;
  44. #define pout(p) cout << p.first << " " << p.second;
  45. #define er(v, l, r) erase(v.begin() + l, v.begin() + r);
  46. #define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
  47. #define vout(v, c) for (int i = 0; i < v.size(); ++i) cout << v[i] << c;
  48. #define pushi(v, a) for (int i = 0; i < a.size(); ++i) v.push_back(a[i]);
  49. #define sin(s, n) for (int i = 0; i < n; ++i){int a; cin >> a; s.insert(a); }
  50. #define fastio() ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); srand(time(NULL))
  51. #define sp system("pause")
  52. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  53. using namespace std;//рџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђрџ¦Ђ
  54. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  55. typedef long long ll;
  56. typedef long double ld;
  57. typedef unsigned long long ull;
  58. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  59. const int MAXN = 1e5;
  60. const ll inf = 1e9;
  61. const ld EPS = 1e-6;
  62. const ld PI = acos(-1);
  63. int mod = (int)998244353;
  64. //const int MOD = 1000000007;
  65. const int MOD9 = 1000000009;
  66. const int a228 = 18;
  67. const ll MOD = 1000000007;
  68. const int maxelem = 12000000;
  69. const int fsconst = 12000;
  70. signed main()
  71. {
  72. fastio();
  73. int n;
  74. cin >> n;
  75. if (n == 1)
  76. {
  77. cout << "1 : a";
  78. return 0;
  79. }
  80. if (n == 2)
  81. {
  82. cout << "1 : NO\n2 : aa";
  83. return 0;
  84. }
  85. cout << "1 : NO\n2 : NO\n";
  86. for (int i = 3; i <= n; ++i)
  87. {
  88. if (i <= 26)
  89. {
  90. string s = "";
  91. for (char c = 'a'; s.size() < n ; ++c)
  92. {
  93. s.pbc(c);
  94. if (c == (char)('a' + i - 1)) c = 'a' - 1;
  95. }
  96. cout << i << " : " << s << endl;
  97. }
  98. else
  99. {
  100. string s = "";
  101. for (char c = 'a'; s.size() < n; ++c)
  102. {
  103. s.pbc(c);
  104. if (c == 'z') c = 'a' - 1;
  105. }
  106. if (i == n)
  107. {
  108. s = "abcdefghijklmnopqrstuvwxyzy";
  109. int left = i - 27;
  110. while (left--) s.pbc('y');
  111. cout << i << " : " << s << endl;
  112. continue;
  113. }
  114. int left = i - 26;
  115. char xxos = s.back();
  116. for (int j = s.size() - left - 1; j < s.size(); ++j)s[j] = xxos;
  117.  
  118. cout <<i <<" : " << s << endl;
  119. }
  120. }
  121. sp;
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement