题目 CF2B The least round way 做法 后面\(0\)的个数,\(2\)和\(5\)是\(10\)分解质因数 则把方格中的每个数分解成\(2\)和\(5\),对\(2\)和\(5\)求两边动规,得出最小值\(ans=min(num_2,num_5)\) 我们贪心地选择最小值所对应的\(2\)或\(5\),然后从\((n,n)\)按动规路径返回 Code #include<bits/stdc++.h> typedef int LL; const LL maxn=1e3+9;…
B. The least round way time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output There is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it that star…
[题解] 可以发现10的因数除了1和10之外只有2和5了,那么走过的路径上各个数字的2的因数个数之和.5的因数个数之和中较小的一个即是答案.这样的话DP即可.同时需要注意有0的情况,有0的时候有一个答案为1,要和前面求出的答案取较小值. #include<cstdio> #include<algorithm> #define LL long long #define rg register #define N 1010 using namespace std; int n,m,px…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…