|
0
|
|
+7
You can solve Problem D in O(n+A). This code spend 389ms to solve Problem D without any fast I/O. To precompute some number's smallest prime factor, using The sieve of Euler, time complexity is O(A). But it is not necessary to divided by smallest prime factor one by one, which using O(log(A)). You can precompute number x has how many smallest prime factor at the same time. |
|
0
It is not necessary to keep the amount of each type number unchanged, so just repalce all '2' to '1' is okay. Because it is a sudoku, each row, column and block has exactly one '1' and one '2'. |
|
+7
My solution to Problem D: Just replace all '2' into '1'. |
|
0
VERY OFFENSIVE |
|
+3
I think it is because that Problem A pretests are too weak. Many different main tests apend to system tests. |
|
+4
Keep coding, you will manage to get it after soon days. |
|
+5
Rating changes for the last round are temporarily rolled back. They will be returned soon. |
|
0
I just found out that I also misread. Thank you. |
|
На
BledDest →
Codeforces Round #608 (Div. 2, based on Municipal Stage of All-Russian Competitions for Schools, Saratov), 6 лет назад
+3
I think it is similar to 1251E2 - Voting (Hard Version). Actually, the most similar thing between these two problems is "I can't achieve it during the round". |
|
На
BledDest →
Codeforces Round #608 (Div. 2, based on Municipal Stage of All-Russian Competitions for Schools, Saratov), 6 лет назад
+11
Change your each "else if" to "if", a point can fit 1 or 2 "if" branch. |
|
На
BledDest →
Codeforces Round #608 (Div. 2, based on Municipal Stage of All-Russian Competitions for Schools, Saratov), 6 лет назад
+9
You can hack yourself to append you stronger test case to the system test, a good chance to try it. |
|
На
BledDest →
Codeforces Round #608 (Div. 2, based on Municipal Stage of All-Russian Competitions for Schools, Saratov), 6 лет назад
-28
Greedyforce! Problem A,B,C and D are all greedy! Because I am a noble man, I don't like greed. This is the reason why I failed in this round. |
|
0
|
|
0
It means that there are some bugs hiding in your code. The bugs may be some easily mistakes such as OVERFLOW, FORGET TO CLEAR MEMORY. Your wrong code with these mistakes can pass pretest data, but have high probability FST. The hacker is helping you to improve your program. This is the charm of Codeforces I think. |
|
+15
It is the first time I reach Purple, thanks to this interesting contest. |
|
+21
Thanks for your advice! |
|
+84
How to learn the culture of other countries? Google (×) Codeforeces (√) "Bonne chance et bonne note!" It is correct? |
|
0
dp[i][1]=dp[i-1][1]+cost(i,1); dp[i][2]=min(dp[i-1][1],dp[i-1][2])+cost(i,2); dp[i][3]=min(dp[i-1][1],dp[i-1][2],dp[i-1][3])+cost(i,3); cost(i,j) means the cost if let the i-th problem be solved by the j-th programmer. Easily to know that cost(i,j)=1-(id[i]==j). dp[i][1] from dp[i-1][1] means let [1,i] problems all be solved by programmer 1. dp[i][2] from dp[i-1][1] means let [1,i-1] problems all be solved by programmer 1, but the i-th problem start to become be solved by programmer 2. It means when you start to assign i-th problem to programmer 2, you cannot assign all j-th problem (j>i) to programmer 1. |
|
+1
You are also Chinese, so you can see this. https://www.cnblogs.com/KisekiPurin2019/p/11854682.html You can use dp to get the highest power of heroes which has at least i endurance. p[i] is the highest power which can beat i monsters in just one day. and then you can use greedy, each day try to move as more as possible. It means you have already beaten i-th monster, and you want to beat the j-th monster, today you move j-i blocks so the highest power is p[j-i], if p[j-1] < a[j], you need to wait until tomorrow and use your highest power hero p[1] to try to beat it. |
|
+6
dp[i][1] means the smallest cost which all [1,i] number return to its correct position and the i-th number(which is exactly i) belongs to the first Programmer. dp[i][2] means ... belongs to the second Programmer. dp[i][3] means ... belongs to the third Programmer. the ans is the smallest number among dp[n][1], dp[n][2] and dp[n][3]. if id[i]==1 and you want to let it still belong to the first Programmer, it cost none. Otherwise you will cost 1 unit. |
|
0
Excuse me for interrupting you. I think the Tutorial of Problem D may have something wrong. The ok function has two return values.
It is because var
It is because var So how to keep monotonicity? May someone help me? Thanks for your kindness. |