This commit is contained in:
ninemine
2025-06-12 21:46:53 +08:00
parent 2cdf5db037
commit d7213d1d3e
8 changed files with 246 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
add_executable(TEST test.cpp)
add_executable(TEST test.cpp "test_sequence.cpp")
include_directories(${PROJECT_SOURCE_DIR}/Convention/[Runtime])
install(TARGETS TEST
install(TARGETS TEST
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

View File

@@ -1,6 +1,41 @@
#include"Config.hpp"
//#include"Config.hpp"
using namespace std;
#include <iostream>
#include<vector>
#include<map>
using namespace std;
using ll = long long;
int n = 0;
const int N = 1e6 + 2;
ll a[N], f[N];
int main()
{
}
// 请在此输入您的代码
map<int, int> flag;
cin >> n;
f[1] = 1;
f[2] = 1;
for (int i = 3; i <= n; i++)
{
f[i] = f[i - 1] + f[i - 2];
}
for (int i = 1; i <= n; i++)
{
int temp = 0;
cin >> temp;
if (temp % f[i] == 0)
{
flag[temp / f[i]]++;
}
}
int maxs = 0;
for (auto i = flag.begin(); i != flag.end(); ++i)
{
maxs = max(maxs, i->second);
}
cout << n - maxs;
return 0;
}

9
[Test]/test_sequence.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include"Generics/Sequence.hpp"
using namespace Convention::Generics;
using namespace std;
void main1()
{
}