摘要:
F: 操作数 题解:和刷气球那题一样,判断每个位置被更新的次数,如果是奇数输出1,偶数输出0 注意:用cin会超时 一、线段树 //注意laz[]要和线段树数组开一样大小 #include<iostream> #include<algorithm> #include<vector> #include 阅读全文
摘要:
C. Swap Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Monocarp has got two str 阅读全文
摘要:
W - Prime Time 题意:用公式n*n+n+41,判断素数的百分比 #include<iostream> #include<algorithm> #include<math.h> #include<string.h> #include<string> #define ll long lon 阅读全文
摘要:
A - Bi-shoe and Phi-shoe Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He n 阅读全文
摘要:
D. Treasure Island time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output All of us love treasur 阅读全文
摘要:
F. Fixing Banners time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output Harbin, whose name was 阅读全文
摘要:
一、满二叉树 一棵二叉树的结点要么是叶子结点,要么它有两个子结点(如果一个二叉树的层数为K,且结点总数是(2^k) -1,则它就是满二叉树。) 二、完全二叉树 若设二叉树的深度为k,除第 k 层外,其它各层 (1~k-1) 的结点数都达到最大个数,第k 层所有的结点都连续集中在最左边,这就是完全二叉 阅读全文
摘要:
题目描述 A newspaper is published in Walrusland. Its heading is s 1 , it consists of lowercase Latin letters. Fangy the little walrus wants to buy several 阅读全文
摘要:
一、选择排序 算法原理 比较未排序区域的元素,每次选出最大或最小的元素放到排序区域。 一趟比较完成之后,再从剩下未排序的元素开始比较。 反复执行以上步骤,只到排序完成。 时间复杂度 图示 代码: void quick_pow(int n,int a[]) { for(int i=0;i<n;i++) 阅读全文
摘要:
牛客网-看花 https://www.nowcoder.com/test/question/1d6f8e0e16de49d094d16057c92d49de?pid=17906015&tid=28876854 小明有一个花园,花园里面一共有m朵花,对于每一朵花,都是不一样的,小明用1~m中的一个整数 阅读全文