Submission #3103

# Submission time Handle Problem Language Result Execution time Memory
3103 2013-08-25T07:27:13 Z ainta Inherited disease (kriii1_I) C++
0 / 1
0 ms 1088 KB
#include<stdio.h>
long long Mod=1000000007,n,k,i,a,S=1,F=1;
int main()
{
	scanf("%lld",&n);
	for(i=1;i<=n;i++){
		scanf("%lld",&k);
		k--;
		a=a*i+k;
		a%=Mod;
		printf("%lld\n",a+S);
		F*=i;
		S+=F;
		F%=Mod;
		S%=Mod;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Incorrect 0 ms 1088 KB Output isn't correct
3 Halted 0 ms 0 KB -