AtCoder Beginner Contest 272 Announcement
source link: http://codeforces.com/blog/entry/107740
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
We will hold AtCoder Beginner Contest 272.
The point values will be 100-200-300-400-500-500-600-600.
We are looking forward to your participation!
8 hours ago, # | my favourite |
102 minutes ago, # | How to solve task E? |
-
Just keep incrementing the i-th element by (i+1) and put them into a set for each m. Need to speed up the process by only caring about the cases where the number just becomes 0 and smaller than n. My solution
-
I'm not able to get the intuition on why it will fit in the time limit :/
Any hints regarding the same?
-
Because first element is used at most n/1 times, second — n/2 times and so on. So, in total maximum sum over all answers = n * (1/1 + 1/2 + ... + 1/n) ~ n * log(n).
-
-
Actually I don't think problem F fits for its position, it would be better to swap it with G indeed. |
-
in F you just implement hash + bs, G is some thinking
upd. uh, just realized that TL is 2 sec (not 4 as I though) and my runs 1.4, so mostly you are right
-
I stalked your submission and your library for string hashing looks very cool: https://atcoder.jp/contests/abc272/submissions/35487307
Binary search to get lcp, then use lcp to lexicographically compare substrings, and then sort with those comparisons to get SA. I've never seen it done this way, I might steal this template for my personal use!
-
thanks and enjoy other codes of mine :)
One major moment in this solution is
stable_sort
. It has less calls to comparator than usual sort (that gives TLE)
-
-
80 minutes ago, # | I tried using BFS in Problem D, but I am not able to pass the 3 tests. Can someone help me find the issue? https://atcoder.jp/contests/abc272/submissions/35485981 |
-
It is always the f**king sqrt!
Corrected version: https://atcoder.jp/contests/abc272/submissions/35512682
Please note that both sqrt/sqrtl return float. You cannot compare float with int using
==
.
74 minutes ago, # | In problem D many are using the condition (i*i+j*j==M) how do we know that this will work? Please anyone help. |
-
The euclidean distance is invariant under linear shifts. If is at square distance from , will also be at square distance from . Therefore we find all that are at distance from (which is the condition you see everywhere). Then, all neighbours of will be .
On problem D, I think it will be possible to solve the problem in by precalculating the possible movements. (I did it in through a brute-force precalculation.) Did anyone solve D with this method also? |
I used the SA-IS algorithm in problem F but failed. I thought my idea was genius but the jury thought I was an idiot. Would you please review it? |
-
Spoiler
-
Yes, there are counterexamples.
Here is my code:
string s1 = s, t1 = t; s1.pop_back(); t1.pop_back(); string large = t + t1 + s + s1;
In my concatenation, the
large
is . The first starts from No.4 (0-indexed) whose suffix is , the second starts from No.10 whose suffix is . . My algorithm would not count this pair but this pair is definitely valid.For the correct answer, please refer to the tutorial/editorial.
This is the link to the original problem (ABC272F Two Strings).
55 minutes ago, # | I think problem E is very nice for "learning how to analyze complexity". In fact during contest, I could not convince myself that the complexity is O(NlogN) rather than O(NM), but after reading the editorial, I really like the idea of "important values". Besides, problem F is somehow about suffix array, which is really really a difficult topic for me, not even to talk about that clever construction in editorial. It seems that I should find time to learn suffix array again. |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK