提交时间:2025-12-26 14:45:29

运行 ID: 77755

#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; }