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

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

Hello Codeforces!

evima, yosupo and I would like you to participate in Codeforces Round #286. It will be held on Sunday, January 18th at 16:00 MSK. Please note that this round starts on unusual time.

Great thanks to Zlobober who helped us prepare this round, Delinur who translated statements into Russian and MikeMirzayanov who created Codeforces and polygon.

This is the 3rd time(following #162 and #263) for me, and the 1st time for evima and yosupo to prepare a Codeforces Round.

Scores of the problems will be

500-1000-1750-1750-2500 for Div.1, and

500-1000-1500-2000-2750 for Div.2.

In this round, you'll help a man named Mr. kitayuta. I hope he will participate :)

The system tests are now over! The top-5 are as follows:

Div.1:

1.ilyakor

2.kcm1700

3.LayCurse

4.RomaWhite

5.TankEngineer

Div.2:

1.Konijntje

2.cpcpc

3.zgzjsxshycxksxhsh

4.Ronnie007

5.sha384

Also, special congrats on Petr, who solved problem E in Div.1, which anyone else could not solve.

Here are the editorials

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

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

Will there be Appleman again in this problemset? We all really loved this hero last time... Especially guys from Russia:)

Upd. Oh, i see now... So sad, we all miss Appleman. Hope to see him in your next round.

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

Oh, great! The 'unusual time' is suitable for Chinese coders ;-)

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

This is the 3rd time(following #162 and #263) for me

Hope round #364 will be yours, too. :D

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

"this round starts on unusual time" = start time is 5:00 am here. :(

Seems I can't participate Chinese and Japanese contests anymore..

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

hello dis like me pls

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

Score distribution already published. Thanks!

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

Mr. Kitayuta has registered to the contest.

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

Facebook HackerCup is running right now... I thought this would be delayed to after Hackercup or something...

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

I can't join this round cause i have English class...

Why you don't define a specified time for contests? So we can planning for them...

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

Lets just hope this contest goes fine and rated. :)

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

мне только что пришел клар по задаче Д! С чего бы это? UPD завтыкал, что уже идет раунд, перепутал время до начала и конца

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

Codeforces just changed it's logo to default. Codeforces changed it's logo to christmas.

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

Либо это раунд такой, что я за час не смог даже идеи придумать по A div1, либо это несколько часов решения facebook и написания курсача дают о себе знать. Пойду что ли дальше делать курсач.

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

    Мне тоже не понравилось. У меня конечно нет достаточного опыта, но, думаю, надо было дать нескольким людям разных цветов порешать задачи до контеста, и такой проблемы бы не было.

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

    Есть довольно объективный критерий "гробовости" раунда — сравнить число участников в мониторе и число зарегистрированных участников.

    Сегодня результаты этого сравнения даже не требуют дополнительных комментариев.

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

I think It was so hard; no right submissions for E. 1 right submissions for D. 33 right submissions for C. Wasn't it?

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

I'm solved Div1 D, but I'm too scared to submit it :D

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

Tried to hack 10^8 complexity solution, but unsuccessful attempt, code runs in 540 ms, is that possible??

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

What was the solution of A? :)

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

Tasks beautiful, but very difficult, IMHO.

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

i couldn't even solve A. Shame on me :(

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

Как решать D(div.1)? Очень уж интересная.

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

    У меня корневая.

    Для цветов, у которых много ребер — сделаем DSU по всему графу и просмотрим все запросы втупую — таких цветов будет немного.

    Для цветов, у которых мало ребер — для каждой вершины просмотрим все доступные из нее по этому цвету, и проверим, есть ли такие запросы. Это мы тоже можем сделать, потому что если мало ребер данного цвета — то и компонента связности будет маленькой.

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

    По-моему, тут работает наивное решение. Запишем для каждой вершины пары "цвет, номер компоненты связности по этому цвету, которому принадлежит эта вершина".

    Дальше при запросе будет тупо проходить вектор пар для вершины, для которой этот вектор короче, и проверять, верно ли для второй вершины, что по такому цвету она в такой же компоненте.

    Проверок, как ни странно, будет в сумме O((N + M)3 / 2) — для вершин, у которых этот список длиной меньше корня, это очевидно. Для вершин, у которых список длины больше корня, суммарное число проверок для пар со всеми остальными вершинами не привысит М,а самих таких вершин не больше корня.

    Значит, если кешировать ответы для уже пройденных пар и использовать для проверки, какая у вершины компонента по цвету, хэшмап, получим общую ассимптотику O((N + M)3 / 2). Вроде все верно?..

    А теперь посмотрим, пройдет ли у меня это с мапом и дополнительным логарифмом сложности:)

    UPD: Нифига себе, хвала могучему кодфорсесу! Прошло за 1.1с, однако..

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

Can anyone explain to me how to solve DIV2 C ?

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

Argh, you could have been a little more generous with the time limit of div2c, a n^2 solution with unordered_map didn't pass, but could do any input on my machine in < 3s.

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

Can anybody here tell me why this code gets MLE?

#include <bits/stdc++.h>
using namespace std;

const int N = 1e2 + 5;

int parent[N][N];

int find(int c, int v) {
    if (parent[c][v] == -1)
        return v;
    return parent[c][v] = find(c, parent[c][v]);
}

void unite(int c, int u, int v) {
    parent[c][find(c, u)] = find(c, v);
}

int main() {
    memset(parent, -1, sizeof parent);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        unite(c, a, b);
    }
    int q;
    cin >> q;
    while (q--) {
        int u, v, ans = 0;
        cin >> u >> v;
        for (int i = 1; i <= 100; ++i)
            if (find(i, u) == find(i, v))
                ++ans;
        cout << ans << '\n';
    }
}

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

My thoughts while trying to solve Div1.A and Div1.C (it's 2 MB gif).

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

A good contest.I only submit div A & B... Maybe My rating will decrease!

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

Why is it that during each and every Codeforces contest, you can't access the site when you need it the most? In the first 30 minutes, I could view other's solutions. But after that whenever I tried opening someone's solution, it just gave me a blank screen. It didn't work even after refreshing the page multiple times. So I couldn't even TRY to hack a solution!

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

Heh. I never expected that there will be a time when someone with rating 2484 will ask about it, but — how to solve A :D? D was the easiest one on this contest xD.

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

Why Petr try so hard to solve E instead of other problems? It lands him in 117th :/

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

Codeforces needs to at least have one approachable problem in Div1.. otherwise the majority of participants will not submit, meaning those who eventually do solve a problem will have a low ranking..

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

Nice problems! Has someone any idea for Div2-C instead of TLE naive recursion + memoization?

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

How to approach Div1 D, it is an extension of Div2 B with larger constraints..

Div2 B could be solved by making m graphs, but how to approach the same problem if m is as large as 10^5?

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

Could someone explain the idea of div1C solution?

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

    Didn't submit (edit: Accepted ), but here's what I thought during the contest:

    You want to simulate to see if a certain max_height is possible, then you can use binary search to get final answer. Hit the bamboos from the last day to the first day. Every bamboo i has to be hit before you get to a certain day hit_by[i] on the reverse simulation -- this means that even if you use all hammers possible on bamboo i before hit_by[i] you will not decrease height of bamboo enough, so you need to hit it at least once on a day after hit_by[i].

    I haven't proven it formally, but I think greedily hitting the bamboo with the largest hit_by works.

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

      Hm, I didn't get your idea. Can you explain the meaning of hit_by[i]? Why can you go from the end to the beginning? I mean, when you decide to do something in the very end, and then cut some bamboos before that moment, your final decision now possibly becomes wrong. Have I missed something?

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

        hit_by[i] means: I have simulated some hits at the end so far. If I hit only bamboo i for the first hit_by[i] days and then hit at the end according to the simulation, I will be able to get bamboo i to a height smaller than max_height. But if I only hit bamboo i for the first hit_by[i]-1 days (other than simulated hits), I won't be able to get bamboo i low enough. This means I definitely have to hit bamboo i at hit_by[i] or after.

        I don't understand why going from the end to the beginning would change the answer. When you do a cut the only thing that changes is the new target (I wanted less than max_height height by day m, now I want less than P height by day Q). If you go in the forward direction, then it's complicated because it's true that a cut affects a lot of other things.

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

    My solution is based on the idea that it's optimal to hit a tree when its height is less than P at most once per tree. If this is true, then that hit should be at the first moment when (tree's height)  ≥  (tree's final height if left unchecked — target height) % P.

    I don't have a proof for that, though, so we'll see what happens in systests...

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

Well, we feel sorry that the problems were too difficult. Actually, we felt all of the tasks were a bit more difficult in comparison with other problems of the same scores, but I hadn't expected that there were such a few submissions&accepts.

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

just to know ... why it gives me time excess (something like that) when i open a solution to hack and then i can open it another time!!

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

1500-1500-2500-1000-2500

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

ENOUGH TO ENDURE!

I have strong disire to view code highlighting in hacks. I'm so tired to recognize 1's and l's.

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

Does the following algorithm for Div1B work:

find the number of connected components (assuming each edge is bidirectional); let it be a

find the number of such connected components that have a cycle (with directed edges this time); let it be b

Our answer is (n — a + b)

I tried this, so either this algorithm is wrong or I'm bad at implementation :P

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

Can someone tell me one thing, please? What is the point of having one extremely easy problem and one easy problem and 3 almost unsolvable problems for Div2 participants. Then you have list where 60th participant solved A and B, as same as someone who is 800+.

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

Next competition is only div 2,maybe I solve something :)

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

What's wrong with system testing?

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

I opened results before system testing and saw this

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

Pending system testing...................?

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

Hey, let's start system testing! I want to see these red->purple and green->gray xD

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

Thanks you! Nice contest :D

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

I think system testing is deterioration

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

What's going on? 45 minutes has passed since the contest has finished!

I guess the rating updates will be fast as (because) the system testing is slow!

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

I think Codeforces is broken. Take a look at "Pay attention" area...

UPD: Already fixed.

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

The unusually long wait for the programs to pass the system tests is adding to the anxiety, especially for those expecting a rise in ratings after the contest

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

How to solve problem D of Div. 1? Why many people say that it's easy? Thanks a lot.

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

Second hour just began...

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

Anybody else read Problem B statement wrongly? I thought only "edges" on input are allowed to make teleportation graph...

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

The system testing is delayed due to verifying test cases(not a technical reason or trouble in the judge server). We feel really sorry about this.

The problems are so hard, even round author can't solve them.

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

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

I resubmitted D a couple of times because I saw I went over the memory limit (259900KB, but still Pretests Passed). 9463550

But it looks like my fears were unfounded, because the same submission, using even more memory on system tests, still got Accepted. 9465410

Oops.

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

Ничего не сдал -> не спустили рейтинг, кажется я придумал, как на этом заработать :)

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

rng_58 , It doesn't matter what is your rating (or rank)! we will always be your fan!!

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

I will start crying now...

Test: #12 ... verdict: WRONG_ANSWER
Input
1 30000
30000
Output
0
Answer
1
»
12 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Не понял, куда пропали рейтинги?

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

The ratings are back to the last ones???

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

Mmm, guys, what has happened to ratings?

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

WTF , I had +55 but now it is +50 , why ???

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

It seems that i've just set a new record for shortest period of being IGM (~20 minutes, i guess :) )

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

Can anyone tell what's wrong with my DFS for Div.2 B? Each node has a vector of pairs <color, endnode> and then it just tries to DFS through all the colors, but I can't figure out why it doesnt work. :/ http://codeforces.me/contest/505/submission/9461069

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

I just can't understand how the rating works.. rng_58, whose rating was 2782, got -107. But Antoniuk (whose rating was 2244), and -imc- (whose rating was 2256) both got -102. All of them got 0 points in this round. How could this be possible?

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

    It is ovious even for me=). rng_58 have higher rating then Antoniuk and dragonic, so his rating dropped down most. Antoniuk and dragonic have same decreasing, beacause of rounding, rating calculates in double then rounds to int. Read about Elo rating. Sorry for my bad english.

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

    There exist some threshold — you can't lose more than X points, no matter how bad you perform. I don't know how value of X for given user in given contest is calculated, but usually it is around 100 points (or a bit more).

    When you are violet — it is really hard to hit this limit; for red users it is much easier (placing somewhere in the middle of the standings is enough), and for top-users it is even easier — tourist once got -135 for 21st place.

    And also — look how dreamoon_love_AA was getting -110..-120 for placing last :)

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

      I was just suspicious because I got -111 last round, for only solving B. (my rank was 366/610) I think the reason is that the problems of this round were really hard than the last round's problems..

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

Will this algorithm work for div 2 D?

  • Find strongly connected components,
  • Turn each SCC to a cycle and keep the remaining edges.
»
12 лет назад, скрыть # |
← Rev. 7  
Проголосовать: нравится +2 Проголосовать: не нравится

Many Accepted codes of Div-1 A/Div-2 C crushes for this input:

1 1 30000

Is the input invalid? Or, judge data is weak?

This Accepted Code Crashes for the above input.

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

For Div1-A/Div2-C, Could someone help me figure out why does 9462290 TLE at test 5 but 9467397 gets AC? The only difference is I change the memoization from a map to an array keeping the difference with d.

Shouldn't the two essentially be the same ?

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

    std::map has O(log n) access time, not O(1). AFAIU std::unordered_map has sort-of-O(1) access time, but with bad constant. I also failed to solve this problem with unordered_map, but got AC with plain array.

    BTW, my array solution works 5x times faster than yours, probably because I also use array for gems variable (and you use map).

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

      I know that a map has O(logn) but that should still make within the time limit, right ?

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

        As we can see, it shouldn't :(

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

          I guess map is actually slow and I should be more cautious using it then. It seems to have a very large constant factor and does allocations for each object hence its slowness.

          I found this:

          std::map has similar characteristics to std::set: it uses a single allocation per pair inserted into the map, it offers log(n) lookup with an extremely large constant factor, imposes a space penalty of 3 pointers per pair in the map, etc. __ std::map is most useful when your keys or values are very large, if you need to iterate over the collection in sorted order, or if you need stable iterators into the map (i.e. they don’t get invalidated if an insertion or deletion of another element takes place)

          source: http://llvm.org/docs/ProgrammersManual.html

          EDIT: Hmm I just tried changing my code in Java to use a HashMap which has O(1) 9467938 but it also gets TLE at test 5..

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

    Thanks for posting this, I'm practically in the exact same situation. My solution is here: http://codeforces.me/contest/505/submission/9467923 and theoretically its complexity is at most around 30000*500 operations, which should be acceptable. However, since these operations are on maps, it appears the very large constant factor does its tricks. I expected my solution to either barely pass or just barely get TLE, but it turns out it takes ages to produce a solution, tens of seconds on my machine. Honestly, I'm pretty shocked at how slow the operations on maps are in this case. I guess this is a good lesson for me on how well modern processors can handle contiguous data (vector) vs. not-so-contiguous (map).

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

    So do I. Even I changed map to unordered_map, still got TLE.

    A tough lesson, QAQ~

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

2 years ago Coder noticed that Petr and tourist couldn't solve C which was also E for div2 and made this comment: http://codeforces.me/blog/entry/5586#comment-108611

What to say today about Petr and rng_58 :)?

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

Meh. It's good to have basic knowledge about STL...

This got TLE and used 198MB: 9459485

And this easily passes all tests using 23MB: 9469360

The only difference is changing

res += (pars[c][u] == pars[c][v]);

to

if (pars[c].find(v) != pars[c].end() && pars[c][u] == pars[c][v]) {
    res++;
}
»
12 лет назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится

Finally, after 93 contest I'm in div1 I'm so happy!

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

I pass Div1 A and D both through brute force. So lucky and maybe the test cases must be more careful.

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

Where is the editioral?

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

    It is currently being written. The first part (all problems except Div1C(2E) and Div1E) will be ready within approximately 4 hours. Thank you for your patience.

    Edit: sorry, I had to insert one word into the sentence above.

    Edit2: The first part has been published here. It actually took 8 hours after I posted this, sorry for being late.

    Edit3: Added Div1C(2E) and the problem setters' codes.

    Edit4: Added Div1E. I am sorry to have kept you waiting.

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

When will the editorial be out?

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

problemset was tough but very nice , problems required more thinking instead of coding that means quality contest.

Congratz to authors !!!

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

I can't open editorials

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

Why my solution get WA on test 10? I can't see anything wrong in my solution...

My solution

Please help me!

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

excuse me, for this easy sample : 6 7 1 2 2 3 3 1 3 4 4 5 5 6 6 4 the output is 6, it is not 7, why ?

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

Can anyone help me and explain why my solution is failing for Div1 Problem A. My Solution id is : 9666602