답안 #34357

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
34357 2017-11-10T16:43:43 Z bnahmad15 Calvinball championship (CEOI15_teams) C++14
20 / 100
1000 ms 2520 KB
#include <bits/stdc++.h>
using namespace std;

int n;
const int MOD = 1000007;
long long cnt = 1;
vector<int> ar;
vector<int> hhh;

void rec(int idx,int ce){
	if (idx == n){
		if (hhh==ar){
			printf("%d",cnt);
			exit(0);
		}
		cnt = (cnt+1)%MOD;
		return ;
	}
	for (int i=1;i<=ce;i++){
		hhh[idx]=i;
		rec(idx+1,max(i+1,ce));
	}
}
int main(){

	scanf("%d",&n);
	ar.resize(n);
	hhh.resize(n);
	for (int i = 0;i < n;i++)
		scanf("%d",&ar[i]);
	rec(0,1);

	return 0;
}

Compilation message

teams.cpp: In function 'void rec(int, int)':
teams.cpp:13:19: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
    printf("%d",cnt);
                   ^
teams.cpp: In function 'int main()':
teams.cpp:26:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
teams.cpp:30:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&ar[i]);
                     ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2016 KB Output is correct
2 Correct 0 ms 2016 KB Output is correct
3 Correct 0 ms 2016 KB Output is correct
4 Correct 0 ms 2016 KB Output is correct
5 Correct 0 ms 2016 KB Output is correct
6 Correct 0 ms 2016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2016 KB Output is correct
2 Correct 0 ms 2016 KB Output is correct
3 Correct 0 ms 2016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 243 ms 2016 KB Output is correct
2 Correct 0 ms 2016 KB Output is correct
3 Execution timed out 1000 ms 2016 KB Execution timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2504 KB Execution timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2128 KB Execution timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2520 KB Execution timed out
2 Halted 0 ms 0 KB -