답안 #1072788

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1072788 2024-08-24T04:51:55 Z thinknoexit Fibonacci representations (CEOI18_fib) C++17
5 / 100
105 ms 3252 KB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int f[22];
map<int, int> mp;
int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    f[1] = 1, f[2] = 2;
    for (int i = 3;i <= 20;i++) f[i] = f[i - 1] + f[i - 2];
    for (int i = 0;i < (1 << 20);i++) {
        int res = 0;
        for (int j = 1;j <= 20;j++) {
            if (i & (1 << (j - 1))) res += f[j];
        }
        mp[res]++;
    }
    int n;
    cin >> n;
    for (int i = 1, sum = 0;i <= n;i++) {
        int x;
        cin >> x;
        sum += f[x];
        cout << mp[sum] << '\n';
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 1620 KB Output is correct
2 Correct 105 ms 1616 KB Output is correct
3 Correct 102 ms 1620 KB Output is correct
4 Correct 103 ms 1616 KB Output is correct
5 Correct 102 ms 1784 KB Output is correct
6 Correct 102 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 1620 KB Output is correct
2 Correct 105 ms 1616 KB Output is correct
3 Correct 102 ms 1620 KB Output is correct
4 Correct 103 ms 1616 KB Output is correct
5 Correct 102 ms 1784 KB Output is correct
6 Correct 102 ms 1620 KB Output is correct
7 Correct 101 ms 1728 KB Output is correct
8 Incorrect 102 ms 1616 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 104 ms 1776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 1620 KB Output is correct
2 Correct 105 ms 1616 KB Output is correct
3 Correct 102 ms 1620 KB Output is correct
4 Correct 103 ms 1616 KB Output is correct
5 Correct 102 ms 1784 KB Output is correct
6 Correct 102 ms 1620 KB Output is correct
7 Correct 101 ms 1728 KB Output is correct
8 Incorrect 102 ms 1616 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 100 ms 3252 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 1620 KB Output is correct
2 Correct 105 ms 1616 KB Output is correct
3 Correct 102 ms 1620 KB Output is correct
4 Correct 103 ms 1616 KB Output is correct
5 Correct 102 ms 1784 KB Output is correct
6 Correct 102 ms 1620 KB Output is correct
7 Correct 101 ms 1728 KB Output is correct
8 Incorrect 102 ms 1616 KB Output isn't correct
9 Halted 0 ms 0 KB -