Submission #34348

# Submission time Handle Problem Language Result Execution time Memory
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);
                 ^
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2016 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2648 KB Execution timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2340 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2652 KB Execution timed out
2 Halted 0 ms 0 KB -