码迷,mamicode.com
首页 >  
搜索关键字:magic squares    ( 1700个结果
Magic Stones CodeForces - 1110E (思维+差分)
E. Magic Stones time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output E. Magic Stones time limi ...
分类:其他好文   时间:2019-02-08 15:49:51    阅读次数:217
Codeforces Global Round 1
竟然又没掉? A Parity 先判断基数是奇数还是偶数,如果是偶数,其奇偶性显然只与个位的奇偶性相关,否则与所有数位的数的和的奇偶性相关。 E Magic Stones 先差分,然后发现操作的本质就是交换两个数,具体可以参考题解。 cpp include define qmin(x,y) (x=m ...
分类:其他好文   时间:2019-02-08 10:34:53    阅读次数:163
HDU - 5157 :Harry and magic string (回文树)
Sample Input aca aaaa Sample Output 3 15 题意: 多组输入,每次给定字符串S(|S|<1e5),求多少对不相交的回文串。 思路:可以用回文树求出以每个位置结尾的回文串数,那么累加得到前缀和; 倒着再做一遍得到每个位置为开头的回文串数,乘正向求出的前缀和即可。 ...
分类:其他好文   时间:2019-02-08 10:16:54    阅读次数:180
ZOJ-1177-K-Magic Number
就是分别以1到9作为开头构造结果,取最小答案。看了参考书之后才做出来,对参考书上的代码进行了一些改进 ...
分类:其他好文   时间:2019-01-30 21:44:37    阅读次数:115
2018 ACM/ICPC 南京 I题 Magic Potion
题解:最大流板题;增加两个源点,一个汇点。第一个源点到第二个源点连边,权为K,然后第一个源点再连其他点(英雄点)边权各为1,然后英雄和怪物之间按照所给连边(边权为1)。 每个怪物连终点,边权为1; 参考代码: 1 #include<bits/stdc++.h> 2 using namespace s ...
分类:其他好文   时间:2019-01-28 20:17:53    阅读次数:187
Jupyter 魔术命令(magic commands)
自动重新加载更改的模块 命令参数如下所示: %autoreload: 自动重载%aimport排除的模块之外的所有模块。 %autoreload 0: 禁用自动重载 %autoreload 1: 自动重载%aimport指定的模块。 %autoreload 2: 自动重载%aimport排除的模块之 ...
分类:其他好文   时间:2019-01-28 01:15:14    阅读次数:184
1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver ...
分类:其他好文   时间:2019-01-26 21:35:56    阅读次数:163
1037 Magic Coupon (25 分)
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc ...
分类:其他好文   时间:2019-01-26 20:24:53    阅读次数:156
【题解】 LGP2730 【魔板 Magic Squares】
【题目背景】 在成功地发明了魔方之后,鲁比克先生发明了它的二维版本,称作魔板。这是一张有8个大小相同的格子的魔板: 【题目描述】 我们知道魔板的每一个方格都有一种颜色。这8种颜色用前8个正整数来表示。可以用颜色的序列来表示一种魔板状态,规定从魔板的左上角开始,沿顺时针方向依次取出整数,构成一个颜色序 ...
分类:其他好文   时间:2019-01-25 19:57:02    阅读次数:178
AtCoder - 2568 最小割
There is a pond with a rectangular shape. The pond is divided into a grid with H rows and W columns of squares. We will denote the square at the i-th ...
分类:其他好文   时间:2019-01-25 15:09:20    阅读次数:252
1700条   上一页 1 ... 28 29 30 31 32 ... 170 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!