jakaria_hossain

codeforces - coforces subsequence

Jun 20th, 2020
1,076
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
  5. int main()
  6. {
  7.     fast()
  8.     ll n;
  9.     cin>>n;
  10.     string s="codeforces";
  11.     ll ara[10],sum = 1;
  12.     for(ll i=0 ;i<10;i++)ara[i]=1;
  13.     for(ll i=0; i<10 && sum<n;i++)
  14.     {
  15.         sum/=ara[i];
  16.         ara[i]++;
  17.         sum*=ara[i];
  18.         if(i==9)i=-1;
  19.     }
  20.     for(ll i=0;i<10;i++)
  21.     {
  22.         for(ll j=1;j<=ara[i];j++)cout<<s[i];
  23.     }
  24.     cout<<"\n";
  25.  
  26. }
RAW Paste Data