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

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

Thank you for helping Marisa, Reimu, Cirno, Sanae, Amanojaku and Momoyo!

Leave a comment!

2228A - Marisa Steals Reimu's Takeout

Author: Sanae

Solution: Sanae

Step 1
Step 2
Step 3

2228B - Remilia Plays Soku

Author: Sanae

Solution: Sanae

Solution

2228C1 - Cirno and Number (Easy Version) and 2228C2 - Cirno and Number (Hard Version)

Author: Sanae, Sugar_fan

Solution: Sanae, Sugar_fan

Solution

2228D - Sanae, Cross and Color

Author: Sanae

Solution: Sanae, fanhuaxingyu

Solution 1
Solution 2

2228E1 - Amanojaku and Sequence (Easy Version) and 2228E2 - Amanojaku and Sequence (Hard Version)

Author: Sanae

Solution: Sanae

Tutorial: CirnoNine, fanhuaxingyu

Sanae's Solution
CirnoNine's Solution
fanhuaxingyu's Solution

2228F - Momoyo and the Network

Author: Sanae

Solution: Sanae, juan_123

Sanae's Solution
juan_123's Solution
Разбор задач Codeforces Round 1098 (Div. 2)
  • Проголосовать: нравится
  • -167
  • Проголосовать: не нравится

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

i feel bad that i missed n=3 case in B :(

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

    I also missed that case n <= 3 I looked for all the options but didn't find a solution.

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

    me also ;( i didn't notice this case even though i found the answer

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

today is more cheaters in this contest than expected cf should take strict action on this

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

how did people use fenwick trees for D? I tried this but got 6-7 TLEs / MLEs, despite trying to optimize constant factors, use lighter trees, rewrite in C++, etc

eventually I had to use a prefix/suffix approach to pass

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

let d be the number of digits of a,can any tell if we generate all possible numbers with the 2 given digits of length=d and check for min difference (2^18, recurrsion), i dont know digit dp, and check for the largest number with (d-1) digits and smallest number with (d+1) digits , will it work??

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

I wasted too much time on D because it doesn't allow $$$O(n \log n)$$$ algorithms to pass, so i didn't finish calculating E1's equation :(

Feeling bad because I succeeded to pass the example of E1 ten minutes ago, which is just 25 minutes after the contest :(

Hope that my rating won't decrease for that..

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

Maybe the problem F is so much similar to 2222G - Statistics on Tree?

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

In Problem D, What is the idea behind forcing the constraints that some (N log N) solutions pass and others not ??

If the author think that this kind of forcing constraints will make the problem anti AI, I think he made it harder for humans than AI.

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

    Initially, I only intended for the $$$O(n)$$$ solution to pass...

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

      I feel like a more explicit decision should have been made. As of now, it seems the n log n editorial solution works only when written very tightly and in C, and java/python/etc users also get screwed.

      Also visually n log n with 2 million * 21 looks like it should run fine. Even when I sped up the inner loop to O(n) (but still had std::sort and std::set to do coordinates), I still got TLE.

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

Make your complaint.

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

I am a fan of wdoi, but this contest is not good enough.

E is too complex and meaningless as Div2 E. I don't think any problem with difficulty <=3000 should use so looong calculation.
And F has a very classic and simple solution: just use binary search, then use simple dp and sorting to check. You can just pass with $$$\Theta(n\log n\log V)$$$ complexity, or sort before binary search and use two-pointer to get $$$\Theta(n(\log n+\log V))$$$.

Plz bring better problems to participants at next contest of wdoi, and accept suggestions about problem. Thx.

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

    Addition: I expect E2 worth >=2600 difficulty, but 100+ participants pass this problem, and F is easier with less pass. How many cheaters in Div2??? That is insane.
    If an(/a) expert/specialist pass this E2 in 1 hour is common, I think people can still challenge AI :)

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

my submission:- https://mirror.codeforces.com/contest/2228/submission/374854997

can anybody tell me what's wrong with this

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

    plz mention what approach you are using for anyone to read your code easily.

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

    so first of all we get the string of a and remove first charecter until it is not in D

    then we make two cases

    b > a

    in this case pick sallest number > d if no then don't compute this case and make all other numbers smallest possible

    compute both numbers

    and take abs difference

    same is done with the second case

    now when b has less digit then a just get x = number of digits in a and take maximum digit in d x — 1 time to get this value and again update answer

    the case with more digits is handled this way

    if(d[0] || d[0]==0&&n>1) {
                    ll tr=0;
                    for (int i = 0; i < sz+1;i++) {
                            tr=tr*10+(d[0]==0?d[1]:d[0]);
                    }
                    ans=min(ans,abs(tr-a));
            }
            if(d[0]==0&&n>1){
              
              ll tr = d[1];
              for (int i = 0; i < sz; i++) {
                tr *= 10; 
              }
              ans=min(ans,abs(a-tr));
            
            }
    
    

    here sz is number of digits in a

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

Misunderstood B :(

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

I didn't like this one :(

A was fine B wasted a lot of time because I thought k was the total number of Remilia moves (it's total number of moves Remilia makes where she doesn't stay in place). It's my fault for misreading but still feels bad. C isn't that bad conceptually but it got REALLY bad once I started implementing. idk I find these kinds of questions where there isn't an insight just caseworking super boring. D looks interesting but I didn't get to it because of ABC :(

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

What was the intended solution for C1? Is it the same as C2? If so, why did you split C into two subtasks? The editorial's solution doesn't seem like it would be more complex to implement for 10 digits instead of 2. I started writing a brute-force solution for C1 (checking all 2^18 possibilities), but then realized that there are 10^4 tests per case and abandoned it.

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

I used binary search for C1 and C2. I don't really know how to explain it look at my submission: 374842701, if you struggled with implementation I would look at it because it's a lot simpler than greedy

would say L contest but I got paid off with expert performance

Also, are hacks disabled for any problems?

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

    Bro wtf is your code doing? please explain

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

      Ok, so first we define a function $$$\operatorname{gen}(x, w, b)$$$ where $$$x$$$ is the list of numbers, $$$w$$$ is the the amount of digits of the generated number, and it finds the $$$b$$$-th smallest number (0-indexed). We can do this by representing $$$b$$$ as a base $$$n = \operatorname{len}(a)$$$ mask, for example:

      $$$\operatorname{gen}([1, 2], 4, 6) = \operatorname{gen}([1,2], 4, 0110_2) = 1221$$$
      $$$\operatorname{gen}([1, 2, 3], 4, 5) = \operatorname{gen}([1, 2, 3], 4, 0012_3) = 1123$$$

      For each $w$ from $$$1$$$ to $$$18$$$, we will binary search for the smallest value greater than $$$a$$$ that can be created from the digits, and use $$$\operatorname{gen}$$$ to create these values. The value with the smallest absolute difference per width will either be the value found from binary search, or the generated value that is just smaller than it.

      Sorry if this is unclear it's a bit difficult to explain as I said

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

CaseForces

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

C has many cornercase without effective examples.What a "wonderful" problem.

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

B was super obvious but unfortunately I spent a lot of time trying to find the n=3 edge case. C1 and C2 are the same solution basically and problems like this are super boring, not creative just implementation hell.

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

E1 we can solve for sum of cubes or higher powers right?

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

didn't C need some heavier formalism to really define if b = 0 is always a possible solution or not? For me, at least, that wasn't clear at all; but I might be bugging.

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

what is the point of asking n=2 soln for c1

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

So, I did some testing and I don't really like D.

During the round:

  • my first O(n log n) first attempt using sweep line: TLE pretest 19
  • I tightened inner loop to O(n), but I still used std::sort and std::set once at the beginning to filter out duplicate x coordinates: TLE pretest 19
  • Changing set filter to sorting: 0.95s AC
  • This is annoying in my opinion. All I wanted was a sorted list of x coordinates with duplicates removed. Doing that with a set/prio queue method vs sorting and then sweeping should not be that big of a difference. But, at least now we know, std::sort is fast n log n, sets and maps are slow n log n.

After, the round, I tried a true O(n) solution with counting sort: 1.79s AC, actually was worse.

My conclusion is that I feel like the time limits were set WAY too tight, and were not super effective at discriminating between O(n) and O(n log n) at all. This problem felt like constant factor hell in C++ and I'm not sure it's even solvable (in n or n log n) in java/python. One of my friends daniel.glabai had O(n) inner loop in java and TLE19'd as well.

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

Can anyone share their soln. to C1? Or it would be wonderful if you could point out the problem in mine..

https://mirror.codeforces.com/contest/2228/submission/374822532

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

I feel in B there is a mistake for example let's take the case of 6 1 4 3

so now both are at a max possible distance and according to the submitted soln the ans comes out to be 6 but that's incorrect because when x2 moves in whichever direction x1 will move in the same and the suddenly their difference in distance decreased by 2.

so answer should be 4 instead of 6. pls correct me anyone if this is wrong !

Thanks !