답안 #62610

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
62610 2018-07-29T10:42:46 Z 검수컵(#1978, imsifile) 십자가 놓기 (FXCUP3_cross) C++
22 / 100
1000 ms 572 KB
#include<stdio.h>
#include<memory.h>

typedef long long lld;
const lld mod = 1000000007;

int N, ba[111]; lld dap=0;

void dfs(int ix){
	if(ix==N){
		dap++;
		return;
	}
	for(int i=0; i<4; i++){
		if(ix>0 && (i==2 && ba[ix-1])) continue;
		if(ix>0 && (i && ba[ix-1]==2)) continue;
		if(ix>0 && i==ba[ix-1] && i) continue;
		if(ix>1 && i==ba[ix-2] && i) continue;
		ba[ix]=i;
		dfs(ix+1);
		ba[ix]=0;
	}
}

int main(){
	scanf("%d", &N); N-=2;
	dfs(0);
	printf("%lld\n", dap%mod);
	return 0;
}

Compilation message

cross.cpp: In function 'int main()':
cross.cpp:26:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N); N-=2;
  ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 572 KB Output is correct
5 Correct 3 ms 572 KB Output is correct
6 Correct 2 ms 572 KB Output is correct
7 Correct 2 ms 572 KB Output is correct
8 Correct 2 ms 572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 572 KB Output is correct
5 Correct 3 ms 572 KB Output is correct
6 Correct 2 ms 572 KB Output is correct
7 Correct 2 ms 572 KB Output is correct
8 Correct 2 ms 572 KB Output is correct
9 Correct 5 ms 572 KB Output is correct
10 Execution timed out 1079 ms 572 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 3 ms 572 KB Output is correct
5 Correct 3 ms 572 KB Output is correct
6 Correct 2 ms 572 KB Output is correct
7 Correct 2 ms 572 KB Output is correct
8 Correct 2 ms 572 KB Output is correct
9 Correct 5 ms 572 KB Output is correct
10 Execution timed out 1079 ms 572 KB Time limit exceeded
11 Halted 0 ms 0 KB -