Submission #9257

# Submission time Handle Problem Language Result Execution time Memory
9257 2014-09-28T05:05:38 Z shashack Phibonacci (kriii2_P) C++
0 / 4
1000 ms 1084 KB
#include <stdlib.h>
#include <stdio.h>

#define FOR(variable, start, end) for(int variable=(start); variable<=(end); ++variable)
#define LL long long 
using namespace std; // 700B

LL a, b, c, nf[4];

void pi(){
	nf[0] = 0;
	nf[1] = 0;
	nf[2] = 1;
	nf[3] = 1;
	FOR(i,1,a){
		nf[2] = nf[3];
		nf[0] = nf[1];
		nf[1] = nf[2];
		nf[3] = (nf[0] + nf[1]) % 1000000007;
	}
}

int main(){
	scanf("%lld%lld", &a, &b);

	pi();

	printf("%lld %lld\n", nf[1], nf[0]);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1084 KB Program timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -