Submission #859473

#TimeUsernameProblemLanguageResultExecution timeMemory
859473naneosmicKangaroo (CEOI16_kangaroo)C++14
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #define int long long #define endl "\n" using namespace std; signed main(){ int n,cs,cf; cin>>n>>cs>>cf; vector<int>arr(n); for(int i=0;i<n;i++) arr[i]=i+1; int ans=0; do{ if(arr[0]!=cs)continue; if(arr[n-1]!=cf)continue; for(int i=1;i<n-1;i++){ bool a1=arr[i]<arr[i-1]; bool a2=arr[i]<arr[i+1]; if(!(a1^a2))continue; } ans++; }while(next_permutation(arr.begin(),arr.end())); cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...