CSES - Datatähti 2022 alku - Results
Submission details
Task:Merkkijono
Sender:berqiamouad
Submission time:2021-10-06 17:53:13 +0300
Language:C++ (C++17)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails
#4ACCEPTED0.01 sdetails
#5ACCEPTED0.01 sdetails
#6ACCEPTED0.01 sdetails
#7ACCEPTED0.01 sdetails
#8ACCEPTED0.01 sdetails
#9ACCEPTED0.01 sdetails
#10ACCEPTED0.01 sdetails
#11ACCEPTED0.01 sdetails
#12ACCEPTED0.01 sdetails
#13ACCEPTED0.01 sdetails
#14ACCEPTED0.01 sdetails
#15ACCEPTED0.01 sdetails
#16ACCEPTED0.01 sdetails

Code

#include<bits/stdc++.h>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#pragma GCC optimize("O2")
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef vector <int> vi;
typedef vector <string> vs;
typedef pair<int,int> pi;
typedef vector <pair<int,int>> vii;
typedef vector <long long> vll;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

#define MP make_pair
#define deb(x) cout << x << " "
#define pb push_back
#define ins insert
#define all(c) c.begin(), c.end()
#define e(n) n%2==0
#define o(n) n%2!=0
#define rep(e,n,a) for(int i=e; i<=n; i+=a)
#define sz(c) (int)c.size()
#define MOD 1000000007
template <typename T> void rd(T& x){cin >> x;}
template<typename H, typename... T> void rd(H& h, T&... t) {
    rd(h);
    rd(t...);
}
template <typename T> void wt(T& x){cout << x;}

void print(){cout << "\n";}



void solve(){
    int n; cin >> n ;
    string res,temp;
    string alpha = "abcdefghijklmnopqrstuvwxyz";
    for(int i=0;i<n;i++){
        for(int j = 0;j < sz(res); j++){
            temp.pb(alpha[i]); temp.pb(res[j]);
        }
        res = temp; res += alpha[i];
        temp.clear();
    }
    cout << res << "\n";
}

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt", "r",stdin);
    //freopen("output.txt", "w", stdout);

    int t=1;
    //cin >> t;
    while(t--){
        solve();
    }
}

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output
a

user output
a

Test 2

Verdict: ACCEPTED

input
2

correct output
bab

user output
bab

Test 3

Verdict: ACCEPTED

input
3

correct output
cbcacbc

user output
cbcacbc

Test 4

Verdict: ACCEPTED

input
4

correct output
dcdbdcdadcdbdcd

user output
dcdbdcdadcdbdcd

Test 5

Verdict: ACCEPTED

input
5

correct output
edecedebedecedeaedecedebedeced...

user output
edecedebedecedeaedecedebedeced...

Test 6

Verdict: ACCEPTED

input
6

correct output
fefdfefcfefdfefbfefdfefcfefdfe...

user output
fefdfefcfefdfefbfefdfefcfefdfe...

Test 7

Verdict: ACCEPTED

input
7

correct output
gfgegfgdgfgegfgcgfgegfgdgfgegf...

user output
gfgegfgdgfgegfgcgfgegfgdgfgegf...
Truncated

Test 8

Verdict: ACCEPTED

input
8

correct output
hghfhghehghfhghdhghfhghehghfhg...

user output
hghfhghehghfhghdhghfhghehghfhg...
Truncated

Test 9

Verdict: ACCEPTED

input
9

correct output
ihigihifihigihieihigihifihigih...

user output
ihigihifihigihieihigihifihigih...
Truncated

Test 10

Verdict: ACCEPTED

input
10

correct output
jijhjijgjijhjijfjijhjijgjijhji...

user output
jijhjijgjijhjijfjijhjijgjijhji...
Truncated

Test 11

Verdict: ACCEPTED

input
11

correct output
kjkikjkhkjkikjkgkjkikjkhkjkikj...

user output
kjkikjkhkjkikjkgkjkikjkhkjkikj...
Truncated

Test 12

Verdict: ACCEPTED

input
12

correct output
lkljlklilkljlklhlkljlklilkljlk...

user output
lkljlklilkljlklhlkljlklilkljlk...
Truncated

Test 13

Verdict: ACCEPTED

input
13

correct output
mlmkmlmjmlmkmlmimlmkmlmjmlmkml...

user output
mlmkmlmjmlmkmlmimlmkmlmjmlmkml...
Truncated

Test 14

Verdict: ACCEPTED

input
14

correct output
nmnlnmnknmnlnmnjnmnlnmnknmnlnm...

user output
nmnlnmnknmnlnmnjnmnlnmnknmnlnm...
Truncated

Test 15

Verdict: ACCEPTED

input
15

correct output
onomonolonomonokonomonolonomon...

user output
onomonolonomonokonomonolonomon...
Truncated

Test 16

Verdict: ACCEPTED

input
16

correct output
popnpopmpopnpoplpopnpopmpopnpo...

user output
popnpopmpopnpoplpopnpopmpopnpo...
Truncated