Recent actions
On iroroRegexp of divisibility by 3 :), 93 minutes ago
Created or updated the text
0

oh..

Created or updated the text
Created or updated the text
On mostafa_fahimSubmission Error, 25 hours ago
0

I think every thing is ok now,

On mostafa_fahimSubmission Error, 25 hours ago
+3

I also have the same problem using Java.

On mostafa_fahimSubmission Error, 26 hours ago
-1

I have the same problem on Python)

On mostafa_fahimSubmission Error, 26 hours ago
+3

no , um using java

On mostafa_fahimSubmission Error, 26 hours ago
+3

Are you using Python on this problems?

On mostafa_fahimSubmission Error, 26 hours ago
Created or updated the text
On imslavkoUSACO 2012 Feb. Contest, 28 hours ago
Created or updated the text
On arpit_sRe : Precision Issues, 30 hours ago
0

No. You must use epsilon to compare doubles. x >= y -> (x > y || fabs(x - y) < 1e-9).

On arpit_sRe : Precision Issues, 34 hours ago
0

Hi,

In http://codeforces.com/submissions/arpit_s

1st solution from top 1144453 gives correct answer — here i am accumulating total distance and calculating time from that.

4rth solution from top 1144243 gives Wrong answer — here i am accumulating total time and calculating distance from that. It gave WA where my answer differed from actual solution by 1. If precision issue is there, then it should be in both cases, isn’t it ?

0

Thanks.

0

Oh, I got it. Thanks! :-)

0

Greedy will not work. Do as Alias said – just try all possibilities :)

+1

just check all possible I and J, such that we take I books from left, and J books from right. Look at my solution

On arpit_sRe : Precision Issues, 47 hours ago
+3

It is better, to provide link to your solution with accumulated time

I was stuck on how to calculate the best possible answer for breaking K dishes at row R. Could you tell more about it? It just came to my mind that a greedy approach would be enough.

On arpit_sRe : Precision Issues, 2 days ago
Created or updated the text

printf("%0.10lf\n", (double)res);

Your blog seems to be nice. It looks like you give explanations of problem solution in all the details. Well done! Go on in the same way!

On sskolotTag search in problemset, 2 days ago
Created or updated the text
Created or updated the text

Thanks a lot! Very actual theme for me. As additional, read interesting articles about problems solving

It would be nice if contests that I virtually participated in is highlighted :)

i usually use printf ("%lf", (double)ans);

Thanks a lot! Got it accepted now :)

Created or updated the text
-13

well.

… or down

I think that is a bad idea wich all problems with same value because no incentive make problems with more complexity and this is the award for greater ingenuity.

On MikeMirzayanovCormen Medal 2011, 3 days ago
Created or updated the text
On islam-al-aaragAnnouncements, 3 days ago
+1

I was kinda seeking an explanation not just saying what is on my mind, otherwise I’d have tweeted it :D

i clear gap in this statement i think there is another problem ~~~~~ if(discoverEscape != 0 ){draconHaveRun =0; discoverEscape–; } ~~~~~

yes , dragon and princess don’t run at same time , there is time gap of t seconds

-18

Ratings up

Only the first and the third places were. Their codes were almost identical. The second finisher’s (the winner now) codes seemed to have slight modifications but this is not for me to judge. It is up to administration.

For problem B, when i was accumulating the total time, i am getting WA, but when i am accumulating the total distance, and then calculating time from that it is getting accepted, can anyone reason out the problem ? Precision issues should be in both cases. :-o

dragon and princess run at same time

princessHaveRun += princeseSpeed; draconHaveRun += DraconSpeed;

if you mean this

I think they were just disqualified.

Codeforces has problem with %Lf modifier i think, you have to use cout to print long doubles as far as i know

+12

Anyone noticed how similar Top 3 finishers codes are?

I am not sure about this . But looking into your code it seems that for the first time when the princess is running ,,, the dragon will only run after spending time t ,,,

You have made it to run immediately . I am not good at english but I think that you understood me ,,if not I will retry

+12

Ratings?

Please dont write the whole code in a comment .You can give its link here. Secondly please mention the problem number although it seems obvious after reading the code

-10

i spend like hour on this simulation every time it gets wrong answer on test 4 my answer is 21 and correct answer 22

100
10
10
739

can’t figure out whats wrong with this code :( can anyone help?

import java.util.Scanner;


public class Test {
	public static void main(String[] args) {
	    Scanner in = new Scanner(System.in);
	    int princeseSpeed= in.nextInt(); int DraconSpeed = in.nextInt();
	    int discoverEscape = in.nextInt(); int fixTreasureTime = in.nextInt(); 
	    int wholeTime = in.nextInt();
	    
	    int numberOfbijous = 0;
	    int princessHaveRun=0; int draconHaveRun=0; int numberOfDeley = 0;
	    for(int i=0; i<wholeTime; i++){
	    	princessHaveRun += princeseSpeed; 
	    	draconHaveRun += DraconSpeed;
	    	if(discoverEscape != 0 ){	draconHaveRun =0; discoverEscape--; }
	    	if(numberOfDeley != 0 ){	draconHaveRun =0; numberOfDeley--; }
	    	if(princessHaveRun >= wholeTime) break;
	    	if(princessHaveRun <= draconHaveRun){
	    		numberOfbijous++;
	    		numberOfDeley += fixTreasureTime;
	    		if((draconHaveRun)%DraconSpeed == 0){
	    			numberOfDeley += ((draconHaveRun)/DraconSpeed);
	    		}else{
	    			numberOfDeley +=(draconHaveRun/DraconSpeed + 1);
	    		}
	    		draconHaveRun = 0;
	    	}
	    	

	    }
	    
	    System.out.println(numberOfbijous);
	}
}

Really long time

Actually the princess would exclaim a wow when she see’s a[1]=3.In fact if b=0 and a=n-1 and n>1 then always it is -1 beacuase a[1] has to be a value <= a[0] (to avoid a wow)

Oh, yes. So silly, thank you very much !

poor guy :(

3 —> “wow”

3 after 2 causes “Wow” :)

Can some please explain me why for task C, these test case 10 9 0 gives -1. I thought that solution for this could be 2 3 4 5 6 7 8 9 10 11.

How much time approximate it takes to update the new ratings

Very interesting. Thanks.

AntiChernega got 48 wrong hacks! in my room. Though he solve 3 problems, he ended up with 200 points approximately.

You should consider two things a) At which row you are b) How many remaining cracks you have

At each step you should try all possible ways to break some porcelain (which is about 100 * 100 possibilities, considering all possible from the left and all possible from the right). Since this becomes O(N * M * 100 * 100) algorithm, which is rather heavy, you should pre-calculate the best possible answer for breaking K dishes at row R. Now all operations at a given row and given remaining cracks can be calculated in O(100), giving overall complexity of O(N * M * 100), which is okay.

omg, I was typing inclusing/exclusing formula for A for 3-4 minutes and was stunned, when saw that someone wrote simple 1..d loop for 1 minute :D

Oh,yes.Corrected that and it got accepted.Silly mistake :( Thanks anyways for pointing that out

Nickolas , thank you for the contest. I like it.

On islam-al-aaragAnnouncements, 3 days ago
Created or updated the text

Anyone want to share recurrence for E as well please…

if(a==n-1 && a > 0) return -1;
+12

All problems with same value doesn’t make any sense. Problem A (loop with % operation) can’t have the same value as E which is a DP with caching. A guy who solved A can outweigh another solved E(obviously) in less time.

i solved it that way and it passed, so i guess it was

+14

Really liked the problem statements! Also, the problems were interesting (however, for me C was way harder than D and E, which were rather standard). Also, my opinion is that giving the same points to all problems (especially if their value is 1000) is TERRIBLE idea. Imagine that a person solves all 5 problems (and nobody else does, the fifth one is quite hard). Then he is beaten by a person with 8 or 9 successful hacks, who just was in a lucky room where nobody else tried hacking. I don’t believe this would represent the best coder in the contest at all.

Once again python failed me on a simple O(n^2) dp, n around 1000. When will I learn… Or Codeforces give me a little more time..

Seams like you fail on n=1 like I did. (Test case 6)

Thanks

p(w,b) = w/(w+b) + b/(w+b)(1-d(w-b))

d(w,b) = w/(w+b) + b/(w+b)*(1-(w/(w+b-1)*p(w-1,b-1)+(b-1)/(w+b-1)*p(w,b-2))

First of all congrats to the author for such a logical and thinking contest. My C algorithm gives me wrong answer.Please tell me where am I wrong.Here’s the algorithm: if(a=n-1) return -1; a[0]=2; if(b==0) a[1]=1; else a[1]=3; for the left number of wows-> a[i]=2*a[i-1]; for the left oh's-> a[i]=a[i-1]+1 for the left places-> a[i]=1;

I believe it’s something like this:

Call pp(w,b) the probability that the princess wins when it’s her turn to pick and there are w white and b black mice in the bag, and pd(w,b) the same probability when it’s the dragon’s turn to pick. Then:

pp(w,b) = w/(w+b) + b/(w+b) * pd(w,b-1)

and

pd(w,b) = b/(w+b) * (w/(w+b-1) * pp(w-1,b-1) + (b-1)/(w+b-1) * pp(w,b-2))

Base cases: pp(0,0) = pp(0,1) = 0, pp(1,0) = 1 pd(0,0) = pd(0,1) = pd(1,0) = pd(1,1) = pd(2,0) = pd(0,2) = 0

(EDIT: actually pp(0,x) = pd(0,x) = 0 for all x, since without white mice the princess will always lose)

Was E , a dp + a knapsack (which is also a dp) ?

+10

I think this accident was my fault(my netbook isn’t that good, and firefox can kill it easily), but Mike said, they will be removed.

Actually, your idea is great.

-15

As for me, this problem is second by it’s difficulty.

Very interesting. I support your plea. May be codeforces should put a check in place to see if the same exact test has been tried as hack by the same user, and not allow it. Just like resubmission of the exact same solution to a problem is rejected.

Was I the only one who found the wording for problem D a bit confusing?

I think it was a DP problem. What was the recurrence, anyone?

hmm, I have 22 failed hacks. It’s due to my browser was non responding, can you remove wrong hacks? You can see, they are all at same time(almost all);

Problem E: Porcelain is contributed by MikeMirzayanov’s

+12

No. Only the fairy tales are in russian :)

are these problems just in Russian?

According to the number of votes I got in the first comment, will you take it into considerations?

On simp1etonAccess to full testcase, 3 days ago
Created or updated the text
On EgorCHelper manual, 3 days ago
0

I too faced the same problem in 531 Div2 -250.

only in russian version of the post

-13

The link is in the post.

You wrote fairy tales? Cool!!! Can you tell me some of yours? I really like fairy tale.

This timing (20:00 Moscow Time) for contest is very good for me. If it is possible to continue this timing in next contests I will be grateful. (Hope that this timing does not delay the Dinner for Russian people. )

+18

All problems with same value, were you guys inspired by the current Facebook Hacker Cup? ;)

On EgorCHelper manual, 3 days ago
0

I’ll look into it

On EgorCHelper manual, 3 days ago
0

To Egor,

Your plugin have a few “bugs” with Topcoder SRM Task :D. I’ve used it on SRM 530 and 531 and found some issues :D

  1. CHelper can’t “parse” the task. When I open a task, there is only moj created code file and it isn’t parsed into CHelper’s TopCoder Task. I had this issue with task UnsortedSequence (SRM 531 — Div 2 — 250 Task), another tasks just work fine :)

  2. Wrong example input/output parsed. I’m not sure it’s CHelper’s problem or just moj’s :-?. Had this issue with task GogoXCake (SRM 530 — Div 2 — 500 Task), another tasks just work fine :)

Just a “report” for you :D, hope you will see and fix them soon :D

Again, thanks for such an useful plugin :D

I’m impressed, the timelimits for java seem very fair. When did this change? (In cookoff11 I TLE’ed on the easy problem but converting to c++ ran in .01 seconds)

Thank you brother.

I think it will be 4 points per minute, and the minimum score will be 300.

How many points will be deducted after each minute passed for each problem?

+54

I prefer if the problems are not sorted, just randomly shuffled.

I think sorting the problems will ruin the experiment, just tell us after the contest what was your estimated difficulties, and see how correct is it.

Created or updated the text
On MikeMirzayanovCodeforces Markup, 4 days ago
-7

Don’t get the urge to reinvent wheels. bbcode is well tested and universal and known to work in comments including code sites. Random wiki markup comes with such complications. Imagine a problem required me to explain something like: http://pastebin.com/7ybg21rP

If I just type the ascii art here, it will look like this: .. .... ....

The discussion is over and the result is to keep the article.