#include<bits/stdc++.h>
using namespace std;
int main(){
int fibonacci[21];
fibonacci[0] = 1;
fibonacci[1] = 1;
for(int i = 2; i <= 20; i++) fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
map<int, int> mp;
for(int i = 0; i < (1 << 20); i++){
int sum= 0;
for(int j =0 ; j < 20; j++){
if(i & (1 << j)){
sum += fibonacci[1 + j];
}
}
mp[sum]++;
}
int curSum = 0;
int n;
cin >> n;
for(int i = 0; i < n; i++){
int x;
cin >> x;
curSum += fibonacci[x];
cout << mp[curSum] << " ";
}
cout << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
1700 KB |
Output is correct |
2 |
Correct |
119 ms |
1744 KB |
Output is correct |
3 |
Correct |
118 ms |
1624 KB |
Output is correct |
4 |
Correct |
120 ms |
1604 KB |
Output is correct |
5 |
Correct |
122 ms |
1624 KB |
Output is correct |
6 |
Correct |
120 ms |
1752 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
1700 KB |
Output is correct |
2 |
Correct |
119 ms |
1744 KB |
Output is correct |
3 |
Correct |
118 ms |
1624 KB |
Output is correct |
4 |
Correct |
120 ms |
1604 KB |
Output is correct |
5 |
Correct |
122 ms |
1624 KB |
Output is correct |
6 |
Correct |
120 ms |
1752 KB |
Output is correct |
7 |
Correct |
118 ms |
1772 KB |
Output is correct |
8 |
Incorrect |
119 ms |
1732 KB |
Output isn't correct |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
125 ms |
3216 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
1700 KB |
Output is correct |
2 |
Correct |
119 ms |
1744 KB |
Output is correct |
3 |
Correct |
118 ms |
1624 KB |
Output is correct |
4 |
Correct |
120 ms |
1604 KB |
Output is correct |
5 |
Correct |
122 ms |
1624 KB |
Output is correct |
6 |
Correct |
120 ms |
1752 KB |
Output is correct |
7 |
Correct |
118 ms |
1772 KB |
Output is correct |
8 |
Incorrect |
119 ms |
1732 KB |
Output isn't correct |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
120 ms |
3156 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
1700 KB |
Output is correct |
2 |
Correct |
119 ms |
1744 KB |
Output is correct |
3 |
Correct |
118 ms |
1624 KB |
Output is correct |
4 |
Correct |
120 ms |
1604 KB |
Output is correct |
5 |
Correct |
122 ms |
1624 KB |
Output is correct |
6 |
Correct |
120 ms |
1752 KB |
Output is correct |
7 |
Correct |
118 ms |
1772 KB |
Output is correct |
8 |
Incorrect |
119 ms |
1732 KB |
Output isn't correct |
9 |
Halted |
0 ms |
0 KB |
- |