We will hold AtCoder Beginner Contest 363.

- Contest URL: https://atcoder.jp/contests/abc363
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20240720T2100&p1=248
- Duration: 100 minutes
- Writer: Nyaan, math957963, physics0523
- Tester: MtSaka, Aus21
- Rated range: ~ 1999
- The point values: 100-200-300-350-450-500-675

We are looking forward to your participation!

GL & HF!

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

famous last words

I did it, I am now a blue name 2 Kyu.

Oh!Good luck!

I hope I can get a good grade.

残阳如血？

I hope too.

Yes, you are right.

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

675 pts G! Wow!

Good Luck!

Palindromeforces

Palindrome, Palindrome & Palindrome XD

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

Me, who don't know how to generate the permutations o_o

Use

`next_premutation()`

in C++.could you please tell whats wrong in my code

https://pastebin.com/BwTx5H8w#google_vignette

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

orz

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

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

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.

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.

getting 1 testcase wrong in D please help to make correction

submission:code

thanks

Input — n = 109

Correct Output — 999

Your Output — 9

thanks, i get it the mistake was for cases having first digit = 1

I solved ABCE

my approach for C is as follows

`next_permutation`

are there any easier solutions ?

brute force palindrome checking also works for the constraints

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; }

Put your code like this:

or this:

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.

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

I bet It takes about 1-2 hours.

You're right, that's fast.

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.

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.

How to solve F?

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

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.

How to solve D ?

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

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

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$$$.

https://atcoder.jp/contests/abc363/submissions/55833508 but still i am getting wrong answer on 1 test case

thanks i got

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()"

is D solvable by digit dp ?

[NEVER MIND]

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

I TLE in D（cry

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??

yoo nvm im dumb