### chokudai's blog

By chokudai, history, 15 months ago,

We will hold AtCoder Beginner Contest 170.

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

We are looking forward to your participation!

• +75

 » 15 months ago, # |   -67 how to explain the first example of problem D？thanks a lot.
•  » » 15 months ago, # ^ |   -65 ya same here , someone plz!!
•  » » » 15 months ago, # ^ |   +28 Not during the contest. Definitely not here. You can request a clarification, maybe the Jury decides to give some further explanation, maybe they don't, but this is the only fair way to get explanation during a contest.
•  » » » » 15 months ago, # ^ |   +21 ok，I know.I'll be more careful.
 » 15 months ago, # |   -17 omg, My code won't even give an o/p locally but when I submit, it got accepted in Q D. xD
 » 15 months ago, # |   -11 How to browse the test data in problem C?
 » 15 months ago, # |   +3 How can i see judge test cases after a contest in atcoder ?
•  » » 15 months ago, # ^ |   +38
 » 15 months ago, # |   -15 Find the number of integers i(1≤i≤N) with the following property: input : 4 5 5 5 5 output: 0 how this possible ,,,,bcz the value of i is i<=i<=N ,,, how here i become 0??? plz explain!!!
•  » » 15 months ago, # ^ |   0 here i is the index number/position and u have to find out total number of such index for which the given condition satisfy(it may be 0 to n(inclusive))
•  » » » 15 months ago, # ^ |   0 oh,,, i understand ,,tnks u
•  » » 15 months ago, # ^ |   0 they start iteration from 1 not from 0 the first element is A1 and the last is An
 » 15 months ago, # |   0 Shit I wasted time at B, thinking by combination they meant both should be there -_-
 » 15 months ago, # |   +72 Problem F is the same as this
 » 15 months ago, # |   0 nice contest!!
 » 15 months ago, # |   +33 Editorial: AJust check if $x_i=0$ BIf the answer is "Yes": $Y$ is even. $2X\leq Y\leq4X$ Ccheck every integer between 0 and 101 (inclusive) Dfor each integer $X$ appearing in the sequence $A$,Set $AP_i=1(imodX=0,i>x)$specially,if $X$ appears twice or more in the sequence $A$ ,$AP_X=1$the answer is the number of $i$ that $AP_{A_i}=0$.In $O(nlogn)$ EUse a priority_queue for each kindergartens,then use a segment tree to achieve it. Flet dp[i][j] mean the smallest steps required to walk to [i,j].In the beginning ,dp[x1][y1]=0.Consider using dp[i][j] to update others:dp[m][n]=min(dp[i][j]+1,dp[m][n]),only if : m=i or n=j the distance between them $\leq$ k there isn't an '@' between them. We can use 'shortest path' to achieve it,and use set to store the position that isn't updated in each line and row. In $O(H*W*log(H*W))$ Link to all submission https://atcoder.jp/contests/abc170/submissions?f.Task=&f.Language=&f.Status=&f.User=Gary
•  » » 15 months ago, # ^ |   0 hello, i'm not geeting question 2
•  » » » 15 months ago, # ^ |   0 Actually its simple math problem. Let a and b be the number of cranes and turtles respectively, thena + b = X and 2a + 4b = Y, See my Submission
•  » » » » 15 months ago, # ^ |   0 okay got it
•  » » » » 15 months ago, # ^ |   0 I made a boolean array for question c and take each element whether it is present or not and then I traverse it and if it is false then res=min(res,i-x); I checked this but this is not giving the answer, why?
•  » » 15 months ago, # ^ |   0 thank you for editorials! i quite didn't get the heuristics you used in problem F: can you please write what happens when you move from dp[x][y] to dp[x + 1][y], how are your sets changing? how can your sets be defined? thanks.
•  » » » 15 months ago, # ^ |   0 When moving from dp[x][y] to dp[x + 1][y] only if dp[x+1][y] hasn't been updated yet,you can use sets to find it.Then the cell->[x+1][y] is deleted from the set which represents column y as well as the one represent row x+1.Because [x+1][y] has been updated now!
•  » » 15 months ago, # ^ | ← Rev. 3 →   +9 In problem E multiset can be used instead of segment tree, because u need to know min over all array and can keep all top values in multiset.
•  » » 15 months ago, # ^ |   0 In problem F, I don't understand how are you updating all possible [m][n] for state [i][j] which satisfies all three conditions, I tried it using loop from 1 to K resulting in complexity of O(H*W*K) :(
•  » » » 15 months ago, # ^ |   0 I just use set to store all of the states that are not updated yet.
 » 15 months ago, # |   0 For the D problem- Let us sort the array first. Now, let's iterate through the array from the beginning. After that, the idea is to maintain a map that will store all the values that have a)appeared in the array itself b)or are multiples of those elements that have originally appeared so far, that are less than 1e6. Time Complexity-0(N*(log(1e6))), which is equivalent to an O(N) complexity Here's my submission- https://atcoder.jp/contests/abc170/submissions/14321810 Also, for the E problem, do we have to maintain a vector of priority queues?
•  » » 15 months ago, # ^ |   +11 Priority queue won't be sufficient because we need to delete too from kindergarten. So I used multiset.
•  » » » 15 months ago, # ^ |   +11 You don't need to delete an element from priority_queue any time some child leaves it. Instead each time you want to find maximum pick the largest element from priority_queue, check if the infant in question has leaved our kindergarden and if so erase it from queue and keep going. This still is amortised $O(n log n)$ since there are $n$ insertions and each element will be deleted at most once.
•  » » » » 15 months ago, # ^ |   0 I did same but my solution is passing all testcases except 1. https://atcoder.jp/contests/abc170/submissions/14355498
•  » » 15 months ago, # ^ |   0 we can also solve E by multiset(vector of multiset). link: Your text to link here...
•  » » 15 months ago, # ^ | ← Rev. 2 →   0 what if array is of size 1e6 and a[i]=1 for 0<=i<=n-2 a[i]=200000 for i=n-1
 » 15 months ago, # |   0 How to solve F?
•  » » 15 months ago, # ^ | ← Rev. 3 →   0 It's shortest path with the following optimizations:1) You never want to go backwards2) You never want to try something in the same direction, you could have just computed that before.My submission for F
•  » » » 15 months ago, # ^ |   0 Wonderful soln. could you just add some comments and send the soln so that I can understand 100%. Mainly what are the first second things and how is the @ thing being checked!Thanks a lot secundus
 » 15 months ago, # |   0 Are heuristics expected to pass for F?submission
 » 15 months ago, # |   0 Was F bfs but I think time complexity will be more with BFS solution
•  » » 15 months ago, # ^ |   0 Hi I am wondering the same thing, shouldn't it be O(nk). Ashishgup
•  » » 15 months ago, # ^ |   0 yeah i tried the same thing ... but it fails 3 cases ... i don't understand why.. Here is the link
 » 15 months ago, # |   0 In problem D , i tried to solve by marking all multiples of numbers in array . But it gave TLE . I guess it is O(nlogn) (because it corresponds to harmonic series). submission
•  » » 15 months ago, # ^ |   +8 O(n*sqrt(n)) will also work
•  » » 15 months ago, # ^ |   0 Yeah a similar concept to Seive
•  » » 15 months ago, # ^ |   +1 It is not O(nlogn) because a[i] may be not unique.
•  » » » 15 months ago, # ^ |   0 thanks .
•  » » 15 months ago, # ^ |   +2 Why not avoid using the same number to mark others?
•  » » » 15 months ago, # ^ |   0 yeah i should have done that . Later i solved by factorising the numbers.
•  » » 15 months ago, # ^ |   0 Even I got WA and TLE , I think I misinterpreted the problem statement. Can you explain how output is 5 in test case 3.
•  » » » 15 months ago, # ^ |   0 Because 33,45,19,89,2 are not divisible by any other numbers other than themselves in the array.
•  » » » » 15 months ago, # ^ |   0 Can you please explain what is problem with my submission https://atcoder.jp/contests/abc170/submissions/14361963
•  » » 15 months ago, # ^ |   0 I did the same You only have to take care that you do not do working for same number again
 » 15 months ago, # |   0 Whats wrong with my code for F? Link
 » 15 months ago, # |   +15 I have solved all problems in a contest for the first time. Hurray!!! Here's my idea for F: SpoilerTraverse nodes level by level. Let current level is i and all nodes of current level is saved in nlvl[i]. Sort those nodes by descending order of columns. Then from each of them try to go as right as possible. If you face a node which has level <= i, break the loop, which will ensure that you don't visit a node from same direction twice. Do similar things for other 3 directions.My submission: link
•  » » 15 months ago, # ^ | ← Rev. 2 →   0 Interesting idea. The reason this greedy modification works better than normal bfs is that every cell gets visited at max 4 times in your solution
 » 15 months ago, # | ← Rev. 2 →   +23 E was a heavy implementation problem? Upd : WA/RE teaches a lot.Learned, why should we refactor our code. Make separate functions for the repeated tasks.
•  » » 15 months ago, # ^ |   +23 :( ,I think it's more like a basic data structure problem.
•  » » » 15 months ago, # ^ |   0 I used sorted maps i.e (TreeMap in java ) for everything, maintained sorted lists for everything. But its just failing for 1 tc i.e random_caseSubmission
•  » » » » 15 months ago, # ^ | ← Rev. 2 →   0 I must have done many unnecessary things, cause it took me a hell lot of time code this.
•  » » » » 15 months ago, # ^ | ← Rev. 2 →   +9 Here are 2 small cases where your submission fails: Test 1Input: 3 2 1 1 2 1 2 1 2 2 3 2 Expected output: 2 1 Your output: 2 2  Test 2Input: 3 3 1 1 2 1 2 1 2 2 3 2 1 2 Expected output: 2 1 2 Your output: RTE
•  » » » » » 15 months ago, # ^ |   +9 Not all superheroes wear capesThanks ShafinKhadem.AC
 » 15 months ago, # | ← Rev. 3 →   -30 .
•  » » 15 months ago, # ^ |   0 Edit : I changed x*100 to 102 and it got AC right after the contest ended aghhh
•  » » 15 months ago, # ^ |   0 This is not a way to ask doubt you should not spam discussion with full code just post link of your code and try to explain your logic a little bit.
•  » » » 15 months ago, # ^ |   +10 oh okay sorry ill get it removed
 » 15 months ago, # | ← Rev. 3 →   0 I created lot of treemaps and hashmaps in E and I was shocked that my code worked on the 1st go, the code got unbelievably complex though. In F, the naive BFS solution gave TLE on 2 test cases only. How to solve it efficiently?
•  » » 15 months ago, # ^ |   0 Naive bfs complexity will be O(h*w*K), which will TLE. I have explained my O(h*w*4) solution in this comment.
•  » » » 15 months ago, # ^ | ← Rev. 2 →   0 You did not take sorting into account. It is O(hwlog(hw))
•  » » 15 months ago, # ^ |   +11 Keep sets for unvisited cells (for each row and for each column), and remove cells when you add them to the queue. Then you would only look at every cell once. This introduces a logarithmic factor, but also removes the dreadful factor of $k$ in the naive solution.
•  » » » 15 months ago, # ^ | ← Rev. 3 →   +8 I solved F using a parent array which marks from where the element came into the bfs queue. Now when processing a nodes child if the node and it's child came from same parents then break the loop. This helps to solve it without the log factor and avoids moving in the same direction again and again. Solution link: https://atcoder.jp/contests/abc170/submissions/14351675
 » 15 months ago, # |   0 How to Solve F ?
•  » » 15 months ago, # ^ |   0
•  » » 15 months ago, # ^ |   0
 » 15 months ago, # |   +29 I learnt after wasting 40 minutes in problem E that, multiset.erase() removes all occurrences of a given value from the multiset. To erase a single element, use this: multiset s; s.erase(s.lower_bound(value)); //Make sure value is stored in the multiset!! 
•  » » 15 months ago, # ^ | ← Rev. 2 →   +4 This is why I use map to store number of occurrences and erase the key once no. of occurrences becomes 0.
•  » » 15 months ago, # ^ |   +16 An alternative, if you don't want to worry about whether or not the value is present in the multiset: multiset s; auto it = s.find(value); if(it!=s.end()) s.erase(it); 
•  » » 15 months ago, # ^ |   0 Yea I also learned this today in problem D
•  » » 15 months ago, # ^ |   0 or s.erase(s.find(value));
 » 15 months ago, # |   -6 For C binary search also works.
•  » » 15 months ago, # ^ |   0 How ?
•  » » » 15 months ago, # ^ | ← Rev. 4 →   0 Well first increment iterator and search for the closest next number which isn’t present in the array. Do same by decrementing it.Binary search allow us searching that number faster(within timelimit). link
 » 15 months ago, # |   0 -->For d solution i came up with this solution-->Created a map for count of given integers,for any number check whether its divisors present in map (or) when its count is >1 function returns false else increment count-->solution :link-->it passed 27 test cases and wa for 22 can any one tell what i have missed??? or corner test cases i have missed??
•  » » 15 months ago, # ^ | ← Rev. 3 →   0 Try this test case Test case21 1the answer should be 0 but your code's output will be 1another test case where your code will fail Test case45 5 5 25the answer should be 0 but your code's output will be 1Accepted code link
•  » » » 15 months ago, # ^ | ← Rev. 4 →   0 Yeah thanks for testcases , I have got the point
•  » » » 15 months ago, # ^ | ← Rev. 2 →   0 Can you explain me D part pls?
 » 15 months ago, # | ← Rev. 3 →   0 The first submission for problem D gives me TLE, but when I replaced at line 172, MAXN = 10^6 with the real maximum of the input, second submission got accepted and actually the difference in time is huge. Why is that? It seems really strange to me. I spent too much time on that and I was kinda lucky to come up with that replacement because I was sure that the complexity is sufficient.Thank you !
 » 15 months ago, # |   0 How to solve problem E of todays contest ?
•  » » 15 months ago, # ^ | ← Rev. 2 →   +1 Maintain a multiset for each kindergarden and one multiset for the maximums of the kindergardens. Now at every query you just need to insert/erase only from three multisets.
•  » » » 15 months ago, # ^ |   0 thanx i got it
 » 15 months ago, # | ← Rev. 2 →   0 In problem d I thought checking all the factors will give TLE. but when 10 min was left I thought maybe I should submit the solution with TLE but rather it got accepted.lesson learned : analysis of time complexity should be done carefully.
•  » » 15 months ago, # ^ | ← Rev. 2 →   0 O(nlogn) so why tle?
•  » » » 15 months ago, # ^ |   +9 osthir_brogrammer it's O(n*sqrt(n))
•  » » » » 15 months ago, # ^ |   0 I was thinking the same but it's not correct, I think ??
•  » » » 15 months ago, # ^ | ← Rev. 2 →   0 can you explain how ??here is my approach: I took the frequency array, when the element was greater than 1 I ignored the element and when it was equal to one I checked all it's factors and checked if any of them were present or not.
•  » » » » 15 months ago, # ^ | ← Rev. 2 →   +1 Numen Your approach is correct
•  » » » » 15 months ago, # ^ |   +4 you can preprocess divisors of numbers from $1$ to $Max$ using this way in $O(MaxlogMax)$ vectorDiv[MAX+2] for(int i = 1 ; i < MAX ; ++i) for(int j = i ; j < MAX ; j += i) Div[j].push_back(i) ; Div[x] stores divisors of x.
•  » » » » » 15 months ago, # ^ |   +8 I think now I understand the time complexity :) and this is a nice way to preprocess all the factors.
 » 15 months ago, # |   +8 Did anyone solve D in O(n * sqrt(n))?
•  » » 15 months ago, # ^ |   +8 I did
•  » » » 15 months ago, # ^ |   0 can you give the link to the code/submission?
•  » » » » 15 months ago, # ^ | ← Rev. 2 →   0 LinkUseful Code in case if you find hard to read my JAVA template, int n=ni(); HashMap hm = new HashMap<>(); int[] arr = new int[n]; for(int i=0;i
•  » » » » 15 months ago, # ^ |   0 You can check out the C++ implementation of the same here! Submission for D
•  » » » » 15 months ago, # ^ |   0
 » 15 months ago, # |   +9 Lesson learned from D:std::unique does not change vector size! must change it by myself.
 » 15 months ago, # |   0 is memory limit exceeded will show as RE at atcoder ? PS. I am getting RE for the only 1tc in problem E i.e random_10, can someone give me some corner cases? But I feel as setter must have added those corner cases in test files,this RE must be because of Memory Limit. Submission
 » 15 months ago, # | ← Rev. 2 →   +2 Messed up big tym n now, messing up on atcoder has become a habit :-(
 » 15 months ago, # | ← Rev. 2 →   0 Approach for Problem D — create frequency array for all elements and then check for each element whether any of its divisor is present in the array or notGives tle in one case and few wrong test casesAny Suggestions ?
•  » » 15 months ago, # ^ |   0 I did the opposite, I marked every multiple of each element till $10^6$ and stored it in an array. Complexity would be like $O(n\ log\ log (10^6) )$
•  » » 15 months ago, # ^ |   0 WA-some condition is missing TLE-may be using map for finding element complexity -log(n) Ac code-https://atcoder.jp/contests/abc170/submissions/14339476
•  » » 15 months ago, # ^ |   0 For the TLE part:- Just change your map to array.Accepted code link
 » 15 months ago, # | ← Rev. 5 →   +2 In Problem F, I understand the solution where one can keep a set for every row and column, to prevent visiting a single cell multiple times.But, after looking at some codes, I realised some solutions broke their loop if dist[cr][cc] + 1 > dist[r][c] where (cr, cc) is the current cell and (r, c) is the cell to be visited, from the current cell.For, instance checkout this submission.I understand the correctness of the solution, but I do not understand how this solution will pass the time limits.
•  » » 15 months ago, # ^ |   0 Here's an explanation.
 » 15 months ago, # |   0 when will they release the English editorial?
•  » » 15 months ago, # ^ |   0 In 1-2 days, in the same editorial pdf, there will be an English version in the end.
•  » » 15 months ago, # ^ |   +8 It's there now
 » 15 months ago, # |   0 Can someone explain how the complexity of D is O(N*logN) (or O(N*sqrt(N)) from what I saw in other questions)? Shouldn't it be even bigger than N^2 (e.g. when I check for multiples of 1)?
•  » » 15 months ago, # ^ | ← Rev. 2 →   +1 For the O(NlogN) solution for outer loop you are going from 1 to n,for each i from 1 to n, you are marking it's multiples, we run inner loop on all numbers N/1 + N/2 + N/3 + N/4 + ..... + N/N times which equals O(NlogN)you can find here proof for why N/1 + N/2 + N/3 + ... + N/N is O(NlogN) https://stackoverflow.com/questions/53240625/formula-for-the-sum-of-nn-2n-3-n-nFor the N*sqrt(N) soln you calculate all divisors of a number in O(sqrt(N))time ,you can refer this Primality tests and you do this for all N numbers Hence it is O(N*sqrt(N))
•  » » » 15 months ago, # ^ |   0 I got it! Thanks!
•  » » 15 months ago, # ^ | ← Rev. 2 →   +7 I think that the easier way to look at this is:N/1+N/2+N/3+N/4+N/5+N/6+N/7+... < N + N/2+N/2 + N/4+N/4+N/4+N/4 +.. = N + 2*N/2 + 4*N/4 + .. + N*N/N = NlgN
 » 15 months ago, # |   0 Can Anyone explain me D Part pls?
•  » » 15 months ago, # ^ |   0 First try to solve it for distinct elements.Traverse the multiples of every element and check whether this multiple is present in your array or not. If it is present then mark in your visited array that this element will not contribute in my answer. Your answer will be the n — sum(visited, visited + 1e6)
 » 15 months ago, # |   +8 Is it possible to find english editorials for ‌AtCoder contests? I want the editorial for E and F.
•  » » 15 months ago, # ^ |   0 Just copy the Japanese text, and google translate it! I did the same, I think it's manageable
•  » » » 15 months ago, # ^ |   0 Thanks
•  » » 15 months ago, # ^ |   +8 check the editorial now, they have added english editorial too
 » 15 months ago, # | ← Rev. 2 →   0 Can someone provide some test cases for problem F?Here is my submission (though i don't think it will help), I've used a dijkstra-based approach here.My solution passes all TCs except 3, so i suspect that it may be failing on a corner case.Any Help is appreciated.
•  » » 15 months ago, # ^ |   +3 A small test case where your solution fails: TestInput: 5 6 9 5 3 2 2 .@...@ ...@@. @.@@@@ ...@@@ @..... Expected output: 2 Your output: 3
•  » » » 15 months ago, # ^ |   0 Thanks man!
 » 15 months ago, # |   -7 Anyone looking for readable code, go through AshishGup submissions, they are the most readable that i found.
•  » » 15 months ago, # ^ |   0 Thanks a lot for pointing it out. I learnt a lot from his solution to problem E.
 » 15 months ago, # |   +8 Where can I get editorials for the contest in English?? Specially for problems E and F!
•  » » 15 months ago, # ^ |   +10 Here. English editorial starts from page 7.
•  » » » 15 months ago, # ^ |   0 Oh Thanks, man!!
 » 15 months ago, # |   +13 Problem F is the same as 877D - Olya and Energy Drinks!
 » 15 months ago, # |   +1 For Problem D:It could be done so easily using dp and sieve method. Couldn’t realise on contest time :') Though dp is really <3 . Submission
•  » » 15 months ago, # ^ |   0 can you explain the logic..??
•  » » » 15 months ago, # ^ |   0 Yes it's similar to sieve of eratosthenes algorithm. We sorted the array here and marked every multiple upto largest element here.for 3 8 12 16 :we mark 3,6,9,12,15 and then 8,16..So finally we have 3=1,8=1,12=2,16=2. So it is clear 16,12 have multiple but 3 & 8 doesn’t have any multiple here. So, ans=2.
•  » » » » 15 months ago, # ^ |   0 Yeah I have got it..
 » 15 months ago, # | ← Rev. 2 →   0 Test cases of the contest are not seen on dropbox. It shows that the file extension is not correct. Please fix it chokudai.I had faced a similar problem to open test case file on other contests too.
•  » » 15 months ago, # ^ |   0 It's accessible. You can check it here https://www.dropbox.com/sh/arnpe0ef5wds8cv/AACojGo4PhS93VqRGOYIT9tGa/ABC170?dl=0&subfolder_nav_tracking=1
•  » » » 15 months ago, # ^ | ← Rev. 2 →   0 No, still not accessible to problem D and E.
 » 15 months ago, # | ← Rev. 2 →   0 Here is my submission for problem E. I used the approach of having vector of multisets and erasing the maximum and inserting again for every kindergarden using the approach mentioned in the tutorial, but i am getting TLE. Can someone help me why i am getting TLE.
 » 15 months ago, # |   0 Why my solution is wrong for problem D?
•  » » 15 months ago, # ^ | ← Rev. 2 →   0 For input: 4 2 3 5 5 Your code outputs 3, output should be 2.
 » 15 months ago, # | ← Rev. 2 →   0 What's wrong in my F submission?
•  » » 15 months ago, # ^ |   +3 A small test for which your solution fails: TestInput: 15 19 5 10 15 5 7 .@@@.@..@@...@.@@@@ @@@..@@...@...@.@.. @@.@@..@@..@@..@.@@ .@@@@@..@@...@.@... @...@@.@...@....@.. .@@.@@.@........@@. ....@........@@.@.. .@@.@@..@@@@@@@.@@. @..@....@@.@.@..@@@ @...@....@.....@.@@ ..@@.@..@@....@@.@@ .@..@...@@..@.@...@ @..@.@@@.@.@.@@.@@@ @..@.@.....@@.@.@.. ..@@@@...@@@@@@.... Your output: 8Expected output: 7
 » 15 months ago, # | ← Rev. 2 →   0 Can someone provide me the link to that AC code for problem E in today's beginner contest which has used ordered multiset ( i.e. they should have used policy based data structures ) ?It would be of great help.I have solved the question using STL's multiset....but it's just that I'm curious about using them.
 » 15 months ago, # |   0 My accepted solution for Olya and Energy Drinks gives wrong answer on 2 testcases of problem F while the one using std::set approach passes. Why? :/
•  » » 15 months ago, # ^ |   0 A small test where your solution fails: TestInput: 9 10 2 9 2 2 7 @@@@@.@... @......... ..@.@@@... .@@@..@@@. .......... ....@@@.@@ @@....@... .......... ....@@@... Expected output: 10Your output: 11
•  » » 15 months ago, # ^ | ← Rev. 2 →   0 MikeMirzayanov It seems like the problem 877D - Olya and Energy Drinks has weak test cases. My AC submission on codeforces also gave WA on AtCoder. An example of a failed test case is the following one provided to me by dush1729: Input5 5 2 ..... ...## #.... ..... ..... 5 1 1 5  Expected Output4The following submission of mine outputs 5: 47925337, but it still gets AC on codeforces. I request you to add the above test case to 877D - Olya and Energy DrinksEDIT: Here's another test case which ShafinKhadem has mentioned in the comment just above mine: Input9 10 2 #####.#... #......... ..#.###... .###..###. .......... ....###.## ##....#... .......... ....###... 9 2 2 7  Expected Output10My AC code 47925337 outputs 11 on this.
 » 15 months ago, # | ← Rev. 2 →   +3 Why my submission for F works corectly locally, but CE on atcoder ?
•  » » 15 months ago, # ^ |   0 Which compiler are you using to compile locally? Your code gives me compile error locally, when I use GCC 9.3.0.
•  » » » 15 months ago, # ^ | ← Rev. 2 →   0 gcc 5.1.0, is my version too old ?
•  » » » » 15 months ago, # ^ |   0 I won't say too old, but I think it's better to use updated version.
•  » » » » » 15 months ago, # ^ |   0 Thanks, I'll update it.
•  » » » » 15 months ago, # ^ |   +3 Hi, I just tried compiling your code using GCC 5.1.0 too in godbolt. It gives compile error there. But in codeforces custom test, it compiles successfully. Which operating system are you using? Maybe your code gives CE only in linux.
•  » » » » » 15 months ago, # ^ |   0 I think you're right, my operating system is win7.
•  » » » » » 15 months ago, # ^ | ← Rev. 2 →   +3 I found the reason! There is a header file called mathcalls.h in Linux and it has a function declared as double y1(double), so we cannot use #include and declare y1 as a global variable at the same time in Linux!
•  » » » » » » 15 months ago, # ^ |   0 A solution to this: add #define y1 yyyy1` in your template
•  » » » » » 15 months ago, # ^ |   0 Thanks a lot!
 » 15 months ago, # |   0 Can someone please tell what is wrong in my code for problem F? Link to my submission-->Link Any help will be highly appreciated. Thanks!
 » 15 months ago, # |   0 Hey ! Please provide copy button (for sample test case in Tasks for printing).
•  » » 15 months ago, # ^ |   0 It's already provided. (Actually, twice each)
•  » » » 15 months ago, # ^ | ← Rev. 2 →   +8 I was talking about tasks for printing section
•  » » » » 15 months ago, # ^ |   +3 I see. Perhaps it's no use writing here, and there's no official place to make suggestions, so maybe you have to write a UserScript or something...
 » 15 months ago, # |   -10 can someone plz check my solution for problem D: three different way: 2 of which resulted in WA and 1 is rightapproach 1:wrong answer O(n*sqrt(n))::approach 2:wrong answer2 tried to optimised sieve ::approach 3:correct@ShafinKhadem @chokudai
 » 15 months ago, # |   0 If anyone need Problem D explanation with complexity analysis Here
 » 15 months ago, # |   0 I had problem with C — Forbidden List I kinda ignored the part with abs_value just compared X and input array with a pre-made array (value set to 1-100). (code )since the input was limited i was pretty sure it will never get time limit error, it was wrong answer for two test cases and runtime error for two.
 » 15 months ago, # |   0 Can someone help me with the code of problem F?I dont konw why the second code will get wrong answer.The only difference between them is the transfers about direction.I think it just needs more time to run but not to mislead the answer. Can someone help me plzzz?Thanks a lot.