Search found 11 matches

by oja
Mon Nov 23, 2015 4:47 am
Forum: Volume 113 (11300-11399)
Topic: 11395 - Sigma Function
Replies: 0
Views: 1051

Re: 11395 - Sigma Function

can someone give a hint/algo/mathematical fact that can help in solving this problem?
by oja
Mon Nov 23, 2015 2:54 am
Forum: Volume 6 (600-699)
Topic: 619 - Numerically Speaking
Replies: 10
Views: 4788

Re: 619 - Numerically Speaking

why am i getting RE? I tried udebug with both upper and lower bound inputs and my code works..

Code: Select all

got AC, code deleted
EDIT: I got multiple REs just because the name of the main class isn't "Main"!!
by oja
Wed Jul 08, 2015 10:58 am
Forum: Algorithms
Topic: Sum Of Number of Divisors
Replies: 2
Views: 3759

Re: Sum Of Number of Divisors

You seem to have misunderstood. Your code seems to calculate the sum of divisors of a number. That's not what I meant. In short, what I want is the summation of the number of divisors of numbers 1 to n. These are sample values: 1 - 1 (1 has only 1 divisor) 2 - 3 (2 has 2 divisors, so 1 + 2 = 3 ) 3 -...
by oja
Fri May 22, 2015 3:52 pm
Forum: Algorithms
Topic: Sum Of Number of Divisors
Replies: 2
Views: 3759

Sum Of Number of Divisors

Can anyone tell me how the code below works? I mean what's the theory behind it. Or does it really work? I tried it for some values and it gave the right answers. It's supposed to return the sum of number of divisors of numbers from 1 to N. If you have better approach than this then please let me kn...
by oja
Sun May 17, 2015 11:56 pm
Forum: Volume 115 (11500-11599)
Topic: 11517 - Exact Change
Replies: 33
Views: 9875

Re: 11517 - Exact Change

This is not the usual coin change problem where the number of each coin/bill is unlimited. The number of each coin/bill is the number of times it appears in the input. You are allowed to use the bills/coins as many times as they appear in the input. In the input you've given, there's only one 5 so y...
by oja
Fri May 15, 2015 2:39 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45545

Re: 673 - Parentheses Balance

Input: 1 ((() Output: No Your code outputs "Yes". After you process the whole string. Check if the stack is empty or not. If it's not empty then it's a "No". Btw, couple of suggestions: 1-If you post your code, use the "Code" button at the top of the editor window. Your code may become more readable...
by oja
Thu May 14, 2015 1:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10069 - Distinct Subsequences
Replies: 26
Views: 11572

Re: 10069 - Distinct Subsequences

...which I also can't find. (along with delete). So I'm not the only experiencing this problem. Anyway, how come it's about big integer? I thought that "Z nor any prefix or suffix of Z will have more than 10100 distinct occurrences in X as a subsequence." That was also my question. But when I looke...
by oja
Thu May 14, 2015 2:07 am
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31537

Re: 10533 - Digit Primes

Make an array(let's say "arr") that stores the number of digit primes up to the value of the index. For example, arr[10] contains the number of digit primes from 0 to 10. Fill this array before processing any input. Check if 0 is digit prime. It isn't. So arr[0] is 0. Next is 1. It isn't either so a...
by oja
Mon May 04, 2015 9:18 am
Forum: Volume 100 (10000-10099)
Topic: 10069 - Distinct Subsequences
Replies: 26
Views: 11572

Re: 10069 - Distinct Subsequences

How can I edit my post? I checked the FAQ and it said that there's a button for editing posts but I can't find it. I want to edit my code above.
I found a bug but it still gets RTE. I want to fix that bug (even though the program still doesn't work, it's still one less bug), but I can't
edit my post.
by oja
Mon May 04, 2015 8:12 am
Forum: Volume 104 (10400-10499)
Topic: 10469 - To Carry or not to Carry
Replies: 24
Views: 10395

Re: 10469 - To Carry or not to Carry

If you've read the early posts, you've already found out that the solution is simpler than what your code seems to do. The problem states that He was doing bitwise addition but his carry bit always had zero output. Now how do you do bitwise addition? 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1 T...
by oja
Mon May 04, 2015 7:14 am
Forum: Volume 100 (10000-10099)
Topic: 10069 - Distinct Subsequences
Replies: 26
Views: 11572

Re: 10069 - Distinct Subsequences

RTE for a few times in a row now. I've tried the inputs in this thread and other inputs using udebug.com and my program got the right results and didn't crash. Please provide more tricky I/Os. If you can help in finding the bug, here's my code:

Code: Select all

Code deleted after AC

Go to advanced search