Автор awoo, история, 8 лет назад, По-русски

Привет, Codeforces!

16 февраля в 18:05 по Москве начнётся Educational Codeforces Round 38.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для Div. 2. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Иван BledDest Андросов и Sahand Xahandd Alitanloo.

Спасибо Михаилу MikeMirzayanov Мирзаянову за отличную систему Polygon!

Удачи в раунде! Успешных решений!

UPD: В связи с тем, что скоро будет ещё один раунд для Div. 2, фаза взломов будет длиной 12 часов. Перед раундом 464 мы актуализируем регистрации так, что все участники Div. 2 будут в конкурсе, а все участники Div. 1 — вне конкурса.

UPD2: У нас есть небольшое сообщение от наших партнеров Harbour.Space:

We are excited to announce that some of the world’s strongest teams will come to our Hello India x Russia Programming Bootcamp: MIPT and all top India’s Universities that qualified to the World Finals!

As always, the boot camp isn’t only about the training — we’re in the process of getting renowned keynote speakers from all over the globe to come and speak about life and all the opportunities at your fingertips after ACM-ICPC.

We look forward to seeing you all there this spring! For those of you who haven't registered, there's still time.

Register here

If you have any questions we can help you with, please connect with us:

Phone number: +34 674 291 422 Email Address: hello@harbour.space

UPD3: Разбор опубликован

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

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

sooo fast people, wait we're still in a contest

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

lol

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

Imagine if we have rated contest every day! That actually happened for three days. Actually four(Saturday contest)

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

Score distribution?

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

Hat-trick of Rated Contests! :O

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

Wow! Rated educational rounds are really great initiative for div2 contestants. Just ❤️ it!

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

Will educational rounds normally have 7 problem from now on?

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

A back to back series of contests continues.......

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

Wow, four rated contests in four days. Keep it going Codeforces! :)

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

just like if we are in the heaven , Contests everywhere :D

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

just like if we are in the heaven , Contests everywhere :D

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

Maybe educational rounds should be rated for div 3 :) just like atcoder abc contests.

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

many contests! it's a chance for me to rescue my rating.

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

Let's see how many hacks halyavin takes in this round! XD

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

Codeforces seems to be quite excited. 4 rated contests continuously. Wow !

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

It's a week of "Love to Contests" !

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

My life these days,

Eat — sleep — codeforces contest

REPEAT

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

Our recursive routine these days : contest->upsolve->contest->upsolve->contest..........

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

Is hacking solution outside the room allowed during the contest time ?

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

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

Help: what is the difference between an educational contest and an ordinary contest?

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

halyavin is waiting for this contest.

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

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

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

I'm getting codeforces crashes in the last 3 contests I've been participating, I cannot submit solutions...I'm getting: Ooops! Something has broken down in Codeforces. Do not panic, you can try to reload the page or return Home. Anyway we will carefully read megabytes of logs, analyze stacktraces and fix the problem.

etc... and pictures of bug "ALL YOUR BUG ARE BELONG TO ME" — "I'd rather feel they're mine"...

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

How to solve C?

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

How did you do D?

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

https://pastebin.com/7f6WPztq

Can anyone tell me why my code wouldn't work for D? It kept on failing on test case 3. :(

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

в C ответ n^2-[n/m]^2 = x ???

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

Any idea of hacking yet ?

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

is G using idea similar to solving dynamic connectivity offline.But now maintaining basis of cycles possible in that component also and maintaining components as dsu with weights on edges for maintaining xor distances.
Or any other easy solution???

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

I have been trying 1 hour with this solution. Can someone plz tell me what is wrong with this solution https://ide.geeksforgeeks.org/s3ldY59oii

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

could someone help me with problem B my code

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

    Try 2 600000 800000

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

    Here's my code: https://pastebin.com/attptiBj

    Basically, the key thing for B is to

    1. Make sure that if you are moving simultaneously
    2. In order to make sure you don't over or undercount intervals, try each interval.

    Find the minimum distance from current start to the next interval greater, and current end to the previous interval smaller, then shift whatever is closer.

    This prevents you from moving a large interval and missing certain intervals.

    So for start = 1, end = 10^6. If the intervals are 1, 500000, 600000, you don't want to be double counting 400000+500000, because if you moved 400000 on both sides, then you only have to move an additional 100000 from start to get to 500000.

    Constantly update start and end with the new closest intervals to count correctly.

    You also want to break out of the program and return when start and end intersect, which signals that you have seen all the intervals so you should exit.

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

In problem C,I wonder we can hack only with testcases equal to one, but how about those coder whose solution may got time limit exceed due to more testcases?

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

Problem C: I'm really confused by the case2,can anybody express it?thanks so much

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

What is the difference between these two solutions ?

WA

AC

How priority queue works in both the cases?

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

What's "Unexpected verdict" when I try to hack others?

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

Idea for E?

I find some equation but it is O(N^2)..

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

del

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

Idea for E?

I find some equation but it is O(N^2)...

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

can i hack soultions if i haven't submitted any solution? Does it count for any rating changes?

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

Yazdanra is a genius cheat! lol!! he submitted multiple solutions for the same question from another account Double-D (owned by him) in which a specific case will fail and then he hacked all of them from his real account!!! ![ ]() isn't that totally unfair!

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

Why does the meaning of the term "submatrix" in task C differ from conventional one? "A submatrix of a matrix is obtained by deleting any collection of rows and/or columns." https://en.wikipedia.org/wiki/Matrix_(mathematics)#Submatrix

Here "submatrix" means some square area of adjacent elements. That's misleading!

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

There is no need for System test, we already have one halyavin :D

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

Can anyone tell me what's wrong with my approach for D. link

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

anyone can tell me the difference between GNU C++ 11 & GNU C++ 14?

this one is my submission during the contest, which got tle on testcase 37.

35369457 (C++ 11)

and this one is my submission right after the contest, which is exactly same code with above, and got ac.

35370185 (C++ 14)

only difference between two submissions is the language i choose...

got confused

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

Lel, in my language vowels are considered to be 'a', 'e', 'i', 'o', 'u', and I didn't read that there was 'y' as well xD

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

What's with the time and memory limits in codeforces rounds? I find them way too harsh. Today I got TLE on F with an O(n2) solution (if we take that operations with integers take O(1) time), and memory limit exceeded on D using Dijkstra's algorithm.

Of course, there may be something wrong with my code (Problem D, Problem F), but I don't see it. Do you? >:)

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

In problem C,can anybody explain why the answer is 999954147 when n=36514,m=2? thanks so much

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

how to hack person ?

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

In C answer for 48 is 8 2 for many people but for 8 2 maximum possible ones are 55. Can someone tell where I am wrong. Thanks in advance.

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

Can anyone tell me if my approach for D is correct? The contest ended before I got to finish it..

For each component of the graph, I will construct it's MST, because no answer for any node will contain an edge not present in the MST(needs proof).

Then, I choose a root for each tree and start traversing from root to leaves(dfs2), and for each node I will update it's answer as following: ans[current]=min(ans[current],ans[child]+2*edge(current,child))

The initial answer for every node is it's concert price.

Then I will do another dfs(dfs3), this time; I will update the answer of the child with the answer of it's parent(going up).

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

Can anyone tell me if my approach for D is correct? The contest ended before I got to finish it..

For each component of the graph, I will construct it's MST, because no answer for any node will contain an edge not present in the MST(needs proof).

Then, I choose a root for each tree and start traversing from root to leaves(dfs2), and for each node I will update it's answer as following: ans[current]=min(ans[current],ans[child]+2*edge(current,child))

The initial answer for every node is it's concert price.

Then I will do another dfs(dfs3), this time; I will update the answer of the child with the answer of it's parent(going up).

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

I have been trying 1 hour with this solution. Can someone plz tell me what is wrong with this solution https://ide.geeksforgeeks.org/s3ldY59oii. No TLE . I also compared 10 to 500 but no errors. But i cant find what is wrong. Ill again go to specialist/pupil. For the past few contests my rating are going down. But as i solve problems more and more my ratings are going down. Few contests back for some contests, i solved D, E etc but recdently im completely fucked up.

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

Would unsuccessful hacking attempt bring down the my ranking ?

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

Do successful hacking attempts provide the challenger with extra points in educational rounds? I was lucky enough to make my first successful hack in an educational round, and wanted to learn about this since the scoreboard does not show any points, or changes in my standing. (i.e. rank)

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

Can someone hack my solution for D?

I sort edges, then I look at every edge and try to improve answer for every verticle:

If I have an edge from a to b which costs d, and ans[a] > ans[b], I make ans[a] = min(ans[a], ans[b] + 2 * d); ans[b] = min(ans[b], ans[a] + 2 * d) otherwise.

I do this stuff 50 times, then output the ans array.

Sorry for my english btw.

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

who can explain dotorya's C? link

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

When we'll be able to see tests on which solution was hacked?

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

The last was a bit difficult

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

In problem D, why my solution that uses SPFA got TLE in the last test(test17), is it a requisite to use dijkstra to calculate the minimum route in this problem?

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

http://mirror.codeforces.com/contest/938/submission/35361791

Can i know why i got hacked in TLE (prob.D) ? with dijkstra?

PS. What a newbie's mistake !! everybody thank you !!

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

    You can check the single vertex up to n times. If this vertex has degree n, you have O(n2) operations.

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

    Your solution does't work with two components. Try this test

    4 2
    1 2 1
    3 4 1
    1 10 1 10

    Answer must be 1 3 1 3

    P.S. Sorry,false alarm. Didn't read code correctly.

  • »
    »
    8 лет назад, скрыть # ^ |
    Rev. 4  
    Проголосовать: нравится +3 Проголосовать: не нравится

    NoTalentBug you make unnecessary vertex run(n^2), look my solve

    Example:

    1. was g[k].cost = 9,

    2. you updated it g[k].cost = 8,

    3. but you RUN EDGES CYCLE for old value and new

    (Sorry for bad english)

    void Solve()
    {
    	while (!pq.empty())
    	{
    		auto top = pq.top(); pq.pop();
    		int64 v = top.second;
    		int64 cost = top.first;
    		if (g[v].cost != cost) continue; // it important !!!!!!! 
    		for (const auto& it : g[v].e)
    		{
    			int64 to = it.to;
    			int64 costEdge = it.cost;
    			int64 newCost = costEdge + cost;
    			if (g[to].cost > newCost)
    			{
    				g[to].cost = newCost;
    				pq.push({ newCost,to });
    			}
    		}
    	}
    }
    
    
»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Waiting for rating?? SubSpring

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

Where is the system testing?

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

Will the system testing and rating update happen before the next contest starts?

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

Where is the system test?
Where is the tutorial?

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

emmm..when will the rating change? Next contest will come.

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

Here comes "Codeforces Round #464 (Div. 2)" and the ratings haven't been updated yet. So what will happen if some 1800-rating person who should gain +200 rating in the last round takes part in the #464?

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

    If the ratings aren't updated before the contest, one possible solution is to evaluate the ratings of Education CF Round and then make it unrated for the people who became Div 1 in that round.

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

      that's a solution, but that would consume people's time and then after that make it unrated. Like I wouldn't want to participate if it's unrated for me, but it's hard for me to decide now, since I don't know whether it would be rated.

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

So when will the rating change?The next contest is coming soon.And the editorial hasn't been published either.

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

Can u write the tutorial for this Ed.Round please

I don't understand in which moment I should stop search the answer and write "-1" (938C - Constructing Tests). Could somebody help me with it?

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

what about the rating for div2?

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

When will the system test begin?

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

Holly Dijkstra, nobody hacked my D! For one second I did dijkstras from the cheapest cities, and in the other second I did iterations of bellman ford.

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

is it rated??

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

If you try to use a case in which t=100 and all x=1000000000 in CUSTOM INVOCATION, then you will find an amount of solutions in problem C will get time limit at the last of sorted by Execution Time

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

In Question C, for input = 21, why isnt "5 4" a valid solution?

Suppose we have a 5X5 square with all 1s except on the 4 corners where we have 0s, then if I have to select a 4X4 squares, there are 4 squares of 4X4 I can choose and each of them would contain a 0.

Please correct me if I'm wrong, help is appreciated.

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

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

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

Вы ваще свои тесты добавляете??? В задаче С там всего лишь 24 теста. Я видел много решений которые получат TLE, если дать макс тест. Я посмотрел все тесты, что были в задаче С, но макс теста и не нашел. Прошу вас впредь хотя бы 20-30 своих тестов добавлять!

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

    Ребята, не стоит вскрывать эту тему. Вы молодые, шутливые, вам все легко. Это не то. Это не Чикатило и даже не архивы спецслужб. Сюда лучше не лезть. Серьезно, любой из вас будет жалеть. Лучше закройте тему и забудьте, что тут писалось. Я вполне понимаю, что данным сообщением вызову дополнительный интерес, но хочу сразу предостеречь пытливых — стоп. Остальные просто не найдут.