Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- #pragma GCC optimize("O3")
- using namespace std;
- using namespace __gnu_pbds;
- //#define int long long
- #define double long double
- #define _ << ' ' <<
- #define For(i,z) for(int32_t i=0;i<(z);i++)
- #define sqr(a) ((a)*(a))
- #define pii pair<int, int>
- #define pdd pair<double, double>
- #define f first
- #define s second
- template<typename T>
- using orset = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
- template<typename T, typename K>
- using ormap = tree <T, K, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
- template<typename T, typename K> inline void umax(T &a, K b) { a = max(a, (T)b); }
- template<typename T, typename K> inline void umin(T &a, K b) { a = min(a, (T)b); }
- mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
- const int32_t N = 1e6+10;
- const int64_t INF = 1e15;
- const pair<int64_t, int64_t> PINF = make_pair(INF, INF);
- const double EPS = 1e-7;
- const int64_t MOD1 = 99989;
- const int64_t MOD2 = 99991;
- const int64_t AMOD = 99194853094755497;
- const double PI = 3.14159265359;
- pii dp[N][26];
- int32_t main() {
- //freopen("input.txt", "r", stdin);
- ios_base::sync_with_stdio(false);
- cin.tie(0); cout.tie(0);
- int k; cin >> k;
- string s;
- s = "a";
- while (k > 0) {
- if (s.back() == 'a')
- s += 'z';
- else
- s += 'a';
- k -= 25;
- }
- For (i, s.size()-1) {
- if (s[i] == 'z') {
- int cc = min((-k)/2, (int)'z' - 'a');
- s[i] -= cc;
- k += cc * 2;
- if (k >= 0) break;
- }
- }
- if (k > 0) {
- if (s.back() == 'z')
- s.back() -= k;
- else
- s.back() += k;
- } else {
- if (s.back() == 'z')
- s.back() += k;
- else
- s.back() -= k;
- }
- cout << s << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement