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

Автор junkbot, история, 9 лет назад, По-английски

Hi Everyone!

This year Australia is hosting the Asia-Pacific Informatics Olympiad (APIO). Since the official contest window is about to end for contestants, the APIO 2017 Open contest will begin soon! Everyone is invited to participate, and would be good practice for IOI-eligible students.

The contest has a similar format to the IOI, having 3 tasks over 5 hours and will be hosted on the CMS Contest Management System at contest.apio17.org. The contest will be run in two separate windows, each having the same set of problems as the official contest.

  1. Window 1 begins UTC+0 15.00, Monday, May 15
  2. Window 2 begins UTC+0 11.00, Tuesday, May 16

Please note that these times have been pushed back by 24 hours from what was originally advertised on our website.

The supported languages are C11, C++11 and Pascal only. Task statements will be available in English, Chinese (Simplified), Chinese (Traditional), Hebrew, Bahasa Indonesia, Japanese, Korean, Mongolian, Persian, Russian, Thai, Turkish and Vietnamese, with many thanks to the leaders of the respective delegations for providing task translations. Detailed rules for the contest can be found on the contest website http://apio17.org/competition/rules/. Unfortunately, clarifications will not be available during the open contests.

If you would like to participate, please register using the Registration Form. Registration for each contest will close two hours prior to the start of the contest. Update: Once registrations close, you will be emailed a username and password to use to log in to the contest site. Please check your email before the contest begins!

To ensure that each contest is fair, we kindly ask all participants to refrain from discussing the problems until the end of the second open contest window. Update: As a result, please do not participate if you have already competed in the official contest. If you did compete and have already registered, please don't login and compete on the contest system. If you are still competing in the open contest, please only participate and register for one of the two contest windows. Thank you for your co-operation.

Looking forward to your participation!

APIO 2017 Organising Committee

Update: Window 1 registration has closed. Please check your email for login details. The contest site is up and the contest will begin in under two hours' time! Best of luck for the contest.

Update: Window 2 registration has closed. Please check your email for login details. The contest site is up and the contest will begin in under an hour's time! Best of luck for the contest.

Update: The official English problem statements, testdata, contest materials (checkers, graders etc.) and solutions have finally been posted on the official website and also on the APIO website. We apologise for the long delay.

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

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

Are we supposed to receive an email with information regarding our accounts immediately after registering? Or about an hour before the contest or something like that? I'm asking because I've just registered and I haven't received anything.

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

Auto comment: topic has been updated by junkbot (previous revision, new revision, compare).

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

Link to contest.apio17.org is broken, it redirects to codeforces.com/blog/entry/...

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

Are official participants allowed to participate in this ?

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

Auto comment: topic has been updated by junkbot (previous revision, new revision, compare).

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

I think I accidentally registered for the wrong window. If I don't participate/log in, am I allowed to register for the second window?

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

Auto comment: topic has been updated by junkbot (previous revision, new revision, compare).

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

You can submit at most 30 solutions during this contest.

Is this per problem, or whole contest?

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

can anyone access the contest website?

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

Can we ask questions??? As there are some unclear things in the problem statements.

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

Auto comment: topic has been updated by junkbot (previous revision, new revision, compare).

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

Why, when submitting a solution, it only displays the result of a test. The id is changing, so I assume that there is more than one test per subtask but only one is shown? Is that right?

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

I don't have much time to code, but here are my ideas for the two regular problems:

  • rainbow: number of connected components in a submatrix; place "external" river cells around that submatrix, then the answer is v + e + 1 by Euler's theorem, where v is the number of river cells (vertices) and e the number of pairs of adjacent river cells (edges) — v is just submatrix sum, doable using compressed segment trees (IOI 2013 Game) or more simply in time, e is the same for summing up degrees of vertices, then we need to subtract edges going out of the submatrix and add the number of vertices on its border (adjacent to the external vertices)

  • merchant: binsearch the optimal ratio — for ratio r, compute in O(N2) with O(KN2) precomputation the maximum value of (profit by possibly buying at i and selling at j minus r * distance from i to j) for all i, j, then exponentiate that matrix until a non-trivial cycle gives a diagonal value  ≥ 0; time complexity: , where T is the min. number of trades necessary to get the optimal ratio

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

This is how I solved Merchant (P2).

Let's look at the optimal solution. It starts at some city R, visits several cities, possibly buying and selling at intermediate cities, and returns to R. There are a few observations to make before we proceed:

  • If we buy an item at node B and sell it at node S, then we must take the shortest path from B to S to maximize efficiency. This will be useful later on, so we can precompute dist where dist[i][j] denotes the shortest path from i to j in our original graph. This precomputation takes O(n3).
  • If we buy an item at node B and sell it at node S, we will buy the item which maximizes profit to maximize efficiency. This will also be useful later on, so we can precompute profit where profit[i][j] denotes the maximum profit we can achieve if we buy an item at node i and sell it at node j. If no profit is achievable, profit[i][j] = 0. This precomputation can be done trivially in O(n2k) by iterating over all k items for each (i, j) pair.

Now, let us fix the efficiency we want to achieve. Suppose x is our desired efficiency. We can check if x is feasible using the following procedure:

  • Construct a new adjacency matrix adj, where adj[i][j] = profit[i][j] - dist[i][j] * x. Additionally, define adj[i][i] =  - ∞.

  • Our answer is YES iff there exists a closed walk with a nonnegative sum in adj. We can check this in O(n3) using Floyd-Warshall. Note that you should deal with the case where a positive cycle occurs in adj explicitly, as well as handle annoying overflow issues.

Intuitively, the check() function is looking at our optimal solution in chunks. We are essentially decomposing our optimal walk into individual transactions. One edge in adj corresponds to one transaction. This is useful because when we fix the start and end points of one transaction, we automatically fix the path and item that we need to buy, and are able to reduce the problem to a tractable one.

Finally, it is clear that we can binary search on x, to end with a solution of complexity O(n3log(A) + n2k), where A is the maximum efficiency possible.

Full-Solution in C++

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

For P3 (Koala):

Subtasks 1 and 2 were pretty simple. The definition of subtask 3 sort of puzzled me. It essentially asked for a comparator between any two indices. If one could do that, one could also do subtask 5 for a reasonable number of points by just implementing merge-sort. This turned out to be the case: I got 19 points for subtask 3 and 30/53 in subtask 5. So, subtask 3 ended up being really valuable. (67/100 Solution in C++)

Anyway, I wanted to discuss subtask 3. My idea was to assign some price x to items i and j that are being compared, and price 0 to everything else. Based on what the reply is, we can modify x until we get a reply in which items i and j aren't treated the same way. I used a range of [1, 9] for the prices and did binary search, and it worked. All of this was very hand-wavy and based on intuition, so I want to know what others did for this.

Also, can anyone explain the solution for subtask 4 i.e. implementing allValues() with N = 100, W = 200?

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

my P3 solution for 90 pts
Subtask1. Just place a 1 somewhere and 0 everywhere else , the index not picked is the answer
Subtask2.(Explained in subtask 4 and 5)
Subtask3. find smallest 'i' such that if b[0] = i and b[1] = i and everything else 0 then one of them has a positive r[0/1] and other one has zero. Use binary search
Subtask4 and 5. First theres a shitty solution that use Subtask3 for comparing in inbuilt sort but this wont give much pts. So instead let solve(array[]) return array in sorted order , then i assign W/size(array) to each b[i] which is in array and 0 everywhere , not i put zero r[x]'s in a seperate array and nonzero r[y]'s in a seperate array(solution for subtask 2) , and call for those , if at any time , theres a self loop in recursion , i call the classical shitty sort again.

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

I solved the first problem (rainbow) during the contest with the idea similar to Xellos'. Remember that v - e + f = 1 + C where v denotes the number of vertices, e denotes the number of edges, f denotes the number of faces (including the infinitely wide background face), and C denotes the number of components.

The key idea is this: Let's draw a rectangle of each query and consider the graph only inside it. The graph includes the boundary rectangle, but it should contain nothing outside it. Apply the formula v - e + f = 1 + C to count the number of regions.

Let's see how we can count these.

  • For vertices, we can mark each four points of each cell in a 2D segment tree, with each point counted only once.
  • For edges, there are a few ways to implement. I marked each edge with its midpoint. Again, use an appropriate 2D segment tree.
  • The number of faces includes each river cell, so we have to count those cells. Be careful, it includes the big background. We need another 2D segment tree.

Let's talk about the components. The whole river blob is a single component. Even when it is cut, the query rectangle will keep it connected. Thus, when the river cells touch the outer query rectangle, the whole things compose single component(C = 1). When there is at least one river cell in the query rectangle but no river cells touch the outer query rectangle, C = 2. Finding out whether the river touch the outer query rectangle can be done by comparing max. and min. coordinate range of river cells.


I had to take a cell as a square with four vertices and four edges. When I took each river cell as a vertex, it was hard for me to solve this case:

.ooo
.o.o
..oo
....

The snake went through o cells, and the query is asking the inner 2x2 region. I found this in the last 30 minutes, and fortunately I solved it >_<

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

Is there an online judge on which we can find this problems (or we will be able to)?

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

Is there a serious issue with appeal process? Or is something wrong with the web server? Whatever the problem is, could you please announce it?

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

As 2 days passed after the expected date for the results, does anyone have the results for the online mirror or can other people post how many points did they score?

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

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

I am starting to think that the IOI results will be announced before the APIO results at this rate.

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

I think the sever was hacked by wannacry virus and they thought they could decode the files without paying for the hackers. So all the databases were lost ! We will never see the "Official result" !. Poor Australia !

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

Here are the official results.

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

I hope to see the tasks and test data, too (within this year). Thank you!

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

Can you guys post the test data and other materials for the problems?

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

Auto comment: topic has been updated by junkbot (previous revision, new revision, compare).

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

Finally! You can submit all the problems right here: https://oj.uz/problems/source/331

However, we don't know the exact time and memory limit, so we set arbitrarily. If you know the exact time and memory limit, please let us know. Also, we have changed the official grader to encrypt the test input, so if you find a bug please tell us. Thanks :D