# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34357 | bnahmad15 | Calvinball championship (CEOI15_teams) | C++14 | 1000 ms | 2520 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |