Codeforces functionality may be limited from June 18, 19:00 (UTC) to June 19, 3:00 AM (UTC) due to technical maintenance. Polygon will work as usual. ×

### FARMAAN_KHANN's blog

By FARMAAN_KHANN, history, 8 months ago,

write a program that:

1. reads provided inputs containing alphabetically sorted words list (one word per line, no spaces, all lower case)
2. output the following things
 2.1  longest compounded word


2.2 second longest compounded word

NOTE :: a compounded word is one that can be constructed by combining (concatenating) shorter words also found in the same test-case input file :: small word list, consisting following words

cat
cats
catsdogcats
catxdogcatsrat
dog
dogcatsdog
hippopotamuses
rat
ratcatdogcat


ANSWERS:: longest compounded word :: ratcatdogcat second longest compounded word :: catsdogcats constraint 1<=N<=10^8

please provide me the solutions and time complexity with explanation i hope all off you reply this question comes in GOOGLE in open book assignment conducted in IIT mandi love you all

• -43

By FARMAAN_KHANN, history, 10 months ago,

on 15 august in INDIA we celebrate independence day you please change the date for round 893 or it will worthless coz no indian will participate in that round

• -41

By FARMAAN_KHANN, history, 16 months ago,
#include <iostream>
using namespace std;
bool solve1(long long small,long long  big){
int s=0;
while(small>0){
s+=small%10;
small/=10;
}
int k = 0;
while(big>0){
k+=big%10;
big/=10;
}
// cout<<s<<" "<<k<<'\n';
if(s==k){
return true;
}else return false;
}
void solve(){
long long  n; cin>>n;
for(long long  i=1;i<n;i++){
cout<<i<<'\n';
if(solve1(i,n-i)){
// cout<<'\n';
cout<<i<<" "<<n-i<<'\n';
return;
}
}
}
int main()
{
int t; cin>>t;
while(t--){
solve();
}
}

• -7

By FARMAAN_KHANN, history, 18 months ago,

I am new here please tell me what does that mean user is diabled by administrators does that mean ban or something else.

• -6