atcoder_official's blog

By atcoder_official, history, 4 months ago, In English

We will hold AtCoder Beginner Contest 363.

We are looking forward to your participation!

  • Vote: I like it
  • +153
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it +1 Vote: I do not like it

GL & HF!

»
4 months ago, # |
  Vote: I like it +22 Vote: I do not like it

I have a rating of 1598 and I'm sure I'm going to reach 2 Kyu this time.

»
4 months ago, # |
  Vote: I like it +1 Vote: I do not like it

I hope I can get a good grade.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I hope we can solve the ABCDEF and even G succesfully! Good luck, everyone!

»
4 months ago, # |
  Vote: I like it +17 Vote: I do not like it

675 pts G! Wow!

»
4 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Good Luck!

»
4 months ago, # |
  Vote: I like it +43 Vote: I do not like it

Palindromeforces

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Palindrome, Palindrome & Palindrome XD

»
4 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Felt E was easier than D, spent too much time in C thinking generating all permutations would TLE :/

»
4 months ago, # |
  Vote: I like it +30 Vote: I do not like it

First time among the top 5 on an Atcoder Contest! I just can't express the thrill I'm feeling when passing G!

»
4 months ago, # |
  Vote: I like it +7 Vote: I do not like it

Am I just a scrub, or is Python doomed to TLE for problem C?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I am so happy because I got AC in Task C.

»
4 months ago, # |
Rev. 2   Vote: I like it -7 Vote: I do not like it

You are right, but G is an easier version of this problem (that this problem is on a tree). I think many Chinese participants have seen this problem. (Though few people solved it) Atcoder, it's a good job and don't set problems like this again.

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

    Disagree with this opinion: don't set problems like this again.

    This problem('s statement) is much more beautiful than that (even if i am a Chinese, i still think the problem you mentioned is too complex for me to appreciate).

    And most of all, this is an atcoder BEGINNER contest (I do agree with that on a ARC or AGC original-idea-problem is important), reusing some beautiful ideas should be encouraged: If evan ABC could not introduce this one, how people around the world could know it.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

getting 1 testcase wrong in D please help to make correction

submission:code

thanks

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

I solved ABCE

my approach for C is as follows

  • try all the permutations using next_permutation
  • find the palindromes' sizes using manacher's algorithm for each string in the permutations
  • find if there are any sub-palindrome of size K or no, if you didn't find one, increase the result

are there any easier solutions ?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    brute force palindrome checking also works for the constraints

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why wrong D. I've checked it for one hour.

include<bits/stdc++.h>

using namespace std; typedef long long ll; ll n,cnt,l; int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); cin>>n; while(true){ l++; if(l==1){ if(n<=10){cout<<n-1; return 0;} cnt=10; }else{ ll dgt=(l+1)/2; ll sum=9*pow(10,dgt-1); if(cnt+sum<n) cnt+=sum; else{ ll nd=n-cnt; nd--; ll to=nd+pow(10,dgt-1); nd=to; string s=""; for(ll i=1;i<=dgt;i++){ if(nd%10==0) s="0"+s; else if(nd%10==1) s="1"+s; else if(nd%10==2) s="2"+s; else if(nd%10==3) s="3"+s; else if(nd%10==4) s="4"+s; else if(nd%10==5) s="5"+s; else if(nd%10==6) s="6"+s; else if(nd%10==7) s="7"+s; else if(nd%10==8) s="8"+s; else if(nd%10==9) s="9"+s; nd/=10; } cout<<s; if(l%2==1) for(ll i=s.size()-2;i>=0;i--) cout<<s[i]; else for(ll i=s.size()-1;i>=0;i--) cout<<s[i]; return 0; } } } return 0; }

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Put your code like this:

    ``` cpp
    #include<bits/stdc++.h>
    (more codes)
    ```
    

    or this:

    ~~~~~
    #include<bits/sdtc++.h>
    ~~~~~
    

    When you are using the wave line version, please make sure that there is at least one blanket line before and after it. No one likes reading a code like this.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Usually, how long does AtCoder take to updating ratings? New user here

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I bet It takes about 1-2 hours.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      You're right, that's fast.

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I like Codeforces and Atcoder very much,because the ratings is updated very fast.But Luogu is very famous for its slow calculation of ratings.

        • »
          »
          »
          »
          »
          4 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          However, the rating system of Luogu is still relatively new. But I agree that it's truly slow.

          As we can see, Luogu is not specifically designed for contests. I think I don't have any objections if the rating of this round is updated just before the next Rated round.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve F?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Probably there was an easier solution, but I wrote a dp(i, val) = can we have a string of length i with product = val? The transition is just to try using a divisor and it 'reverses' when you have (val / divisor) % reverse(divisor) == 0

    In my code, I also have to fix the middle element before calling the dp

    You can check out my code here

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

For problen F, I almost have the same idea as the editorial, but couldn't figure out the complexity, and thus missed the dfs+memorizarion method.

Learned a lot from this problem, thank you so much, atcoder team!

By the way, I think the complexity could be reduced from O(sqrt(N) * number of divisors of N), to O(number of divisors of N * number of divisors of N), because it is not necessary to check every integer from 2 to sqrt(n) when calling dfs. Instead, we can just find all the divisors of n at first, and then check these divisors every time when dfs is called.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve D ?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    dont think about palindrome just you have any number let say 235 then you can make two type of palindrome number from this 235532 and 23532 just this for every number

    code:code

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

https://atcoder.jp/contests/abc363/submissions/55829821 where i am doing wrong pls help problem f

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Same as mine (earlier submission).

    Of course, in the samples, $$$363=11\times3\times11$$$, but that's a misdirection. $$$363=363$$$ is also correct. The problem didn't force you to use asterisks.

    I found that problem during contest, and my friends have found this typical after contests: $$$114411$$$, it's just $$$114411$$$ and can't divide anymore (in the condition of the problem), but $$$114411$$$ itself is a possible string. Your program prints $$$-1$$$.

    Most of the F (WA*8) could be hacked on this number: $$$114411$$$, the correct output is $$$114411$$$.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I didn't solve problem F at that time,because I didn't know how to turn a long integer to a string. Now,I know "to_string()"

»
4 months ago, # |
  Vote: I like it +5 Vote: I do not like it

is D solvable by digit dp ?

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

[NEVER MIND]

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem E, I am getting runtime error on just 1 testcase on this submission. Can anyone figure out the bug?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I TLE in D(cry

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

i was wondering how many 5 digit palindromes would there be for problem D. Because i think that fixing the first and last number to be the same(going from 1 to 9), the middle 3 numbers would have to be palindromes as well and we already know 3 digit palindrome count is 90. But we would count '000' as a possibility as well right? So wouldnt that make the total number of 3 digit palindromes = 90+1 = 91 in this case? and final answer would be 9*91 = 819 5 digit palindromes instead of 900??

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

In problem F, Can someone help me find why this is giving WA?

I am not able to find any corner cases My Submission

Edit: Got it. Testcase where the code was failing for reference:131072