alg2025/src/10/14/P6003cal.cpp
Zengtudor 1f0526403f refactor: 优化P4818.cpp的BFS逻辑并修复bug
重构了P4818.cpp中的BFS算法,使用更清晰的队列结构和状态检查
修复了原代码中状态标记不正确的问题
添加了新的P6003.cpp文件实现二分查找算法
移除CMakeLists.txt中的sanitizer选项
修改P6003cal.cpp为使用固定输入值进行调试
2025-10-16 10:28:04 +08:00

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);
}
}