题目链接: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 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 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,交换操作就是暴力交换操作答案矩阵的两行,清空操作是将操作答案矩阵的对应行清零. 至于最后的将所有操作重复,将单次操…
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: 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…
%测试数据 'ex1data1.txt', 第一列为 population of City in 10,000s, 第二列为 Profit in $10,000s 1 6.1101,17.592 5.5277,9.1302 8.5186,13.662 7.0032,11.854 5.8598,6.8233 8.3829,11.886 7.4764,4.3483 6.4862,6.5987 5.0546,3.8166 5.7107,3.2522 14.164,15.505 5.734,3.1551…