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

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

We will hold AtCoder Beginner Contest 184.

The point values will be 100-200-300-400-500-600.

We are looking forward to your participation!

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

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

Solving D is the main target!!!!

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

good luck

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

Hope I can get at least 4 problems!

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

Good luck!

I hope I can solve E.(I'm too vegetable.)

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

In problem C, the third move in example 3 from (-247,253) to the destination point does not satisfy any of the three conditions! Does the problem setter have any explanation?

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

C is not good for Problem C in ABC and I don't like it :(

But other problems are great and interesting.

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

Problem C isn't a ABC style

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

how to sove expected value questions

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

Why the answer to the last example in problem D is 91.83..?

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

Time limit for problem E(in Java) is a bit too strict.I have applied the fastest IO method with silly optimizations still it misses out on 4 cases.

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

Aren't E and F classical problems?

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

How to get rid of TLE in E(in Java)??

I have used fastest IO still it fails

My submisssion:-https://atcoder.jp/contests/abc184/submissions/18340875

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

Looks like I finally need to learn expected value

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

How do you solve D ?

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

    We can create a dp[a][b][c]==prob that that state happens. Then add up the propabilities.

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится -13 Проголосовать: не нравится
      Then add up the propabilities

      I think we need to add "probability multiplied by number of steps to reach a,b,c". Whenever you are helping someone , elaborate completely or don't do at all. Many a times it just confuses people more.

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

        Fuck you, idiot.

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

          Sure . I am not bad-mouth as you are. But then how am i wrong ? You have written "propabilities" , what the heck is "propabilities" ? Also if "Then add up the propabilities" was true then wouldn't be answer of every input be 1. Question is asking expectation and not sum of probabilities .

          People who have downvoted , please downvote , but again these are people who confuse beginners more in name of helping . I was once beginner and i understand that.

          spookywooky you keep complaining about contest problems and editorials whereas you yourself cannot explain properly .

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

            I love spookywooky's explanations , they're not deliberately explicit enough to become spoonfeeding which is great if you still don't want to miss out on the satisfaction you get after solving the problem yourself and this doesn't mean someone doesn't know how to get the point across. Again it's a personal opinion. Also I don't know many users here who document there thoughts in their contest submissions like spookywooky does which helps a lot sometimes.

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

That was again nice beginner contest. C was a bit clumsy to implement.

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

Lol C was more hard than E to me.

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

For F, how to know backtracking + meet in the middle has good enough time complexity?

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

    We can create the table of size 2^20 for first 20 items. Then do the same for the other 20 items, and combine each entry of the first table with the optimal one from the other in O(logn). ie binary search for the value.

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

      Thats exactly what I did but still got WA on 8 cases. Can you help me debug?

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

    The constraint on N is small, i.e, 40. So if we divide it in 20 and 20 and then compute subset sums for the right half and left half using recursion, it will have a time complexity of 2^20, which is doable.

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

How to solve C and D?

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

How to solve D??

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

I think there is a mistake in problem E... I wrote a simple BFS that should never visit a node more than once (and never try to visit a node more than 5 times due to teleport — using the fact that the closest 'a' character to the start should be the one that uses all of the potential 'a' teleports); so my algorithm should be O(m) where m is the number of edges in the graph, but it does not work because of TLE.

I wrote my code in C++

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

this is what happens when people complain about easy tasks in Beginner Contests.

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

D was the most toughest for me...could anyone share approach?

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

My C solution passed all test cases except one. Anyone has any ideas on what it would be?

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

I think ABCs aren't good anymore :(

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

For problem E: using teleporters as edges got me TLE submission but when I added a simple check if the current teleporter letter was used before it passed submission. Can someone explain why is this happening, because I thought since the distance should be less it will not add it to the queue anyway. Is it just the loop that's causing me a TLE?

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

    No, the idea of keeping a visited array is a must to avoid tle, because lets say you are traversing the point with 'a' then if this is the first 'a' you have encountered then all other 'a' will be marked with their best distance (thats how bfs works) and hence when you next encounter a 'a', you dont need to again update the weights of other 'a' because they are already marked to their best.

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

Can someone explain solution for C.

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

Can anyone please tell me why a simple BFS in E is giving me TLE in 3 cases. I am unable to think of any edge cases in my implementation.
My Solution.

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

Can someone explain D like I am an idiot please. Thanks.

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

where are the solutions?

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

[Problem E] This is the first time I successfully hardcoded a solution on AtCoder during the contest. I thought the test cases on AtCoder are invincible too.

I guessed random_32.txt to consist of all dots except the start and goal and hardcoded for that accordingly.

Before hardcode - https://atcoder.jp/contests/abc184/submissions/18340539 (I still do not know why this TLE)

After hardcode - https://atcoder.jp/contests/abc184/submissions/18341941 (This should break and TLE if I add a hex anywhere)

Readable version of the code - https://atcoder.jp/contests/abc184/submissions/18346808

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

Can anyone please tell their approach for problem F. Using knapsack approach gives TLE

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

C was tougher than F for me

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

My video editorial. Uploading took a long time.

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

https://atcoder.jp/contests/abc184/submissions/18351753 please someone suggest me a way to get over TLE will be great help! problem E! c++ code

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

    // tele[c].clear();

    The above line is correct, uncomment it, and place it after the loop. Each portal letter need to be traversed only once.

    Otherwise consider N=2000 grid and all cells marked with 'a', it will result in O(n^4) runtime.

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

    My first submission also got time limit exceeded so I applied this logic , look once visiting a particular character 'a' in minimum number of moves say 'd' then mark all the unvisited positions that has character 'a' as minimum distance = d+1. Now notice that this character 'a'(assumed here) is no longer use so u can erase it from your adjacency list. Mine such approach passed all test cases. Hope it helps and provide u the sufficient idea.My Solution Link

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

why we don't get editorial after the contest what if some one not able to solve the problem where should we discuss.

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

Pre-req for solving E and F ??

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

[Problem C] It seems that they added a test case of something like this, that made my wrong code fail after the contest

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

in problem C I am getting 3 WA. I tried but I am unable to find the mistake. The test cases are also not uploaded yet. I am getting WA at random_09.txt,random_10.txt,random_11.txt. Can anyone help me with this

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

Help! I got WA for the Task E and only because one wrong answer of the case "random_23.txt". I have no idea now Submission #18364982

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

Can someone tell me why my code, gives a TLE for the problem E.

LINK : https://atcoder.jp/contests/abc184/submissions/18365487

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

For Problem C: Please give me a condition where need three moves. I can't understand why I can't go to any destination in two moves.

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

F is way too standard and even available on GeekesforGeeks. I understand that ABC are for Educational purpose but I don't think it's a good idea to give problems in ABC that are just a click away from googling.

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

Is space required in structure binding in C++17? I noted the different behavior on AtCoder between for(auto [x, y]:vii) and for(auto [x,y]: vii). It's so weird. See 2 submissions: 18566943 vs. 18566919.