Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77755 sh25_shenpy 阶乘问题 C++ 通过 0 MS 244 KB 372 2025-12-26 14:45:29

Tests(1/1):


#include <bits/stdc++.h> using namespace std; typedef long long ll; ll k = 1; ll t = 1; int main() { int n; cin >> n; for(int i = 2; i <= n; i++) { int s = i; while(s % 10 == 0) s /= 10; while(s % 5 == 0 && t % 2 == 0) s /= 5, t /= 2; while(s % 2 == 0 && t % 5 == 0) s /= 2, t /= 5; t *= s; t %= 10000000; } cout << t % 10; return 0; }


测评信息: