From 5726fbeb718667cebdfbba701614ceeb6b2bb4c0 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Mon, 10 Oct 2016 01:40:59 +0800 Subject: [PATCH] Create 3561.cpp Goddamn SDUT OJ!!! Why not notify OIers use %lld instead of %I64d for long long ????!!!! GOD DAMNNNNNNN IT! --- SDUTOJ/3561.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 SDUTOJ/3561.cpp diff --git a/SDUTOJ/3561.cpp b/SDUTOJ/3561.cpp new file mode 100644 index 0000000..ca2755e --- /dev/null +++ b/SDUTOJ/3561.cpp @@ -0,0 +1,68 @@ +#include +#include +#include +#include +using namespace std; +typedef long long LL; + +LL a[50]; +LL b[50]; + +/// Print Table +void init() +{ + a[0]=1; + a[1]=2; + for(int i=2;i<48;i++) + { + a[i]=a[i-1]+a[i-2]; + } +} + +int _ans; +int dfs(LL cVal,int cidx,int bidx) +{ + if(cVal==0) + { + _ans=bidx;return 1; + } + if(cidx==-1) return 0; + for(int i=cidx;i>=0;i--) + { + if(cVal>=a[i]) + { + b[bidx]=a[i]; + int ret=dfs(cVal-a[i],i-1,bidx+1); + if(ret) return 1; + } + } + return 0; +} + +int main() +{ + init(); + int n; + scanf("%d",&n); + LL t; + for(int cc=0;cc