Submission #942875

# Submission time Handle Problem Language Result Execution time Memory
942875 2024-03-11T06:08:15 Z huyboy Fibonacci representations (CEOI18_fib) C++17
5 / 100
74 ms 16464 KB
#include <bits/stdc++.h>
 
using namespace std;

#define int long long

void solve(){
	
	
	vector<int> fb(101);
	fb[1] = 1;
	fb[2] = 2;
	for(int i = 3;i <= 100;i++){
		fb[i] = fb[i - 1] + fb[i - 2];
	}
	vector<int> dp(1000000);
	for(int mask = 0;mask < (1 << 20);mask++){
		int now = 0;
		for(int i = 0;i < 20;i++){
			if(mask >> i & 1){
				now += fb[i + 1];
			}
		}
		dp[now]++;
	}
	int n;
	cin >> n;
	int pref = 0;
	for(int i = 0;i < n;i++){
		int a;
		cin >> a;
		pref += fb[a];
		cout << dp[pref] << "\n";
	}
	
}
 
signed main(){
	
	ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	
	int t = 1;
	//~ cin >> t;
	while(t--){
		solve();
	}
}
	
# Verdict Execution time Memory Grader output
1 Correct 65 ms 8284 KB Output is correct
2 Correct 63 ms 8284 KB Output is correct
3 Correct 65 ms 8280 KB Output is correct
4 Correct 63 ms 8280 KB Output is correct
5 Correct 64 ms 8280 KB Output is correct
6 Correct 64 ms 8284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 65 ms 8284 KB Output is correct
2 Correct 63 ms 8284 KB Output is correct
3 Correct 65 ms 8280 KB Output is correct
4 Correct 63 ms 8280 KB Output is correct
5 Correct 64 ms 8280 KB Output is correct
6 Correct 64 ms 8284 KB Output is correct
7 Correct 63 ms 8284 KB Output is correct
8 Runtime error 74 ms 16212 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 70 ms 16208 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 65 ms 8284 KB Output is correct
2 Correct 63 ms 8284 KB Output is correct
3 Correct 65 ms 8280 KB Output is correct
4 Correct 63 ms 8280 KB Output is correct
5 Correct 64 ms 8280 KB Output is correct
6 Correct 64 ms 8284 KB Output is correct
7 Correct 63 ms 8284 KB Output is correct
8 Runtime error 74 ms 16212 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 69 ms 16464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 65 ms 8284 KB Output is correct
2 Correct 63 ms 8284 KB Output is correct
3 Correct 65 ms 8280 KB Output is correct
4 Correct 63 ms 8280 KB Output is correct
5 Correct 64 ms 8280 KB Output is correct
6 Correct 64 ms 8284 KB Output is correct
7 Correct 63 ms 8284 KB Output is correct
8 Runtime error 74 ms 16212 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -