ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

「游记」Codeforces Round #729 (Div. 2)

2021-07-04 19:02:05  阅读:178  来源: 互联网

标签:25 when 个数 Codeforces smallest new Div 729 mod


水平还是菜啊,开始25分钟做了A和B,直到结束也就只做了A和B,加完rating还是newbie,我太菜了QwQ

A. Odd Set

问给出的 \(2*n\) 个数之间能否两两配对出 \(n\) 个奇数。显然是奇数个数等于偶数个数的情况,2分钟A掉了

B. Plus and Multiply

赛时想了个做法,感觉是对的,感觉很合理,但没有严格证明。25分钟的时候交了一发过了。

官方题解也是这个思路,证明如下↓

First judge specially if \(b=1\).

Let's consider when \(n\) is in \(S\). The answer is when the smallest number \(m\) in \(S\) that \(n\mod b=m \mod b\) is less than \(n\). It's easy to see that a new case of \(x \mod b\) can only appear when you use \(×a\) to generate a new element. So the smallest number \(m\) in \(S\) that \(m \mod b=k\) must be a power of \(a\).

Find all powers of \(a\) that is smaller than \(n\). If there is one \(m=ak\) that \(n \mod b=m \mod b\), the answer is yes. Otherwise it's no. Time complexity is \(O(logn)\).

C. Strange Function

就是想不出来怎么做。赛时打了个表,发现极其有规律,但无从下手。

思考

For a given \(x\), when is \(f(n)\) equal to \(x\)?

标签:25,when,个数,Codeforces,smallest,new,Div,729,mod
来源: https://www.cnblogs.com/wzsyyh/p/14969610.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有