10455 | 2024-04-02 22:12:51 | 111 | Fibonacci Sequences | cpp17 | Time limit exceeded 25/100 | 2.099s | 3256 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1900 KiB | ||||
2 | Time limit exceeded | 2.099s | 1260 KiB | ||||
subtask2 | 25/25 | ||||||
3 | Accepted | 9ms | 2292 KiB | ||||
4 | Accepted | 30ms | 2376 KiB | ||||
5 | Accepted | 41ms | 2512 KiB | ||||
6 | Accepted | 20ms | 2608 KiB | ||||
subtask3 | 0/25 | ||||||
7 | Accepted | 1.07s | 2728 KiB | ||||
8 | Time limit exceeded | 2.039s | 2836 KiB | ||||
9 | Accepted | 1.246s | 2908 KiB | ||||
10 | Accepted | 1.024s | 3140 KiB | ||||
subtask4 | 0/25 | ||||||
11 | Time limit exceeded | 2.04s | 3104 KiB | ||||
12 | Time limit exceeded | 2.076s | 3100 KiB | ||||
subtask5 | 0/25 | ||||||
13 | Time limit exceeded | 2.099s | 3256 KiB | ||||
14 | Time limit exceeded | 2.073s | 2444 KiB |