Submission #3713

#TimeUsernameProblemLanguageResultExecution timeMemory
3713gs13068Inherited disease (kriii1_I)C++98
1 / 1
0 ms1088 KiB
#include<cstdio> int main() { long long now=0,bef=0,fact=1; int i,n,a; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a); a--; bef+=fact; fact*=i; fact%=1000000007; now*=i; now+=a; now%=1000000007; printf("%lld ",(bef+now)%1000000007); } }
#Verdict Execution timeMemoryGrader output
Fetching results...