标签:pac div using The pen 复杂 lse stream 岔路口
模拟就行……讲道理这个时间复杂度为啥是对的???
#include<iostream>
#include<cstdio>
using namespace std;
int k,n;
int dfs(int v)
{
if(v<=k)
return 1;
if((v-k)%2==0)
return (dfs((v-k)/2)+dfs((v+k)/2));
else
return 1;
}
int main()
{
scanf("%d%d",&n,&k);
printf("%lld",dfs(n));
return 0;
}
bzoj 1621: [Usaco2008 Open]Roads Around The Farm分岔路口【dfs】
标签:pac div using The pen 复杂 lse stream 岔路口
原文地址:https://www.cnblogs.com/lokiii/p/8963359.html