码迷,mamicode.com
首页 >  
搜索关键字:turn    ( 27138个结果
PAT Advanced 1049 Counting Ones (30) [数学问题-简单数学问题]
PAT 甲级 Advanced 1049 Counting Ones (30) [数学问题-简单数学问题] ...
分类:其他好文   时间:2020-02-04 12:22:44    阅读次数:65
Go 函数与闭包
函数 1.函数与闭包 go type iAdder func(int) (int, iAdder) func adder(base int) iAdder { return func(value int) (int, iAdder){ return base+value, adder(base+va ...
分类:其他好文   时间:2020-02-04 12:21:32    阅读次数:91
[题解] [JSOI2010] 找零钱的洁癖
"题面" 题解 说实话, 其实我也不知道这题正解是啥 你看着数据范围不像爆搜题 但是爆搜他就是可以过, 我也不知道为啥 奇葩 Code ...
分类:Web程序   时间:2020-02-04 11:03:48    阅读次数:104
336. Palindrome Pairs
Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + ...
分类:其他好文   时间:2020-02-04 10:47:17    阅读次数:71
Vue箭头函数
箭头函数 基本语法: ES6允许使用“箭头”(=>)定义函数 var f = a = > a //等同于 var f = function(a){ return a; } 如果箭头函数不需要参数或需要多个参数,就使用一个圆括号代表参数部分。 按 Ctrl+C 复制代码 按 Ctrl+C 复制代码 使 ...
分类:其他好文   时间:2020-02-04 10:44:40    阅读次数:95
PAT甲级 1028 List Sorting (25分)(cin cout 超时问题)
注意: 用scanf 和printf 进行输入输出 否则超时 cin,cout速度慢的原因就是它会将数据先读入缓冲区,然后再读入,所以与scanf的直接读入会有点时间差距。 1.换成scanf 和 printf输入输出 2.加一条语句 ios::sync_with_stdio(false); 题目代 ...
分类:其他好文   时间:2020-02-04 00:39:40    阅读次数:87
贪心算法
455. 分发饼干 假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。对每个孩子 i ,都有一个胃口值 gi ,这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j ,都有一个尺寸 sj 。如果 sj >= gi ,我们可以将这个饼干 j 分配给孩子 i ,这 ...
分类:编程语言   时间:2020-02-04 00:38:28    阅读次数:79
面向对象
1、原始代码 1 def school(name,addr,type): 2 def kao_shi(school): #功能性用函数 3 print('%s正在考试'%school['name']) 4 5 def zhao_sheng(school): 6 print('%s招生的地址是:%s' ...
分类:其他好文   时间:2020-02-04 00:30:39    阅读次数:65
Codechef TREDEG Trees and Degrees
"Link" 看到全是度数相关的计数就可以考虑Prufer序列。 一个点的度数就是其在Prufer序列中的出现次数$+1$,而一个Prufer序列的贡献就是其所有元素出现次数$+1$的乘积,我们可以把乘积拆开dp。 设$f_{x,i}$表示考虑前$x$个点,Prufer序列长度为$i$的答案之和。 ...
分类:其他好文   时间:2020-02-03 22:54:24    阅读次数:135
深搜--P1036选数
深搜中绝对会用到递归 因此本题也可以使用深搜来做 bool prime(int b) { memset(sz, true, sizeof(sz)); sz[1]=false; for (int i=2;i<=b;i++) { if (sz[i]) { for (int j=2*i;j<=b;j+=i ...
分类:其他好文   时间:2020-02-03 22:36:20    阅读次数:90
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!