Submission #3536

# Submission time Handle Problem Language Result Execution time Memory
3536 2013-08-31T06:27:11 Z wurikiji Inherited disease (kriii1_I) C++
0 / 1
0 ms 1672 KB
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>

using namespace std;

const long long divv = 1000000007;

int main(void){
	int d;
	scanf("%d",&d);
	long long sum = 0;
	
	int prev;

	for(int i = 1 ;i <= d;i++)
	{
		int k;
		scanf("%d", &k);
		sum = 0;
		for(int j = 1 ;j < i;j++)
		{
			if( j == 1 )sum =1;
			else
				sum = (sum %divv + (j * (j-1)) %divv) %divv;
		}

		printf("%lld\n",(sum % divv + (sum * (prev-1)) % divv  + k % divv)%divv);
		prev = k;
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1672 KB Output isn't correct
2 Halted 0 ms 0 KB -