Tutorial is loading... author:zwezdinv, developer:zwezdinv Tutorial is loading... author:RedMachine-74, developer:RedMachine-74 Tutorial is loading... author:platelet, developer:errorgorn Tutorial is loading...
2025=45*45 perhaps the only square number year throughout my lifetime... → Reply » noimi 5 months ago, hide # | +44 https://codeforces.com/blog/entry/137621?#comment-1233118 Is this means that intended solution for I2 is broken? If so, how do we treat about this is it ...
[CodeForces] The Number Of Good Substrings Problem Key idea: 1. for any substring s, if we can do not consider padding prefix 0s, its decimal value is always >= its length. 2. Appending a binary digit means multiply a number by 2 (and plus 1 if appending 1). This will double the...
You are given an array of length n: a1,a2,…,an. Append at most 3 elements to it to make it good. Appended elements don't have to be different. It can be shown that the solution always exists under the given constraints. If there are different solutions, you are allowed to output ...
You do not need to minimize the number of operations. It can be proven that a solution always exists. 输入数据 1 4 4 2 3 5 5 2 4 8 5 3 4 343 5 6 3 31 5 17 Copy 输出数据 1 4 1 2 1 1 2 2 3 0 0 5 1 3 1 4 2 1 5 4 3 7 3 1 29 2 5 3 3 ...
CodeForces Algorithms. Contribute to m-aprameya/CodeForces development by creating an account on GitHub.
CodeForces Algorithms. Contribute to m-aprameya/CodeForces development by creating an account on GitHub.
Codeforces Round #536 (Div. 2)C. Lunar New Year and Number Division【贪心】 思路:根据题意,我们肯定将其分成n/2 个集合,这样平方和才会小,我们将其排序,然后不断将一个小的和一个大的组成一个集合,这样最后将其平方相加就行了,注意范围。下面是证明,感兴趣可以看一下 ... ...
inlinevoidsolution(){intn,k,idx{};cin>>n>>k;vector<int>v;for(inti=0;i<n;++i){if(i&1){cout<<idx+1<<' ';++idx;}else{cout<<n-idx<<' ';}}cout<<'\n';} C. Koxia and Number Theory 题意 Joi有一个包含n个正整数的数组a。Koxia希望你确定是否存在一个正整数x>0,使得对于所有...
In yesterday’s Educational Round, Problem C had an intended Binary Search solution. However, I found a C++ solution that performed a linear search and still passed. I attempted to generate a test case that would cause TLE for that solution, and after several tries, I successfully hacked it...