Search found 36 matches
- Fri Jun 15, 2012 2:22 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10070 - Leap Year or Not Leap Year and ...
- Replies: 233
- Views: 58800
Re: 10070 - Leap Year or Not Leap Year and …
I checked my output with previous I/O. My prog accepts MAX 1000000 chars. Still WA. #include<stdio.h> #include<cstring> #define MAX 1000000 int main() { char year[MAX + 10]; bool first = true; while(scanf("%s",year) != EOF) { bool leap = false, hulu = false, bulu = false; int len = strlen(...
- Tue Jun 05, 2012 12:56 pm
- Forum: Volume 107 (10700-10799)
- Topic: 10776 - Determine The Combination
- Replies: 19
- Views: 10557
Re: 10776 - Determine The combination
Not sure why I m getting WA for this. My output matches with the UVA toolkit. Any tricky inputs? #include<iostream> #include<stdio.h> #include<string> #include<set> #include<algorithm> using namespace std; set<string> getcombo(string input,int r) { int n = input.length(); set<string> combinations; f...
- Sun Jun 03, 2012 5:56 pm
- Forum: Volume 107 (10700-10799)
- Topic: 10776 - Determine The Combination
- Replies: 19
- Views: 10557
Re: 10776 - Determine The combination
Can someone who got AC give the output for the following
AaBb 2
AaBb 3
aBCDE 3
aaaa 2
aabb 2
aaBB 2
AaBb 2
AaBb 3
aBCDE 3
aaaa 2
aabb 2
aaBB 2
- Fri Jun 01, 2012 6:34 am
- Forum: Volume 4 (400-499)
- Topic: 429 - Word Transformation
- Replies: 82
- Views: 20029
Re: 429 Word Transformation
Thanks ! The problem was in reading the newlines after each test case. Got AC now.
- Fri Jun 01, 2012 6:25 am
- Forum: Volume 3 (300-399)
- Topic: 386 - Perfect Cubes
- Replies: 53
- Views: 8902
Re: 386 - Perfect Cubes [WA]
Ah!. My mistake. I did not see that a,b,c > 1. I changed the starting value to 2 and got AC.
- Thu May 31, 2012 1:08 pm
- Forum: Volume 3 (300-399)
- Topic: 386 - Perfect Cubes
- Replies: 53
- Views: 8902
Re: 386 - Perfect Cubes [WA]
I compared my output with an accepted output. It is the same. Still WA. #include<stdio.h> #include<algorithm> #include<vector> using namespace std; int cubes[201]; struct node { int d; int a; int b; int c; }; node obj(int x,int y,int z, int w) { node obj; obj.d = x; obj.a = y; obj.b = z; obj.c = w; ...
- Sun May 27, 2012 12:08 pm
- Forum: Volume 4 (400-499)
- Topic: 429 - Word Transformation
- Replies: 82
- Views: 20029
Re: 429 Word Transformation
I m getting RTE for this one. I tried with sample I/O and my code works. #include<stdio.h> #include<iostream> #include<vector> #include<cstring> using namespace std; struct word { char w[20]; }; vector<word> dict; vector<vector<int> > conn; vector<bool> chosen; vector<int> dist; bool same(char *a,ch...
- Fri May 25, 2012 9:34 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11518 - Dominos 2
- Replies: 24
- Views: 9358
Re: 11518 - Dominos 2
Any tricky input for this problem ? I m getting WA.
Code: Select all
Nevermind, found my mistake. Got AC.
- Fri May 25, 2012 6:58 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10494 - If We Were a Child Again
- Replies: 55
- Views: 18757
Re: 10494 - If We Were a Child Again
I have tried with the sample inputs given previously. But I m getting TLE. Can anyone help me out?
Code: Select all
Got Ac. I optimised the algo.
- Sun May 20, 2012 12:33 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11827 - Maximum GCD
- Replies: 22
- Views: 4782
Re: 11827 - Maximum GCD (Why RE??)
I m constantly getting TLE on this one. Any better algo ? #include<vector> #include<stdio.h> #include<iostream> #include<limits.h> using namespace std; int main() { int t,re; re = scanf("%d",&t); while(t--) { int a,lowest = INT_MAX; vector<int> input; getchar(); while(cin.peek() != '\n...
- Sat May 19, 2012 12:25 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10684 - The jackpot
- Replies: 34
- Views: 19874
Re: 10684 - The Jackpot
Is this problem maximum consecutive sum or maximum sum ? I have tried both, but getting WA. For example, 5 5 -1 5 5 Is the answer 10 or 19 ? #include<stdio.h> #include<vector> using namespace std; int main() { int n,re; re = scanf("%d",&n); while(n) { vector<int> input; int a; for(int ...
- Sat May 19, 2012 8:41 am
- Forum: Volume 8 (800-899)
- Topic: 885 - Telephone Directory Alphabetization
- Replies: 21
- Views: 13369
Re: 885 - Telephone Directory Alphabetization
Thanks Brian. My problem was handling the "0" inputs. Got AC now.
- Fri May 18, 2012 12:50 pm
- Forum: Volume 8 (800-899)
- Topic: 885 - Telephone Directory Alphabetization
- Replies: 21
- Views: 13369
Re: 885 - Telephone Directory Alphabetization
Can you also tell me what is the output for 1234567000 12345670001 12345670000 #include<string> #include<vector> #include<iostream> #include<algorithm> using namespace std; const char *ones[] = {"ZERO","ONE","TWO","THREE","FOUR","FIVE",&quo...
- Fri May 18, 2012 12:31 pm
- Forum: Volume 8 (800-899)
- Topic: 885 - Telephone Directory Alphabetization
- Replies: 21
- Views: 13369
Re: 885 - Telephone Directory Alphabetization
Now I m getting WA. Can you tell me if ur AC code matches my I/O ? Sample Input: 1234567KAT shop 1234567K-B enterprises 1234567K W clop 1234567K Warehouse 123456759 steps 1234567fifty nine steps and alll 1234567K W street 1234567Do u know me? 1234567???? 1234567Excuse me 1000 12345671000 words 12345...
- Thu May 17, 2012 6:17 pm
- Forum: Volume 8 (800-899)
- Topic: 885 - Telephone Directory Alphabetization
- Replies: 21
- Views: 13369
Re: 885 - Telephone Directory Alphabetization
I m getting RE for this code. Can I know what the exact error was ? #include<string> #include<vector> #include<iostream> #include<algorithm> using namespace std; const char *ones[] = {"ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX"...