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

福州p2p网站建设公司wordpress响应式后台

福州p2p网站建设公司,wordpress响应式后台,wordpress上传图片权限,idc 网站备案目录 1. 整数分解 ☆ 2. 二叉树的最小深度 ★★ 3. 找x ★★ 1. 整数分解 输入一个正整数#xff0c;将其按7进制位分解为各乘式的累加和。 示例 1#xff1a; 输入#xff1a;49 输出#xff1a;497^2示例 2#xff1a; 输入#xff1a;720 输出#xff1a;720… 目录 1. 整数分解  ☆ 2. 二叉树的最小深度 ★★ 3. 找x ★★ 1. 整数分解 输入一个正整数将其按7进制位分解为各乘式的累加和。 示例 1 输入49 输出497^2示例 2 输入720 输出7206*7^04*7^12*7^3 代码 #includestdio.h #define X 7int main() {int i 0;int mod, num;scanf(%d, num);printf(%d, num);while(num){mod num % X;num / X;if(mod 0)printf(%d*7^%d%c, mod, i, num 0 ? : \n);i;}return 0; } 输入输出 720 7206*7^04*7^12*7^3 2. 二叉树的最小深度 给定一个二叉树找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明叶子节点是指没有子节点的节点。 示例 1 输入root [3,9,20,null,null,15,7] 输出2示例 2 输入root [2,null,3,null,4,null,5,null,6] 输出5提示 树中节点数的范围在 [0, 105] 内-1000 Node.val 1000 代码 #include bits/stdc.h #define null INT_MIN using namespace std;struct TreeNode {int val;TreeNode* left;TreeNode* right;TreeNode(int x) : val(x), left(NULL), right(NULL) {} };class Solution { public:int minDepth(TreeNode *root){if (!root)return 0;int left minDepth(root-left);int right minDepth(root-right);return (left right) ? 1 min(left, right) : 1 left right;} };TreeNode* buildTree(vectorint nums) {TreeNode *root new TreeNode(nums[0]);queueTreeNode* q;q.push(root);int i 1;while(!q.empty() i nums.size()){TreeNode *cur q.front();q.pop();if(nums[i] ! null){cur-left new TreeNode(nums[i]);q.push(cur-left);}i;if(i nums.size() nums[i] ! null){cur-right new TreeNode(nums[i]);q.push(cur-right);}i;}return root; }int main() {Solution s;vectorint root {3,9,20,null,null,15,7};TreeNode* tree buildTree(root);cout s.minDepth(tree) endl;root {2,null,3,null,4,null,5,null,6};tree buildTree(root);cout s.minDepth(tree) endl;return 0; } 输出 2 5 3. 找x 题目描述 输入一个数n然后输入n个数值各不相同再输入一个值x输出这个值在这个数组中的下标从0开始若不在数组中则输出-1。 输入 测试数据有多组输入n(1n200)接着输入n个数然后输入x。 输出 对于每组输入,请输出结果。 样例输入 4 1 2 3 4 3 样例输出 2 代码 #include iostream using namespace std; int main() {int n 0;cin n;int *ptr new (nothrow) int[n];for (auto i 0; i n; i){cin ptr[i];}int x 0;cin x;auto j 0;auto status 0;for (; j n; j){if (ptr[j] x){status 1;break;}}if (status 0){j -1;}cout j endl;delete[] ptr;cin.get();cin.get();return 0; } 输入输出 4 1 2 3 4 3 2 附录 二叉树的序列化与反序列化 class Codec { public:     string serialize(TreeNode *root)     {         string result [;         queueTreeNode * myQue;         myQue.push(root);         while (!myQue.empty())         {             root myQue.front();             myQue.pop();             if (root NULL)             {                 result null,;                 continue;             }             else             {                 result to_string(root-val) ,;                 myQue.push(root-left);                 myQue.push(root-right);             }         }         if (result [null,)         {             result.resize(result.size() - 1);         }         else         {             int endIndex result.size() - 1;             while (result[endIndex] 0 || result[endIndex] 9)             {                 endIndex - 1;             }             result.resize(endIndex 1);         }         result ];         return result;     }     TreeNode *deserialize(string data)     {         vectorstring dataVec;         int dataSize data.size();         for (int index 1; index dataSize - 1; index)         {             string tempData ;             while (index dataSize - 1 data[index] ! ,)             {                 tempData data[index];             }             dataVec.push_back(tempData);         }         int dataVecSize dataVec.size();         queueTreeNode * myQue;         if (dataVec[0] null)         {             return NULL;         }         TreeNode *result new TreeNode(atoi(dataVec[0].c_str())), *tempPtr;         myQue.push(result);         for (int index 1; index dataVecSize; index)         {             tempPtr myQue.front();             myQue.pop();             if (dataVec[index] ! null)             {                 tempPtr-left new TreeNode(atoi(dataVec[index].c_str()));                 myQue.push(tempPtr-left);             }             index 1;             if (index dataVecSize dataVec[index] ! null)             {                 tempPtr-right new TreeNode(atoi(dataVec[index].c_str()));                 myQue.push(tempPtr-right);             }         }         return result;     } }; 每日一练刷题专栏 ✨ 持续努力奋斗做强刷题搬运工 点赞你的认可是我坚持的动力  ★ 收藏你的青睐是我努力的方向  ✏️ 评论你的意见是我进步的财富   C/C每日一练 专栏 Python每日一练 专栏
文章转载自:
http://www.morning.rnmyw.cn.gov.cn.rnmyw.cn
http://www.morning.kaoshou.net.gov.cn.kaoshou.net
http://www.morning.lwcqh.cn.gov.cn.lwcqh.cn
http://www.morning.jydhl.cn.gov.cn.jydhl.cn
http://www.morning.kjfqf.cn.gov.cn.kjfqf.cn
http://www.morning.tkztx.cn.gov.cn.tkztx.cn
http://www.morning.wrtbx.cn.gov.cn.wrtbx.cn
http://www.morning.tsynj.cn.gov.cn.tsynj.cn
http://www.morning.qgfhr.cn.gov.cn.qgfhr.cn
http://www.morning.lxfyn.cn.gov.cn.lxfyn.cn
http://www.morning.pflry.cn.gov.cn.pflry.cn
http://www.morning.rnnts.cn.gov.cn.rnnts.cn
http://www.morning.tpxgm.cn.gov.cn.tpxgm.cn
http://www.morning.jftl.cn.gov.cn.jftl.cn
http://www.morning.tqbyw.cn.gov.cn.tqbyw.cn
http://www.morning.sdktr.com.gov.cn.sdktr.com
http://www.morning.gjmbk.cn.gov.cn.gjmbk.cn
http://www.morning.jqbpn.cn.gov.cn.jqbpn.cn
http://www.morning.phxdc.cn.gov.cn.phxdc.cn
http://www.morning.rlzxr.cn.gov.cn.rlzxr.cn
http://www.morning.ppgdp.cn.gov.cn.ppgdp.cn
http://www.morning.fwdln.cn.gov.cn.fwdln.cn
http://www.morning.wmdqc.com.gov.cn.wmdqc.com
http://www.morning.mydgr.cn.gov.cn.mydgr.cn
http://www.morning.gbxxh.cn.gov.cn.gbxxh.cn
http://www.morning.wmnpm.cn.gov.cn.wmnpm.cn
http://www.morning.hrpjx.cn.gov.cn.hrpjx.cn
http://www.morning.zdqsc.cn.gov.cn.zdqsc.cn
http://www.morning.gnjtg.cn.gov.cn.gnjtg.cn
http://www.morning.kzhgy.cn.gov.cn.kzhgy.cn
http://www.morning.gnfkl.cn.gov.cn.gnfkl.cn
http://www.morning.xhgcr.cn.gov.cn.xhgcr.cn
http://www.morning.ywtbk.cn.gov.cn.ywtbk.cn
http://www.morning.nbnq.cn.gov.cn.nbnq.cn
http://www.morning.pcbfl.cn.gov.cn.pcbfl.cn
http://www.morning.klzt.cn.gov.cn.klzt.cn
http://www.morning.rpstb.cn.gov.cn.rpstb.cn
http://www.morning.lwhsp.cn.gov.cn.lwhsp.cn
http://www.morning.mqffm.cn.gov.cn.mqffm.cn
http://www.morning.bmtyn.cn.gov.cn.bmtyn.cn
http://www.morning.jbxmb.cn.gov.cn.jbxmb.cn
http://www.morning.nlrxh.cn.gov.cn.nlrxh.cn
http://www.morning.dnycx.cn.gov.cn.dnycx.cn
http://www.morning.nchsz.cn.gov.cn.nchsz.cn
http://www.morning.dlurfdo.cn.gov.cn.dlurfdo.cn
http://www.morning.zmqb.cn.gov.cn.zmqb.cn
http://www.morning.tpyrn.cn.gov.cn.tpyrn.cn
http://www.morning.mflhr.cn.gov.cn.mflhr.cn
http://www.morning.wsnjn.cn.gov.cn.wsnjn.cn
http://www.morning.hqsnt.cn.gov.cn.hqsnt.cn
http://www.morning.rhzzf.cn.gov.cn.rhzzf.cn
http://www.morning.kjlia.com.gov.cn.kjlia.com
http://www.morning.btwlp.cn.gov.cn.btwlp.cn
http://www.morning.qbpqw.cn.gov.cn.qbpqw.cn
http://www.morning.nwnbq.cn.gov.cn.nwnbq.cn
http://www.morning.yrccw.cn.gov.cn.yrccw.cn
http://www.morning.rhgtc.cn.gov.cn.rhgtc.cn
http://www.morning.wfjyn.cn.gov.cn.wfjyn.cn
http://www.morning.jcbmm.cn.gov.cn.jcbmm.cn
http://www.morning.kqblk.cn.gov.cn.kqblk.cn
http://www.morning.kskpx.cn.gov.cn.kskpx.cn
http://www.morning.phcqk.cn.gov.cn.phcqk.cn
http://www.morning.hnhsym.cn.gov.cn.hnhsym.cn
http://www.morning.zsleyuan.cn.gov.cn.zsleyuan.cn
http://www.morning.mrnnb.cn.gov.cn.mrnnb.cn
http://www.morning.phechi.com.gov.cn.phechi.com
http://www.morning.grryh.cn.gov.cn.grryh.cn
http://www.morning.bwrbm.cn.gov.cn.bwrbm.cn
http://www.morning.sqfnx.cn.gov.cn.sqfnx.cn
http://www.morning.ctqlq.cn.gov.cn.ctqlq.cn
http://www.morning.brwwr.cn.gov.cn.brwwr.cn
http://www.morning.c7507.cn.gov.cn.c7507.cn
http://www.morning.syrzl.cn.gov.cn.syrzl.cn
http://www.morning.jlthz.cn.gov.cn.jlthz.cn
http://www.morning.kaoshou.net.gov.cn.kaoshou.net
http://www.morning.ptysj.cn.gov.cn.ptysj.cn
http://www.morning.zknjy.cn.gov.cn.zknjy.cn
http://www.morning.bcnsl.cn.gov.cn.bcnsl.cn
http://www.morning.bzlgb.cn.gov.cn.bzlgb.cn
http://www.morning.lcxdm.cn.gov.cn.lcxdm.cn
http://www.tj-hxxt.cn/news/271261.html

相关文章:

  • 古镇企业网站建设定制网站主体负责人邮箱
  • 郑州区块链数字钱包网站开发多少钱视频娱乐模版网站购买
  • 展示型网站模板代码手机网页游戏排行榜前十
  • 网站建设视觉营销动态效果的网站建设技术
  • html5国外网站模板html源码下载松滋住房和城乡建设局网站
  • wap自助建站全国城市雕塑建设官方网站
  • 婚礼摄影网站源码j网站开发
  • 学校能建设网站吗网站备案需要资料
  • 网站怎样做 文件签收最新仿5173游戏装备交易网站 游戏币交易平台源码整合支付接口
  • 网站建设总结材料卡片风格网站
  • 网站rss地址生成开发者账号是干嘛用的
  • 南京江宁网站制作开发商破产房子烂尾怎么办
  • 哪家公司建换电站网页设计实用教程
  • 四川网站建设 旋风创建网页文件
  • 服务器怎么建设网站网站项目如何做需求分析报告
  • 博州住房和城乡建设局网站wordpress php后缀
  • app软件开发流程上海seo推广服务
  • 肇庆关键词网站排名公司做网站推广有效果吗
  • 个人商城网站制作费用网站后台软件可以自己做吗
  • 南昌市建设局网站营销策略4p
  • 网站设计的公司叫什么如何做h5简历制作网站
  • 学校网站建设说明食品网站建设策划书
  • lofter wordpressseo全网营销
  • 中国个人优秀网站大学生html网页设计期末作品
  • 溧阳市城乡建设局网站手机上如何上传wordpress
  • 网站首页用什么字体好协会网站建设方案
  • pos机网站建设方案爱丫爱丫在线观看视频
  • 做直播导航网站《网站开发与应用
  • 用手机做免费自助网站免费移动网站建站
  • seo网站建设 刘贺稳营销专家a婚庆门户源码v2.0 婚庆公司网站源码 婚庆网源码 婚庆门户网源码