Search found 122 matches

by Zyaad Jaunnoo
Wed Feb 21, 2018 5:09 pm
Forum: Volume 119 (11900-11999)
Topic: 11960 - Divisor Game
Replies: 19
Views: 4912

Re: 11960 Divisor Game Getting WA!!

Faithkeeper_Rangwan wrote:
Fri Jul 11, 2014 4:17 pm
I don't think this problem even need to use prime factorization.
I modified the sieve of Eratosthenes to count the number of divisors for all N <= 1,000,000.
by Zyaad Jaunnoo
Wed Feb 21, 2018 4:14 pm
Forum: Volume 122 (12200-12299)
Topic: 12293 - Box Game
Replies: 2
Views: 1094

Re: 12293 - Box Game

Repon kumar Roy wrote:
Fri Nov 28, 2014 3:50 pm
My question is State (2,2) , can player give valid move , because no box with fewer items..
Please Clearify
Simulate the game using the minmax algorithm and you should see a pattern..
by Zyaad Jaunnoo
Tue Jul 04, 2017 3:11 pm
Forum: Volume 116 (11600-11699)
Topic: 11615 - Family Tree
Replies: 1
Views: 1182

Re: 11615 - Family Tree

jichen1234 wrote:
Thu Oct 23, 2014 9:14 pm
I can't solve this. It's too unethical. :evil:
What do you mean?
I think it is a nice problem..
by Zyaad Jaunnoo
Mon Apr 03, 2017 2:12 pm
Forum: Volume 130 (13000-13099)
Topic: 13066 - Ant-Man's Sugar Journey
Replies: 0
Views: 723

13066 - Ant-Man's Sugar Journey

Hello there,

What algorithms did you use to solve this problem?

My idea was to build a DAG out of strongly connected components and then traverse the graph from the entry till the exit node while keeping track of the vertices being visited. But WA..

Any guidance on this problem?

Thanks!
by Zyaad Jaunnoo
Tue Feb 28, 2017 2:16 pm
Forum: Volume 114 (11400-11499)
Topic: 11489 - Integer Game
Replies: 9
Views: 3599

Re: 11489 - Integer Game

ssavi wrote:Why It is Getting WA?? I have Checked All The Tests of Samples , uDebug and OJ Borads . All are Ok . But I am getting WA .
.
.
Your code is almost correct.. But, you missed a "break" statement when picking a move.

INPUT

Code: Select all

1
2354456456587544678986756467889867
OUTPUT

Code: Select all

Case 1: S
by Zyaad Jaunnoo
Tue Sep 13, 2016 10:42 pm
Forum: Volume 125 (12500-12599)
Topic: 12544 - Beehives
Replies: 1
Views: 1149

Re: 12544 - Beehives

I am using "normal" dfs for this problem. I number each node and when I hit an already visited node, I get the number of nodes in the cycle by the difference of their ids + 1. But WA :( Any catch? Below is my code. Thanks for your help. #include <bits/stdc++.h> using namespace std; const int MaxN = ...
by Zyaad Jaunnoo
Sun Jul 17, 2016 6:54 am
Forum: Volume 105 (10500-10599)
Topic: 10507 - Waking up brain
Replies: 22
Views: 13797

Re: 10507 - Waking up brain

How can this input be correct? 8 16 XYZ ZA AX BY BZ CX CY DZ YD XE ZE XY YZ ZX EF CA BD It says 8 slept parts but the connections (letter pairs) shows that there are 9 (9 different letters) parts. What should I do with this kind of inputs? Should I work with the first 8 letters and forget about awa...
by Zyaad Jaunnoo
Sat Mar 26, 2016 11:26 pm
Forum: Volume 119 (11900-11999)
Topic: 11933 - Splitting Numbers
Replies: 3
Views: 3006

Re: 11933 - Splitting Numbers

C++ function __builtin_ffs(x) was very handy for this problem. Used it to get the position of the least significant bit of an integer.
by Zyaad Jaunnoo
Mon Feb 08, 2016 9:40 pm
Forum: C
Topic: Presentation Error ??
Replies: 3
Views: 14416

Re: Presentation Error ??

Rahul007, your solution is for what problem number on UVA Online Judge?
by Zyaad Jaunnoo
Mon Feb 08, 2016 8:23 pm
Forum: Volume 125 (12500-12599)
Topic: 12507 - Kingdoms
Replies: 1
Views: 1106

Re: 12507 - Kingdoms

Using a bruteforce approach to solve this problem was enough. 2^n sets of towns to be connected using MST and keeping the best configuration, which is the cost <= K and the configuration having the most number of connected people. This took around 0.103s. As I can see runtimes of 0.03s as well, what...
by Zyaad Jaunnoo
Fri Jan 29, 2016 6:36 pm
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 18115

Re: 573 - The Snail

juan321 wrote:I have problems with some cases Help D:

success on day 4
failure on day 3
failure on day 7
failure on day 68
success on day 21
failure on day 1
Hello Juan,

Can you please post your code?
by Zyaad Jaunnoo
Wed Jan 13, 2016 4:04 pm
Forum: Volume 1 (100-199)
Topic: 162 - Beggar My NeighBour
Replies: 3
Views: 1400

Re: 162 - Beggar My NeighBour

When you output the number of cards in the winner's hand, it should right justified in a field of width 3 (specified in the problem statement).

PS: Please do search the forum for an existing post about a problem before creating a new one.
by Zyaad Jaunnoo
Wed Jan 13, 2016 3:45 pm
Forum: General
Topic: Suggest some easy problems to solve
Replies: 12
Views: 12192

Re: Suggest some easy problems to solve

sarwanov wrote:can you suggest me some easy problems to solve please???
Some easy problems are categorised on the online judge website:
https://uva.onlinejudge.org/index.php?o ... tegory=605
by Zyaad Jaunnoo
Wed Dec 30, 2015 2:25 am
Forum: Volume 106 (10600-10699)
Topic: 10603 - Fill
Replies: 19
Views: 8031

Re: 10603 - Fill

brianfry713 wrote: I also keep a bool array of size 201*201*201 that tracks if a state has been visited, initialized to all false.
In fact, only an array of size 201*201 is sufficient to keep track of the visited states.
by Zyaad Jaunnoo
Tue Nov 17, 2015 5:20 pm
Forum: Volume 129 (12900-12999)
Topic: 12911 - Subset sum
Replies: 4
Views: 5059

Re: 12911 - Subset sum

What is the output for this input?

Code: Select all

40 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
On uDebug, the output is:

Code: Select all

1099511627775
Shouldn't it be?

Code: Select all

40

Go to advanced search