Casual_W's blog

By Casual_W, 3 months ago, In English

Problem A1 : Pentagon Orchard(Easy version)
Author : Casual_W

Hint1
Hint 2
Hint 3
Solution
Code

Problem A2 : Pentagon Orchard(Hard version)
Author : Casual_W

Hint 1
Hint 2
Hint 3
Solution
Code

Problem B : Helicopter Rescue
Author : Godbot

Hint 1
Hint 2
Hint 3
Solution
Code

Problem C : Bitwise Transitions
Author : Godbot

Hint 1
Hint 2
Hint 3
Solution
Code

Problem D : Score Normalization
Author : Godbot

Hint 1
Hint 2
Hint 3
Solution

Problem E : Equal Floors
Author : Its_Tarun

Hint 1
Hint 2
Hint 3
Solution
Code

Problem F : The Broken Staircase
Author : Casual_W

Hint 1
Hint 2
Hint 3
Solution
Code

Problem G : Bilewater
Author : JAS1123

Hint 1
Hint 2
Solution
Code
  • Vote: I like it
  • +19
  • Vote: I do not like it

»
3 months ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

I was right.. It's euler's func in A2...., every tree lies in some dir from the center. If there is already a tree closer to the center in the same dir, then the new tree be hidden. Two trees lie in the same dir when their ratios are the same, which means their gcd > 1.... (Common factor) dir that appears for the first time.... coprime nums. Euler’s function exactly did same thing: how many nums are coprime with a given num So when I think that visbl trees = coprime dirs, it became clear that Euler’s function should be used here. BTW Very Good Contest...

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

For G the testcase

2

1 100

1 100000

This 1000 times would lead to TLE and is a valid testcase

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    the solution in editorial passed, took around 700ms, iirc there's already a test case which includes the max value of A in almost all arrays

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +1 Vote: I do not like it

      I ran the editorial solution on the testcase in custom invocation in C++ 17, for that it ran in 3000ms, however for C++ 20 it ran in 800 ms, i don't really know why is that the case