当前位置: 首页 > 网络知识

[luoguP1037] 产生数(floyd + 高精度)

时间:2026-01-29 09:38:10

传送门

先用 floyd 求出每一个数可以变成那些数。

然后利用乘法原理求解,需要高精度。

代码

#include <cstdio> #include <cstring> #include <iostream> using namespace std; const int MAXN = 101; char s[MAXN]; char c[MAXN]; int map[10][10]; inline char *read() struct Big_int inline void operator = (char *c) inline void operator = (int x) } inline void print() }; inline Big_int operator + (const Big_int x, const Big_int y) while(!ret.s[ret.idx 1] && ret.idx > 1) ret.idx; return ret; } inline bool operator < (const Big_int x, const Big_int y) inline Big_int operator (Big_int x, Big_int y) ret.s[i] = x.s[i] y.s[i]; } while(!ret.s[ret.idx 1] && ret.idx > 1) ret.idx; return ret; } inline Big_int operator * (const Big_int x, const Big_int y) while(!ret.s[ret.idx 1] && ret.idx > 1) ret.idx; return ret; } Big_int a, ans; int main() for(i = 0; i <= 9; i++) map[i][i] = 1; for(k = 0; k <= 9; k++) for(i = 0; i <= 9; i++) for(j = 0; j <= 9; j++) map[i][j] = map[i][j] || (map[i][k] && map[k][j]); ans = 1; k = strlen(s); for(i = 0; i < k; i++) ans.print(); return 0; }

  



上一篇:[luoguP1098] 字符串的展开(模拟)
下一篇:[luoguP2626] 斐波那契数列(升级版)(模拟)
Floyd 高精度
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器
  • 英特尔第五代 Xeon CPU 来了:详细信息和行业反应
  • 由于云计算放缓引发扩张担忧,甲骨文股价暴跌
  • Web开发状况报告详细介绍可组合架构的优点
  • 如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳
  • 美光在数据中心需求增长后给出了强有力的预测
  • 2027服务器市场价值将接近1960亿美元
  • 生成式人工智能的下一步是什么?
  • 分享在外部存储上安装Ubuntu的5种方法技巧
  • 全球数据中心发展的关键考虑因素
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器

    英特尔第五代 Xeon CPU 来了:详细信息和行业反应

    由于云计算放缓引发扩张担忧,甲骨文股价暴跌

    Web开发状况报告详细介绍可组合架构的优点

    如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳

    美光在数据中心需求增长后给出了强有力的预测

    2027服务器市场价值将接近1960亿美元

    生成式人工智能的下一步是什么?

    分享在外部存储上安装Ubuntu的5种方法技巧

    全球数据中心发展的关键考虑因素