Search found 16 matches

by sajal2k8
Tue Sep 23, 2014 8:49 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21659

Re: 444 - Encoder and Decoder

Still getting WA. Give me some input for which this code will fail. I have tried existing ones: #include <iostream> #include <string> #include <stdlib.h> #include <sstream> #include <cstdio> #include <algorithm> #include <functional> #include <cctype> #include <locale> using namespace std; int main(...
by sajal2k8
Fri Sep 19, 2014 12:53 pm
Forum: Volume 119 (11900-11999)
Topic: 11988 - Broken Keyboard (a.k.a. Beiju Text)
Replies: 27
Views: 9377

Re: 11988 RE why?

Getting wrong answer now. Any critical input?
by sajal2k8
Fri Sep 19, 2014 10:39 am
Forum: Volume 119 (11900-11999)
Topic: 11988 - Broken Keyboard (a.k.a. Beiju Text)
Replies: 27
Views: 9377

11988 RE why?

I am getting runtime error. Please help. #include <iostream> #include <algorithm> using namespace std; int main() { string s,str="",strt[10000],t=""; int check=0,stri=0; while(getline(cin,s)) { for(int i=0;i<s.length();i++) { if(s[i]=='[') { i++; while(s[i]!='[' && s[i]!=']' && i!=s.length()) { str ...
by sajal2k8
Fri Sep 12, 2014 8:45 am
Forum: Volume 118 (11800-11899)
Topic: 11849 - CD
Replies: 24
Views: 5465

Re: 11849 - CD Why WA?

Why i am getting wrong answer? Here is my code: #include <iostream> using namespace std; long long int nu[1000000],num[1000000]; long long int matchCounter( long long int lottery[5], long long int user[5], long long int matches, long long int SIZE) { long long int count = 0; for (int count = 0; coun...
by sajal2k8
Thu Sep 11, 2014 9:05 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 39823

Re: 10013 - Super long sums

Getting RE. Please help: #include <iostream> using namespace std; int main() { long long int a,b,c,num[10000],num1[10000],i=0,sum=0,k=0,res[10000]; cin>>a; while(a--) { cin>>b; while(b--) { cin>>num ; cin>>num1 ; i++; } for(int j=i-1;j>-1;j--) { c=num[j]+num1[j]; if(c>9 && j!=0) { res[k]=c-10; k++; ...
by sajal2k8
Wed Aug 27, 2014 1:26 pm
Forum: Volume 101 (10100-10199)
Topic: 10127 - Ones
Replies: 32
Views: 12503

Re: 10127 - Ones

Why TLE? #include <iostream> #include <cstring> using namespace std; int main() { unsigned long long int a,num,count1=0,b,d=1000; while(cin>>a) { if(a==1) cout<<1<<endl; else { num=111; while(num%a!=0) { num=num+d; d=d*10; } while(num) { num /= 10; ++count1; } cout<<count1<<endl; d=1000; count1=0; }...
by sajal2k8
Thu Aug 21, 2014 7:40 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21659

Re: 444 - Encoder and Decoder

Hey brainfry713, Can you please run and tell me the problem. I really can't find: #include <iostream> #include <string> #include <stdlib.h> #include <sstream> #include <cstdio> #include <algorithm> #include <functional> #include <cctype> #include <locale> using namespace std; int main() { string s,n...
by sajal2k8
Wed Aug 20, 2014 12:02 pm
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21659

444 why getting wrong answer?

Here is my code: #include <iostream> #include <string> #include <stdlib.h> using namespace std; int main() { string s; char p[10000]; int i=0,a,b,c,d,re=0; while(getline(cin,s)) { for (std::string::reverse_iterator rit=s.rbegin(); rit!=s.rend(); ++rit) { p =*rit; i++; } for(int j=0;j<s.length();j++)...
by sajal2k8
Thu Jul 24, 2014 9:15 am
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13924

10098 why getting RE??

Here is my code: #include <iostream> #include<algorithm> using namespace std; int main() { int a,b=0,c; string str[10000],s,q,r; char ch; cin>>a; for(int i=0;i<a;i++) { cin>>s; for(int k=0;k<s.length()-1;k++) { for(int l=k+1;l<s.length();l++) { if(s[k]>s[l]) { ch=s[l]; s[l]=s[k]; s[k]=ch; } } } do {...
by sajal2k8
Thu Jul 24, 2014 9:14 am
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13924

10098 why getting RE??

Here is my code: #include <iostream> #include<algorithm> using namespace std; int main() { int a,b=0,c; string str[10000],s,q,r; char ch; cin>>a; for(int i=0;i<a;i++) { cin>>s; for(int k=0;k<s.length()-1;k++) { for(int l=k+1;l<s.length();l++) { if(s[k]>s[l]) { ch=s[l]; s[l]=s[k]; s[k]=ch; } } } do {...
by sajal2k8
Fri Jun 20, 2014 10:48 am
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 8656

484 Getting wrong answer or Runtime error please help

Here is my code: #include <iostream> #include <cstdlib> #include <sstream> #include <vector> using namespace std; int main() { int a,b=0,c=0,in[10000],out[10000]; string str; string buf; vector<string> tokens; while(getline(cin,str)) { stringstream ss(str); while (ss >> buf) { tokens.push_back(buf);...
by sajal2k8
Fri Jun 20, 2014 5:47 am
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 8656

Re: RE 484

Still not accepted. Any suggestion?
by sajal2k8
Thu Jun 12, 2014 6:49 am
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 8656

RE 484

#include <iostream> using namespace std; int main() { long long int a,n[10000],m[10000],e=0,c=0; for( int i=0;;i++) { cin>>a; if(m[a]==0) { n[c]=a; e++; c++; } m[a]=m[a]+1; if(cin.get()=='\n') break; } for(int i=0;i<e;i++) { cout<<n <<" "<<m[n ]; if(i!=e-1) cout<<endl; } return 0; } What is the prob...
by sajal2k8
Sat Dec 14, 2013 12:49 am
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 23911

10190 Why RE??

#include <iostream> using namespace std; int main() { unsigned long long int n,j,m,i=1,num[10000],a,c=0; while(cin>>n>>m) { num[0]=n; if(n==1) c=1; while(n>1 && m!=1) { a=n/m; if(n%m==0) num[i]=a; else { c=1; break; } n=n/m; i++; } if(m==1 || n==0) c=1; if(c==1) cout<<"Boring!\n"; else { for(j=0;j<...
by sajal2k8
Tue Dec 03, 2013 1:54 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 30661

488 WA

A C

Go to advanced search