mirror of
https://gitcode.com/Zengtudor/alg2025.git
synced 2025-11-10 00:21:49 +00:00
重构了P4818.cpp中的BFS算法,使用更清晰的队列结构和状态检查 修复了原代码中状态标记不正确的问题 添加了新的P6003.cpp文件实现二分查找算法 移除CMakeLists.txt中的sanitizer选项 修改P6003cal.cpp为使用固定输入值进行调试
21 lines
434 B
C++
21 lines
434 B
C++
#include <algorithm>
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include <iostream>
|
|
using ll = int64_t;
|
|
|
|
|
|
int main(){
|
|
ll n=100,k=100,m=1;
|
|
// std::cin>>n>>k>>m;
|
|
for(ll x=25;x<=25;x++){
|
|
ll g=0;
|
|
for(ll i=1;i<=k;i++){
|
|
ll y=(n-g)/x;
|
|
y=std::max(y,m);
|
|
g+=y;
|
|
printf("(n-g)=%lld, y=%lld, x=%lld\n",n-g,y,x);
|
|
}
|
|
printf("-- x=%lld, g=%lld\n\n",x,g);
|
|
}
|
|
}
|