Submission #893691

#TimeUsernameProblemLanguageResultExecution timeMemory
893691vjudge1Kangaroo (CEOI16_kangaroo)C++17
6 / 100
2055 ms348 KiB
#include <bits/stdc++.h> #define ll long long #define all(a) a.begin(), a.end() #define F first #define S second #define pb push_back #define eb emplace_back #define ull unsigned long long #define ld long double #define lv v+v #define rv v+v+1 #define files freopen("expert.in", "r", stdin), freopen("expert.out", "w", stdout) using namespace std; const ll mod = 1e9 + 7; const ll N = 2e5 + 10; const ll P = 337ll; const ld EPS = 1e-9; const ll block = 450; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ll n; cin>>n; ll cs,cf; cin>>cs; cin>>cf; vector <ll> v; for(ll i = 1; i<=n; i++) { v.pb(i); } ll ans=0; do { vector <ll> check; if(v[0] != cs) { continue; } if(v[n-1] != cf) { continue; } for(ll i = 1; i<n; i++) { check.pb(v[i] > v[i-1]); } bool ok = true; for(ll i = 1; i<check.size(); i++) { ok&=(check[i] != check[i-1]); } if(ok) { ans++; } } while(next_permutation(all(v))); cout<<ans; return 0; } // equal, min, max, 1, random, build /* */

Compilation message (stderr)

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:45:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     for(ll i = 1; i<check.size(); 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...