Hello Codeforces Community,
I am glad to share HackerRank's University Codesprint 4 starting on 23rd February 2018. The contest duration is 48 hours.
The winners of the contest will win up to 1000USD cash prizes. The top 100 will also win awesome hoodies. (The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint.)
The contest will be rated. If two person gets the same score, the person who reached the score first will be ranked higher. There will be a separate ranklists for schools.
There will be 7 algorithmic challenges in this contest.
The problems were prepared by Alladdin, prateekg, niyaznigmatul, BishalG, anuj95, wanbo, svanidz1, kevinsogo, xennygrimmato, geek_geek, Wild_Hamster, shashank21j.
Good luck and Happy Coding!
What happened to the prizes from World Codesprint 12
According to the admins, the prizes for WC 12 have started being processed, and people should be receiving them this week.
It's been 1 week, I have neither received an email about the prize nor a response to my support request about prizes.
Has anyone received an email from HR yet?
Not regarding prizes
+
edit: OMG why such downvotes. How can you do this? This is outrageous, it's unfair! /s
Yeah that's how I feel everyday.
I think codesprints should be 5h only (unless there are approximate problems). 48h favours to people that have more free time, also since each university is like a team, there is more time for the spread of solutions among members of the same university (or even country, I know cases about this).
There are universities from all over the world, 5h only is unfair to those whose contest starts at 12am.
At least make it 1 day long.
yes, the current start time is not appropriate. Maybe atcoder usual time is not too late or early for most time zones?
"The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint" I also read that on the site and thought that it is worth asking: if I'm currently enrolled in a high school (not a university), there is no way I could officially take part in the contest (and, thus, be considered for prizes as well), right?
Yes. If you are not in university, you will not be eligible for prizes, but you can still participate.
Wtf is going on with these weird "you need to implement function X an function Y" in statements which makes an impression that this is an "interactive" problem and then showing standard input and output? That's a significant difference.
It's because you're given template C++ (but not C++14) codes which handle I/O for you.
I didn't see any functions in my templates. I checked them but there was only a standard hello world or something. And I think that requiring coding persistent tree instead of typical one for the profit of not handling I/O is a pretty bad tradeoff.
Template code for language C++ for the first task:
Funny, for me it was "hello world" everywhere. But either way, firstly describing these functions and then describing input and output was confusing. I was already wondering where can I copy some persistent tree from in E because I thought this is whole point of existence of these functions.
There's something wrong with G's checker.You don't check whether the sum of columns and rows the participant's program chooses equals to the answer the participant's program gives. I can work out the answer and simply choose all the rows and columns to get it accepted.
Does it really make a difference? I don't think anyone who solved an "expert" problem would get WA after fixing the checker.
Well,I will.I just described how I get AC on Problem G.
Never mind, I misread.
"The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint."
If not all of the participants in top 100 are currently enrolled in university than will hoodies get passed to participants whose rank is above 100?
Can someone confirm this? :P My rank on the student leaderboard is 102 and I found 2 people above me who are in one of the countries where prizes aren't allowed due to legal restrictions.
I guess many of the top 100 won't be enrolled in any college currently.
Ehm, I might sound a bit rude, but problem C aka Two Kings is absolutely disgusting. Was that supposed to be funny or sth?
I think it's what Halim tags in CP3 as "Time-Waster Problem" :/
Well, the country is terrible with Two Kings :)
And three queens :D
It was the reason for me, to not join this contest. I did not want to waste my time on this.
Who else feels like crying after seeing a chess problem on HackerRank ?
It seems that the issues with G's checker haven't been fixed till now.Do you really want to leave the issue till the end of the contest? I'm sure some accepted submissions will fail after you fix the checker(my first submission as an example).
lol what do you expect of hackerrank? there are bad checkers, lazy editorialists, and tedious problems.
if they continue giving chess problems then HR will go bankrupt
In two king's problem i believe there is an issue with the checker. The sample output differs from the expected output, well i tried to submit either ways:first describing the positions of the black pieces and second i only printed the minimum no of black pieces and not the positions. Both the ways sample test case is showing wrong answer. Please help if anybody else was facing the same problem !
Finishing 101 feels like an absolute win :D
My hate to chess kings has grown.
99 after the plagiarism check, congrats :)
OOOH Now it's the absolute win redoubled :D
feedback:
A. Trivial
B. The c++ template that you provide (that reads input) doesn't work, it gives Abort Called.
C. Probably many people hated this problem. Also it was confusing that according to the checker the correct answer of the sample case is only 3 2 (without the positions of the queens). However I think it was not that bad (maybe I'm biased because I like chess :) ), but at least we have to guess/prove that knights are not necessary.
D. standard suffix array problem.
E. standard (and easier than D), actually is a simple variant of spoj DQUERY
F. nice data structure problem. Few people solved it during the first day, so I think it was ok.
G. another standard problem (and easier than F), I've seen it in codechef, some icpc regional and I think that even on hackerrank!
Regarding scoring: Partial score is unfair, shitty optimizations get some additional points. It should be full points for full subtasks.
TL;DR In general, the round looks more like an educational round. IMHO so far, the best round on hackerrank was the first world code sprint, ...now the frequency of contests and quality is decreasing.
Could you please elaborate on F? I managed to get the partial solution for F where n ≤ 4000, but couldn't move any further.
Yes, please elaborate the approach for F (Magic Value) because the editorial is not available for that problem. The explanation in the editorial section is actually for the previous problem.
I give some hints in the last part of my post https://aleigorithms.wordpress.com/2018/02/25/hackerrank-university-codesprint-4/
I will try to explain my idea.The main intuition behind my idea was convex hulls or may be convex hull trick (I appreciate if someone can give some direct solution using either of them as blackbox). Skipping easier parts the key problem is max (k-i)b[k].for each subarray starting at index k. sum over such things.
lets denote val[i]=(i-k)*b[i].
So some key observations:
1. if k1 < k2 and val[k1] >val[k2] then there is no point in considering k2 in further queries.
2. And also above property is transitive.
So now we maintain data regarding cross overs of adjacent essential points and update them according based on the data. And to be noted is each update must remove one element from keynote list.
To the updates part a seg tree will work with range overwrite operation.
Did Mo's algorithm pass for E? I had to go offline.
Yes, mine passed with max. time 1.15s
I was convinced it would tle so I just did Fenwick tree instead
Yes! It has worked for me!
D can also be solved using rolling overflow hashing.
Wow, the tasks were so poor I can't even... Only F was kinda interesting, but seriously, does anyone think that E could be original? I've seen that so many times. G was a failure as well, so standard I couldn't believe my eyes when I read that this is supposedly the hardest problem. Ugly C as well. But won 500$, so at least I earned something for the cost of wasted time :p.
Can you give me insight on how to construct the bipartite graph in G(I don't really understand from their editorial) or another editorial that explains a similar problem ? Thanks !
Let the set of vertices on the left represent row, and the set of vertices on the right represent column. If there is a cell (x, y) that is painted, connect x on the left with y on the right. What we need to find now is the minimum vertex cover of the constructed bipartile graph above.
Oh yea, that seems so easy now. Thanks !
For me both tasks were new, I know there is another similar on Internet , but still they were pretty easy. When I read 5th task, first I wrote Fenwick tree and then start solving task :D
P.S. Will someone regrade last task ?
How to solve Unique Art?
You can use MO's algorithm to solve that question.
I used but got TLE!
because you probably used a map, you need to convert numbers from -1e9,1e9 to 0,1e6 and use an array instead.
Well, this mo should run in , how does it fit into the time limit? :D
This is my solution using MO's.
Refer to DQUERY solution using BIT here.
For this question, ans= Number of distinct elements in range — Number of elements having L[A[i]](last occurence) within the range.
Shall we still expect to receive hoodies?
Have anyone received the hoodie yet?
Nope :(
Haven't even received information about hoodies from HourRank 26, which was 10 weeks ago.
I have received it (to Lithuania).
Did you receive any email from Hackerank after the end of contest?
Yes, for claiming the hoodie. It was on 16 March.
I got 3rd rank, and I waited some message happily and excitedly (^_^).... and 3 months have passed (;_;). Can I get prize? (EDIT : This is my foolish mistake. Please ignore me.)
That's interesting. I got second place and was contacted pretty quickly by a really responsive woman. Maybe that's the country that somehow makes the difference? Dunno.
I recheck the my mailbox and found mail. I'm terribly sorry for hackerrank .... thanks swistakk
I have got 65th place and still did not any e-mail or any answer about the champion hoodie. Can I get the hoodie? :)
Asking again
Finally have got my hoodie today, thanks!
I just want to ask: does contestant with rank in top 100 in student scoreboard (but rank > 100 in overall scoreboard) win a T-shirt? I was in top 100, but got no new regarding my hoodie.
My rank is 85 in the student leaderboard and 102 overall. Can I expect to get a hoodie? I have not received any email yet.
I want to say that I received my hoodie today! Thanks for it!