Блог пользователя ahmed_aly

Автор ahmed_aly, 11 лет назад, По-английски

Edit: Looks like the following outputs are correct, you can use them to judge your solutions (or you can submit your solutions here). Also it looks like many contestants will fail in the last problem, so I guess the cutoff will be 60 points (anyone with at least 60 points will be qualified).

Until Facebook finishes the manual judging, let's compare our solutions against each other. Here are what I think should be the correct outputs for the given inputs, please run your solutions against these inputs and write a comment here and say what your solution agrees with and what it doesn't.

A. Homework

Full input link: https://drive.google.com/file/d/0ByHbOJKKpXM9dEtiSkxZdExXR00/

Full output link: https://drive.google.com/file/d/0ByHbOJKKpXM9Y1Q0dVZvUkRxanc/

B. Autocomplete

Full input link: https://drive.google.com/file/d/0ByHbOJKKpXM9eklueGpLdmh1ZEE/

Full output link: https://drive.google.com/file/d/0ByHbOJKKpXM9TWdMUVo2amJ2RUk/

C. Winning at Sports

Full input link: https://drive.google.com/file/d/0ByHbOJKKpXM9eTU0YVFRSHUyWTg/

Full output link: https://drive.google.com/file/d/0ByHbOJKKpXM9NnhpX2xfOUlJelU/

D. Corporate Gifting (this is not the output I submitted, what I submitted was wrong)

Full input link: https://drive.google.com/file/d/0ByHbOJKKpXM9elVuOVNld3pRMkE/

Full output link: https://drive.google.com/file/d/0ByHbOJKKpXM9SG43c1R3ZHlrWGc/

The above outputs are not guaranteed to be correct, I'll update the post if I found that any of them is wrong.

  • Проголосовать: нравится
  • +58
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I agree on all outputs. Of course I have a history of making stupid mistakes on FBHC.

»
11 лет назад, скрыть # |
Rev. 6  
Проголосовать: нравится +52 Проголосовать: не нравится

I have uploaded the round 1 problems to an online judge.

P1 Homework

P2 Autocomplete

P3 Winning at Sports

P4 Corporate Gifting

I used my own inputs and output as the test data. Please note that the judge is strict and requires the output to be in the exact format as the sample output (i.e. newline after every case, # signs).

Also, the hard memory limit for the problems is 1GB and time limit is 1 minute, which may differ a bit from your local resources.

On the judge, please do not read from file — all input/output is from/to stdin/stdout.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

for the last problem I constructed a directed graph for the given input , nodes — employee ID and edges — directed edge from A -> B if A is the manager of B . Then I ran a simple dfs hitting base cases filling from 1 as least for each nodes to provided least expenditure which is greater than the max value than its sub employees and saved it in a separate array and then accumulated the result which I tested for many cases and runs well for 2*10^5 big cases also and throws a seg fault all of a sudden for 5th case this approach correct ?

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

checked !! all the outputs matched !! :) hope we do not have same bugs :D

it's very unfortunate for me that i could not submit my D for stupid stack overflow problem :( :(. i tried number of ways to increase stack size in 6min but failed :( :(....

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I agree with the outputs here. My first 3 solutions are good, except the last one.

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

1st & 3rd outputs are identical with yours. 2nd output is different. 4th problem hasn't been solved.

you can check differences here... https://www.diffchecker.com/diff

»
11 лет назад, скрыть # |
 
Проголосовать: нравится -45 Проголосовать: не нравится

plus this comment if u have 60 pts

»
11 лет назад, скрыть # |
 
Проголосовать: нравится -40 Проголосовать: не нравится

plus this if u have more then 60 pts

»
11 лет назад, скрыть # |
 
Проголосовать: нравится -40 Проголосовать: не нравится

plus this comment if u have less then 60 pts

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

all outputs match :)

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Found silly mistake in my C. A,B,D matches.

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +10 Проголосовать: не нравится

All matched, except B...

FOR(tc, 1, z) {
   cin >> n;
   nodes_num = 1;
   FOR(i, 0, nodes_num) nodes[i].clear();
   //...

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +61 Проголосовать: не нравится

I've added the round to the Gym: 2015 Facebook Hacker Cup, Round 1. Used inputs/outputs from ahmed_aly. Feeling glad that my solutions passed the tests :-)

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

Thanks for posting this! My A,B,C match (and I already knew my D was wrong).

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +35 Проголосовать: не нравится

Darn, apparently the input wasn't given as a topological sort in D (i.e. parent[i] < i). Am I the only one who thought this?

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is it just me or for the D problem, i found less values than your output...

»
11 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I literally jumped when all my submission got accepted as verdict in the codeforces gym. Then I realized I didn't manage to submit problem B.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Stack overflow caused me 40 points T_T

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Yes match for A to D ;-)

I didn't notice this blog when I upload FBHC problem with my test data to SPOJ. By the way, you can compare your output with mine on SPOJ here.

»
11 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Is it possible for only 50pts to advance? I have made stupid error on question B and C:(

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have submitted the solutions for all the problems, and I have received a tick on all of them on the scoreboard. According to the scoreboard, I have a score of 100. Is this the final score? Or is it possible that some of my solutions may be wrong?

»
11 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Got memory limit exceeded in B. Matches to output given by Ahmed Aly. UPD: Now getting Judgement Failed.