104532024-04-02 21:21:27111Fibonacci Sequencescpp17Time limit exceeded 25/1002.099s2892 KiB
#include<bits/stdc++.h>
using namespace std;

#define int long long

int solve1(int x);
int solve2(int x,int y);

int solve1(int x){
	int ans=x==1;
	for(int i=(x+1)/2;i<x;i++){
		ans+=solve2(i,x);
	}
	return ans;
}

int solve2(int x,int y){
	if(x<=0){
		return 0;
	}
	int ans=0;
	if(x*2==y){
		ans+=solve1(x);
	}
	ans+=solve2(y-x,x);
	return ans;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int T;
	cin>>T;
	while(T--){
		int M;
		cin>>M;
		cout<<solve1(M)<<'\n';
	}
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms2028 KiB
2Time limit exceeded2.099s1324 KiB
subtask225/25
3Accepted35ms2328 KiB
4Accepted109ms2440 KiB
5Accepted82ms2540 KiB
6Accepted81ms2608 KiB
subtask30/25
7Time limit exceeded2.065s2812 KiB
8Time limit exceeded2.072s2728 KiB
9Time limit exceeded2.056s2736 KiB
10Time limit exceeded2.058s2004 KiB
subtask40/25
11Time limit exceeded2.065s2884 KiB
12Time limit exceeded2.078s2892 KiB
subtask50/25
13Time limit exceeded2.078s2128 KiB
14Time limit exceeded2.078s2216 KiB