10453 | 2024-04-02 21:21:27 | 111 | Fibonacci Sequences | cpp17 | Time limit exceeded 25/100 | 2.099s | 2892 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 2028 KiB | ||||
2 | Time limit exceeded | 2.099s | 1324 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 35ms | 2328 KiB | ||||
4 | Accepted | 109ms | 2440 KiB | ||||
5 | Accepted | 82ms | 2540 KiB | ||||
6 | Accepted | 81ms | 2608 KiB | ||||
subtask3 | 0/25 | ||||||
7 | Time limit exceeded | 2.065s | 2812 KiB | ||||
8 | Time limit exceeded | 2.072s | 2728 KiB | ||||
9 | Time limit exceeded | 2.056s | 2736 KiB | ||||
10 | Time limit exceeded | 2.058s | 2004 KiB | ||||
subtask4 | 0/25 | ||||||
11 | Time limit exceeded | 2.065s | 2884 KiB | ||||
12 | Time limit exceeded | 2.078s | 2892 KiB | ||||
subtask5 | 0/25 | ||||||
13 | Time limit exceeded | 2.078s | 2128 KiB | ||||
14 | Time limit exceeded | 2.078s | 2216 KiB |