1 solutions

  • 1
    @ 2025-8-21 14:11:47
    #include<bits/stdc++.h>
    using namespace std;
    int T,n;
    int main() {
    	ios::sync_with_stdio(false);
    	cin.tie(0);
    	cout.tie(0);
    	cin>>T;
    	while (T--) {
    		cin>>n;
    		if (n>=34) {
    			cout<<"0\n";
    		} else {
    			long long sum=1;
    			for (int i=1;i<=n;i++){
    				sum=sum*i%(1ll<<32);
    			}
    			cout<<sum<<"\n";
    		}
    	}
    	return 0;
    }
    • 1

    Information

    ID
    57
    Time
    2000ms
    Memory
    512MiB
    Difficulty
    6
    Tags
    (None)
    # Submissions
    52
    Accepted
    16
    Uploaded By