Search found 48 matches

by red_apricot
Thu Oct 15, 2015 5:31 am
Forum: Volume 10 (1000-1099)
Topic: 1042 - Lots of Sunlight
Replies: 0
Views: 776

Re: 1042 - Lots of Sunlight

Getting lots of WA... /* * 1042. Lots of Sunlight * TOPIC: trigonometry * status: */ #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define pi (2*acos(0.00)) #define tol 1e-7 #define N 0x80 #include <float.h> #define oo (DBL_MAX-0x400) long double mi...
by red_apricot
Tue Oct 13, 2015 12:28 pm
Forum: Volume 113 (11300-11399)
Topic: 11325 - This Means War!
Replies: 5
Views: 3358

Re: 11325 - This Means War!

The judge I/O is incomplete. For example, for input

Code: Select all

1
3S 7H KD 4S 6S AD 7D 4C AS JD 2H 3C 4H 2C 7C AH 5S 2D 6C 8S AC 5C 7S KS QC TD
my Accepted program outputs "no", but uvatoolkit yields "yes".
by red_apricot
Mon Oct 12, 2015 5:10 am
Forum: Bugs and suggestions
Topic: 11793 - Electoral Districts, bug in problem statement
Replies: 1
Views: 4210

Re: 11793 - Electoral Districts, bug in problem statement

The judge I/O must be weak/incomplete, albeit correct. For one, for input 5 617 17 345 931 482 332 71 810 842 87 414 761 622 290 883 733 416 601 467 673 712 195 44 828 77 393 635 122 839 600 588 275 604 379 127 384 850 89 982 158 50 715 573 333 867 253 264 556 218 695 the answer is 5; but udebug giv...
by red_apricot
Thu Sep 03, 2015 4:44 am
Forum: Volume 5 (500-599)
Topic: 592 - Island of Logic
Replies: 7
Views: 5488

Re: 592 - Island of Logic

Is JavaScript engine allowed on UVa? I'm getting RTEs with the following: /* * 592. Island of Logic * TOPIC: * status: */ import java.io.*; import java.util.*; import java.util.regex.*; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; cl...
by red_apricot
Sun Aug 30, 2015 12:12 pm
Forum: Volume 104 (10400-10499)
Topic: 10448 - Unique World
Replies: 8
Views: 3715

Re: 10448 - Unique World

OK, any help on how to convert the below TLE to AC is appreciated... /* * 10448. Unique World * TOPIC: dp * status: */ #include <cassert> #include <cstdio> #include <algorithm> #include <cstdlib> #include <cstring> #include <cstdlib> #include <iostream> #include <cmath> #include <vector> #include <s...
by red_apricot
Sun Aug 23, 2015 11:48 am
Forum: Volume 115 (11500-11599)
Topic: 11509 - Touring Robot
Replies: 8
Views: 1827

Re: 11509 - Touring Robot

I believe there are test cases with n > 1024, I got AC when I changed my N from 0x400 to (1<<20).
by red_apricot
Fri Aug 07, 2015 5:22 am
Forum: Volume 118 (11800-11899)
Topic: 11815 - Ideas
Replies: 0
Views: 2445

Re: 11815 - Ideas

Hm, if I understand the problem correctly the sample output should be

Code: Select all

1
0

because a packet uses the arc 2-->1 it must already have passed through the vertex 1, i.e. the vertex 1 is not "new person".
by red_apricot
Sun May 17, 2015 8:19 pm
Forum: Volume 113 (11300-11399)
Topic: 11335 - Discrete Pursuit
Replies: 15
Views: 5668

Re: 11335 - Discrete Pursuit

OK, let's say we can find the largest non-negative integer n such that n*(n+1)/2 <= a + n*u. That is, we come close to the robber in such a way that the next jump gets the cop ahead of the robber. What next? I see it has to be greedy in some way.
by red_apricot
Fri May 15, 2015 11:03 am
Forum: Volume 105 (10500-10599)
Topic: 10537 - The Toll! Revisited
Replies: 27
Views: 9959

Re: 10537 - The Toll! Revisited

OK, got AC, never mind my previous posts.
by red_apricot
Thu May 14, 2015 8:13 pm
Forum: Volume 105 (10500-10599)
Topic: 10537 - The Toll! Revisited
Replies: 27
Views: 9959

Re: 10537 - The Toll! Revisited

This is my updated code. Now I compare two paths explicitly. On random tests the output is identical to that of udebug.com. Still WA. BTW we no longer can edit/delete out posts? /* * 10537. The Toll! Revisited * TOPIC: dijkstra, binary search, comparison function, binary heap with update, printing t...
by red_apricot
Wed May 13, 2015 5:04 pm
Forum: Volume 105 (10500-10599)
Topic: 10537 - The Toll! Revisited
Replies: 27
Views: 9959

Re: 10537 - The Toll! Revisited

I'm pretty sure my code is fine, but it gets WA. I've solved the "original" live-archive counterpart, but this one... /* * 10537. The Toll! Revisited */ #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #define N 0x80 #define Q (2*N) #define xchg(x,y) ...
by red_apricot
Tue May 05, 2015 3:33 am
Forum: Volume 1 (100-199)
Topic: 135 - No Rectangles
Replies: 24
Views: 4403

Re: 135 - No Rectangles

I'm trying to take in the "finite field & cyclic permutation" approach to this problem. OK, so let's identify each number t from 0 to (k-2) by a cyclic permutation x -> (x+t)%(k-1), or, rather, with its matrix representation. For example, the cycle (0 1 2) has representaion 0 1 0 0 0 1 1 0 0 Secondl...
by red_apricot
Sat Mar 14, 2015 12:27 pm
Forum: Volume 12 (1200-1299)
Topic: 1229 - Sub-dictionary
Replies: 17
Views: 8309

Re: 1229 - Sub-dictionary

// if scc has no incoming edges or its size() is > 1 then put in to the result vector This logic may be flawed, e.g for the case 3 a b c c b the output is all three words. All in all, the following two are crucial test cases (just got AC): 10 a b b c c a d c e d f g e i f g h d i h j i 10 a b b c c...
by red_apricot
Thu Mar 12, 2015 11:40 am
Forum: Volume 109 (10900-10999)
Topic: 10972 - RevolC FaeLoN
Replies: 10
Views: 4939

Re: 10972 - RevolC FaeLoN

Certainly an amazing problem: so simply formulated yet conceptually rich. Now I've got a questions: are there duplicate edges? i.e. can (x,y) be listed twice? I know in that case we would simply merge x and y and consider them as one vertex, but that would only lengthen the code. --Thanks! EDIT: Che...
by red_apricot
Thu Feb 26, 2015 12:19 pm
Forum: Volume 11 (1100-1199)
Topic: 1161 - Objective: Berlin
Replies: 2
Views: 1480

Re: 1161 - Objective: Berlin

OK this is a Yes/No question: Is this a maxflow problem? It is odd that it can potentially have so many vertices then.

Go to advanced search