Submission #34357

#TimeUsernameProblemLanguageResultExecution timeMemory
34357bnahmad15Calvinball championship (CEOI15_teams)C++14
20 / 100
1000 ms2520 KiB
#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)

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]);
                     ^
#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...