104552024-04-02 22:12:51111Fibonacci Sequencescpp17Time limit exceeded 25/1002.099s3256 KiB
#include<bits/stdc++.h>
using namespace std;

#define int long long

vector<int>f;

int solve(int x){
	if(x==1||x==2){
		return 1;
	}
	int ans=0;
	for(int i:f){
		if(i==1){
			continue;
		}
		if(x%i){
			continue;
		}
		ans+=solve(x/i);
	}
	return ans;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	f.push_back(1);
	f.push_back(2);
	for(int i=0;i<30;i++){
		f.push_back(*--f.end()+*----f.end());
	}
	int T;
	cin>>T;
	while(T--){
		int M;
		cin>>M;
		cout<<solve(M)<<'\n';
	}
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1900 KiB
2Time limit exceeded2.099s1260 KiB
subtask225/25
3Accepted9ms2292 KiB
4Accepted30ms2376 KiB
5Accepted41ms2512 KiB
6Accepted20ms2608 KiB
subtask30/25
7Accepted1.07s2728 KiB
8Time limit exceeded2.039s2836 KiB
9Accepted1.246s2908 KiB
10Accepted1.024s3140 KiB
subtask40/25
11Time limit exceeded2.04s3104 KiB
12Time limit exceeded2.076s3100 KiB
subtask50/25
13Time limit exceeded2.099s3256 KiB
14Time limit exceeded2.073s2444 KiB