답안 #3732

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
3732 2013-08-31T07:54:43 Z zzapcoder Inherited disease (kriii1_I) C++
컴파일 오류
0 ms 0 KB
#include <stdio.h>
#include <vector>
int  D;
std::vector<int> C;
std::vector<int> M;
std::vector<long long> NC;
int main()
{
	scanf("%d", &D);
	for ( int i = 0 ; i < D ; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		C.push_back(tmp);
	}

	M.push_back(0);
	NC.push_back(1);
	for ( int i = 1 ; i <= D ; i++)
	{
		NC.push_back( i * NC[i-1]%1000000007)  );

	}

	long long P = 0;
	long long PP = 0;
	long long PPP = 1;
	printf("%d\n", 1);
	PP = 1;

	for ( int i = 1 ; i < D ; i++)
	{
		P = PP;
		P += ((PPP-1)%1000000007)*((i+1)%1000000007));
		P += C[i]%1000000007);	

		printf("%d\n", P%1000000007);
		PP += NC[i+1]%1000000007;
		PPP = C[i]%1000000007;
	}
	return 0;

}

Compilation message

I.cpp: In function 'int main()':
I.cpp:21:42: error: expected ';' before ')' token
I.cpp:34:47: error: expected ';' before ')' token
I.cpp:35:23: error: expected ';' before ')' token
I.cpp:37:30: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat]
I.cpp:9:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
I.cpp:13:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]