Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11496 Accepted: 2815 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make the cats to do some ex…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9613 Accepted: 2296 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make th…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9299 Accepted: 2230 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make th…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10737 Accepted: 2563 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make t…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 13488 Accepted: 3335 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make t…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11787 Accepted: 2892 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make the c…
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11208 Accepted: 2698 Description Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make t…
http://poj.org/problem?id=3735 大致题意: 有n仅仅猫,開始时每仅仅猫有花生0颗,现有一组操作,由以下三个中的k个操作组成: 1. g i 给i仅仅猫一颗花生米 2. e i 让第i仅仅猫吃掉它拥有的全部花生米 3. s i j 将猫i与猫j的拥有的花生米交换 现将上述一组操作循环m次后,问每仅仅猫有多少颗花生? 非常明显,要先构造矩阵.构造一个(n+1)*(n+1)的矩阵a,初始化为单位矩阵. g i : a[i][n+1] += 1; e i : a[i][j]…
题目链接:http://poj.org/problem?id=3735 题目意思: 调教猫咪:有n只饥渴的猫咪,现有一组羞耻连续操作,由k个操作组成,全部选自: 1. g i 给第i只猫咪一颗花生 2. e i 让第i只猫咪吃光它的花生 3. s i j 交换猫咪i与猫咪j的花生 现将上述一组连续操作做m次后,求每只猫咪有多少颗花生? 思路:这道题难点在如何把这种奇怪的操作转化为矩阵操作,网络上看到一个画的很好的图,这里直接偷过来. 现在,对于每一个操作我们都可以得到一个转置矩阵,把k个操作的矩…
Training little cats poj-3735 题目大意:给你n个数,k个操作,将所有操作重复m次. 注释:三种操作,将第i个盒子+1,交换两个盒子中的个数,将一个盒子清空.$1\le m \le 10^9$ , $1\le n , k \le 100$. 想法:定义开始是的矩阵是n+1行,1列,除了最底下的数是1剩下全是0.然后加法操作就是讲操作答案矩阵的对应位置+1,交换操作就是暴力交换操作答案矩阵的两行,清空操作是将操作答案矩阵的对应行清零. 至于最后的将所有操作重复,将单次操…
这个东西先放在这吧.做过的以后会用#号标示出来 1.burnside定理,polya计数法 这个大家可以看brudildi的<组合数学>,那本书的这一章写的很详细也很容易理解.最好能完全看懂了,理解了再去做题,不要只记个公式. *简单题:(直接用套公式就可以了) pku2409 Let it Bead #http://acm.pku.edu.cn/JudgeOnline/problem?id=2409 pku2154 Color #http://acm.p…
今天是廖俊豪老师的讲授~ T1 第一次想出正解 30 pts: k <= 10,枚举如何把数放到矩阵中,O ( k ! ): 100 pts: 对于矩阵的每一列,我们二分最小差异值,然后贪心去判断是否可行: 贪心策略:从前往后找,如果有从某个数开始往后连续的 m 个数,这 m 个数的最大值 - 最小值 < k,那么就把这 m 个数放到同一行,最后判断是否能够凑出 n 行: std 标程: #include<bits/stdc++.h> using namespace std; ;…
Area of Mushroom Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2390 Accepted Submission(s): 578 Problem Description Teacher Mai has a kingdom with the infinite area. He has n students guard…
2016 Multi-University Training Contest 1 2016 Multi-University Training Contest 2 2016 Multi-University Training Contest 3 2016 Multi-University Training Contest 4 2016 Multi-University Training Contest 5 2016 Multi-University Training Contest 6…
Differencia Time Limit: 10000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 601 Accepted Submission(s): 173 Problem Description Professor Zhang has two sequences a1,a2,...,an and b1,b2,...,bn. He wants to…
Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 337 Accepted Submission(s): 273 Problem Description Erik Demaine is a Professor in Computer Science at the Massachusetts Insti…
Gym 101047K Training with Phuket's larvae Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Practice Description standard input/output Thai cuisine is known for combining seasonings so that every dish has flavors that are…
Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/C Description standard input/output After a long ACM training day, Master Hasan invited his trainees for a light dinner in the cafeteria. The cafeteria has N tables, each with a number of chai…
在前面的几篇关于Free编程的讨论示范中我们均使用了基础类型的运算结果.但在实际应用中因为需要考虑运算中出现异常的情况,常常会需要到更高阶复杂的运算结果类型如Option.Xor等.因为Monad无法实现组合(monad do not compose),我们如何在for-comprehension中组合这些运算呢?假如在我们上一篇讨论里的示范DSL是这样的: trait Login[+A] case class Authenticate(uid: String, pwd: String) ext…