Got AC. Wasnt checking stack empty. Would try to make it simpler, thanks.mf wrote:Try "((" or "))".
And your code is too complex for such an easy task, too many if's. Keep it simpler
Search found 8 matches
- Sun Oct 04, 2009 10:11 am
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 80260
Re: 673 - Parentheses Balance
- Sat Oct 03, 2009 11:30 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 80260
Re: 673 - Parentheses Balance
I'm getting WA for this. It worked for all tests I fired at it.
EDIT: Code removed after AC
EDIT: Code removed after AC
- Mon May 18, 2009 11:38 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11608 - No Problem
- Replies: 25
- Views: 15043
Re: 11608 - No Problem
Got it, thanks.
- Sat May 16, 2009 10:41 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11608 - No Problem
- Replies: 25
- Views: 15043
11608 - No Problem
I am getting TLE for this problem . I think it is because of (if I am not semantically wrong!) an infinite loop in the code, which is as a result of not specifying the test cases before the program starts. (Hope you get it) That is, I cant terminate the program.
Here is the code:
#include <iostream ...
Here is the code:
#include <iostream ...
- Mon Mar 23, 2009 2:51 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320852
Re: 100
Here is the output:
Code: Select all
1 2
1 2 4
1 3
1 3 8
1 4
1 4 8
2 2
2 2 2
2 3
2 3 8
2 1
2 1 4
3 1
3 1 8
- Mon Mar 23, 2009 9:17 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320852
Re: 100
Fixed the problem with case being 1 1.
Still getting WA...
Still getting WA...
- Mon Mar 23, 2009 7:52 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320852
Re: 100
Now I am getting WA. Can't figure out the problem
with the code!!
Please help.
(Code is pasted at 4th page, last reply)
Thanks

Please help.
(Code is pasted at 4th page, last reply)
Thanks
- Sun Mar 22, 2009 7:21 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 320852
Re: 100
Hi,
I am getting time limit exceeded for my solution,
but I think worst case (1 999999) is being computed in less than 3 sec.
Here is the code:
#include <iostream>
using namespace std;
int main()
{
int small;
int big;
int max;
int n, len;
register unsigned long long int x;
int a;
int b ...
I am getting time limit exceeded for my solution,
but I think worst case (1 999999) is being computed in less than 3 sec.
Here is the code:
#include <iostream>
using namespace std;
int main()
{
int small;
int big;
int max;
int n, len;
register unsigned long long int x;
int a;
int b ...