답안 #34348

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
34348 2017-11-10T15:29:56 Z mohammad_kilani Calvinball championship (CEOI15_teams) C++14
20 / 100
1000 ms 2652 KB
#include <bits/stdc++.h>
using namespace std;
#define mod 1000007
#define oo 2000000000
const int N = 1000010;
vector<int> arr;
int cur = 0 , n , d;
void solve(vector<int> &v,int i,int mx){
	if(i == n){
		cur++;
		cur %= mod;
		if(v == arr){
			cout << cur << endl;
			exit(0);
		}
		return;
	}
	for(int j=1;j<=mx+1;j++){
		v[i] = j;
		solve(v,i+1,max(mx,j));
	}
}

int main() {
	//freopen("in.txt","r",stdin);
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a;
		scanf("%d",&a);
		arr.push_back(a);
	}
	vector<int> v(n);
	solve(v,0,0);
	return 0;
}

Compilation message

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:29:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a);
                 ^
# 결과 실행 시간 메모리 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 2648 KB Execution timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2340 KB Execution timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 2652 KB Execution timed out
2 Halted 0 ms 0 KB -