Submission #34348

#TimeUsernameProblemLanguageResultExecution timeMemory
34348mohammad_kilaniCalvinball championship (CEOI15_teams)C++14
20 / 100
1000 ms2652 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...