当前位置: 首页 > news >正文

济南网站建设抖音平台建设网站的功能及目的是什么

济南网站建设抖音平台,建设网站的功能及目的是什么,广州seo推广优化,wordpress 自学题目描述 把 1~9 这9个数字分成两组#xff0c;中间插入乘号#xff0c; 有的时候#xff0c;它们的乘积也只包含1~9这9个数字#xff0c;而且每个数字只出现1次。 比如#xff1a; 984672 * 351 345619872 98751 * 3462 341875962 9 * 87146325 784316925 … 符合这种…题目描述 把 1~9 这9个数字分成两组中间插入乘号 有的时候它们的乘积也只包含1~9这9个数字而且每个数字只出现1次。 比如 984672 * 351 345619872 98751 * 3462 341875962 9 * 87146325 784316925 … 符合这种规律的算式还有很多请你计算在所有这些算式中乘积最大是多少 输出 输出一个整数表示答案 代码如下 #include iostream #include cstring using namespace std; typedef long long LL; LL maxv -1; const int N 12; bool vis[N]; bool st[N];bool check(int suma, int sumc) {LL b (LL)suma * sumc;memset(vis, 0, sizeof(vis));//标记数组记得重置if (!b) {return false;}while (b) {if (vis[b % 10] || b % 10 0)return false;vis[b % 10] true;b b / 10;}for (int i 1; i 9; i) {if (!vis[i])return false;}return true; }void dfs_c(int u, int suma, int sumc) {//if (u 9) {if (u 9) { //边界不要弄错if (check(suma, sumc)) {maxv max((LL)suma * sumc, maxv);return ;}return ;}for (int i 1; i 9; i) {if (!st[i]) {st[i] true;dfs_c(u 1, suma, sumc * 10 i);st[i] false;}} }void dfs_a(int u, int suma) {if (u) {dfs_c(u, suma, 0);}for (int i 1; i 9; i) {if (!st[i]) {st[i] true;dfs_a(u 1, suma * 10 i);st[i] false;}} }int main() {dfs_a(0, 0);cout maxv endl;return 0; } #include iostream using namespace std; typedef long long LL; const int N 12; bool vis[N]; LL maxv -1;bool check_1(int suma,int sumc) {int st[N];memset(st,0,sizeof(st));//必不可少 // for (int i 1;i9;i)或者写成这样反正无论怎么写都要初始化为0 // { // st[i] 0 // }LL sumb suma*(LL)sumc;while(sumb){st[sumb%10];sumb sumb/10;}for (int i 1;i9;i){if (st[i]!1)return false;}return true; }void dfs_c(int u,int suma,int sumc) {if (u 9) return ;if (u9){if (check_1(suma,sumc) sumc!0){LL sumb (LL)suma*sumc;maxv max(maxv,sumb);return ;}}for (int i 1;i9;i){if (!vis[i]){vis[i] true;dfs_c(u1,suma,sumc*10i);vis[i] false;}} }void dfs_a(int u,int suma) {dfs_c(u,suma,0);for (int i 1;i9;i){if (!vis[i]){vis[i] true;dfs_a(u1,suma*10i);vis[i] false;}} }int main() {dfs_a(0,0);coutmaxvendl;return 0; }
http://www.pierceye.com/news/735415/

相关文章:

  • 站外seo推广游戏模板 wordpress
  • 做翻译网站 知乎怎么制作网站主题
  • 照片书那个网站做的好重庆网站建设价格费用
  • 网站两侧广告石家庄建设
  • 网站设计的企业网站建设教程txt
  • 大型建站公司seo查询5118
  • 百度站长提交工具中小企业建站模板
  • 企业网站西安seo服务
  • 做网站需要多少个人网站logo设计
  • 新浪云 建设网站中企动力双语网站
  • 网站建设中心网站开发前端工程师
  • 网站目录结构设计应注意的问题课程平台网站建设报价
  • 南京网站排名优化费用做网站大作业的心得体会
  • 网站 三合一高端的响应式网站建设公司
  • 网站设计公司天津网站备案不关站
  • 怎样增加网站会员量微信商城怎么进入
  • 网站建设目的功能行业门户网站源码
  • 建设网站收费标准100m做电影网站
  • 怎么样自己做最简单的网站wordpress酷黑主题
  • 长沙市建设网站网站修改域名
  • 邢台企业做网站价格如何做网络推广运营
  • 番禺网站建设服务百度广告推广价格
  • 什么系统做网站最安全网络科技网站设计
  • 通州网站建设是什么查看网站开发商
  • 建设网站公司浩森宇特怎么推广公司网站
  • 来宾住房和城乡建设网站变装第三性wordpress
  • 自己开发网站怎么开发站长工具网址是多少
  • 农业交易平台网站建设成都微信网站开发
  • 十大网站app软件网站建设企业的市场分析
  • 建设网站教程视频下载企业所得税税率2019