(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #960028

#TimeUsernameProblemLanguageResultExecution timeMemory
960028ramalzaherKangaroo (CEOI16_kangaroo)C++14
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> using namespace std; //typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > ordered_set ; #define int long long #define F first #define S second #define rep(i , j , n ) for(int i = j ;i < n; i++ ) #define FOR(i , n ) rep(i ,0 , n ) #define sz size() #define pb push_back #define all(x) x.begin() , x.end() #define vi vector<int> #define yes cout<<"YES\n"; #define no cout<<"NO\n"; #define cans cout<<ans<<endl; #define forx(i, x) for(auto &i : x) #define fast #define pii pair<int ,int > #define endl "\n" #define sp ' ' #define test int t ; cin >> t ; while(t--) const int N = 300 ; const int inf = 1e15 ; int n , s ,e; int rec(int i , bool prev , int jumps ) { if(jumps==n-1)if(i==e)return 1 ;else return 0 ; if(i==0)return 0 ; int ans = 0 ; if(prev == 0 ){ rep(j , i+1 , n+1 ){ ans += rec(j, prev^1, jumps+1); } }else { rep(j , 0 , i ) {ans += rec(j , prev^1 , jumps+1 ) ; } } return ans ; } main() { cin >> n >> s >> e ; cout<<rec(s , 0 , 0 )/2; }

Compilation message (stderr)

kangaroo.cpp: In function 'long long int rec(long long int, bool, long long int)':
kangaroo.cpp:27:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   27 |     if(jumps==n-1)if(i==e)return 1 ;else return 0 ;
      |       ^
kangaroo.cpp: At global scope:
kangaroo.cpp:41:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   41 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...