Submission #3472

# Submission time Handle Problem Language Result Execution time Memory
3472 2013-08-31T06:01:47 Z waps12b Inherited disease (kriii1_I) C++
0 / 1
0 ms 1088 KB
#include<cstdio>

#define Mod 1000000007
#define ll long long
int main() {
	int n;
	scanf("%d", &n);
	ll ord = 1, tmp, tot = 0;
	for(int i = 1 ; i <= n ; i++) {
		scanf("%lld\n", &tmp);

		ll ans = tot+(ord-1)*i+tmp;
		printf("%lld\n", ans%Mod);
		if( i == 1 ) tot += 1;
		else tot += i*(i-1);
		tot %= Mod;
		ord = tmp;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -