文章
40
粉丝
512
获赞
13
访问
372.2k
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <stack>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#define maxn 300000 + 10
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int solve(int n){
int cnt = 0,sum = 1;
for(int i = 2; i <= n; i++) {
if(i % 5 == 0) {
int temp = i;
while(temp % 5 == 0) {
temp /= 5;
if(temp % 2 == 0)
temp /= 2;
else cnt ++;
}
sum = (sum * temp) % 10;
} else {
int temp = i;
while(cnt > 0 && temp % 2 == 0) {
temp /= 2;
cnt --;
}
sum = (sum * temp) % 10;
}
}
while(cnt > 0){
cnt--;
sum/=2...
登录后发布评论
暂无评论,来抢沙发