ACme

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  17 随笔 :: 0 文章 :: 2 评论 :: 0 Trackbacks

2010年5月9日 #

PKU分类, 来源于
http://www.cppblog.com/AClayton/archive/2007/09/17/32337.html
但是分类的原始题号大部分很多已经过时, 更新如下,不存在的题目已经删除.

动规:
   1082   Calendar Game       简单题
A 1080   Human Gene Functions   简单题
   1450   Gridland            简单题
A 1121   Algernon s Noxious Emissions 简单题
A 1018   Communication System   简单题,但是很容易看错~~~
   1692   Crossed Matchings   简单题
   2225   Asteroids!   简单题
   1112   Team Them Up!   简单题
   2178   Heroes Of Might And Magic   简单题,不过背景蛮有意思的……
   1293   Duty Free Shop   简单题
   1297   Supermarket   简单题
   1137   The New Villa   简单题
A 1015   Jury Compromise   其实不是很难,但是很容易错,555……
   1328   Radar Installation         简单题
   1301   The Umbrella Problem: 2054 简单题
   1860   Currency Exchange   简单题
   3192   Gene Assembly   简单题
   1238   Arbitrage   简单题
   1838   Banana   简单题
   2246   Matrix Chain Multiplication   简单题
   2357   Labyrinth   简单题
   2411   Mondriaan s Dream   简单题,DP可以过,不过据说有复杂的组合公式
   2415   Hike on a Graph   简单题
   1463   Strategic Game   简单题
   1093   Formatting Text   简单题
   1101   The Game   简单题
   1042   Gone Fishing   简单题
   1316   Self Numbers   简单题
   1482   It s not a Bug, It s a Feature!   简单题
   1485   Fast Food   简单题
   1465   Multiple   简单题,BFS
   1476   Always On the Run   简单题
   1099   Square Ice   无聊题,目前已知的O(nlogn)算法要用***L……您有没有简单点的O(nlogn)的算法?
   1471   Triangles   无聊题
   1074   Parallel Expectations   经典题,想了n久,最后发现可以DP,相当好的一道题
   1239   Increasing Sequences   经典题{}
   1143   Number Game         没有完美解决的题...

图论:
   1422   Air Raid    简单题,最小路径覆盖
   1240   Pre-Post-erous!       简单题
   1241   Knockout Tournament   简单题
   1201   Intervals           对您来说应该是简单题,但我想了n久……:(,差分限制系统
   1545   Galactic Import   简单题
   1371   Tin Cutter   简单题,但是似乎有空间复杂度为O(n)的算法
   3072   Robot     简单题
   3694   Network   简单题
   1300   Door Man   简单题,欧拉回路
   1287   Networking    简单题
   1251   Jungle Roads   简单题
   1122   FDNY to the Rescue!   简单题
   1124   Oh, Those Achin  Feet   不错的简单题
   1043   What s In a Name   简单题
   1097   Roads Scholar   简单题
A 1125   Stockbroker Grapevine   简单题
   1130   Alien Security   简单题,我觉得我当时的算法好巧妙:)
   2567   Code the Tree   简单题
   1094  Sorting It All Out   简单题,但是规模要是大些的话……
   1523   SPF   简单题
   1469   Courses   简单题
   1087   A Plug for UNIX   蛮不错的简单题
   1603   Risk   简单题,最短路
   1486   Sorting Slides   简单题,匹配
   1308   Is It A Tree?   不错的题,图论
   1135  Domino Effect   简单题,最长路
   1364   King   简单题,差分限制系统……
   1502   MPI Maelstrom   不错的题,最长路
   1370   Gossiping   简单题
   1529   Shipping Routes   无聊题,最短路
   1596   Gears on a Board            无聊题
   1242   Plugged In                  无聊题,匹配应该可以,但是太烦了,没做……
   1325   Machine Schedule     背诵题……匹配……
   1466  Girls and Boys   背诵题,匹配……
   1075  University Entrace Examination 经典题,但是和1576重复
   3487   The Stable Marriage Problem  经典题,感人的背景,经典的算法……
   1475   Pushing Boxes   经典题,某人的论文写过,求割点和块+BFS可以在O(面积)的时间内做出来,但是这题似乎已经比较老了
   1470   Closest Common Ancestors   没有完美解决,最简单的算法就能过,但要是规模大了……
A 1129   Channel Allocation   尚未完美解决,我用搜索过的,不过是不是有更好的算法呢……?

数学:
A 1003   HangOver            简单题
A 1005   I Think I Need a Houseboat   简单题
   1063   Flip and Shift      简单题,可以DP/BFS/……,但是实际上有数学方法可以直接判断出来
   1060   Modular multiplication of polynomials   简单题,感觉有比较简单的好算法,但想不出来:(
A 1017   Packets   简单题,不过也蛮经典的……
   1595   Prime Cuts   简单题
   1546   Basically Speaking   简单题
   1491   Pi   简单题
   1496   Word Index   简单题
   1217   Four Quarters   简单题
A 1218   The Drunk Jailer   简单题
A 1220   Number Base Conversion   简单题
   1221   Unimodal Palindromic Decompositions   规模不大,所以是简单题……
   1222   Extended Lights Out   简单题
A 1323   Game Prediction      简单题
   1326   Mileage Bank         简单题
   1248   Safecracker   简单题
   1023   The Fun Number System   简单题
   1205   Water Treatment Plants   简单题,组合计数
   1423   Big Number   简单题,不过O(1)和O(n)还是有区别的:)
   1425   Enigmatic Travel   简单题,不过个人感觉题目描述很令人费解
   1426   Find The Multiple   简单题
   2429   GCD & LCM Inverse  简单题,分区联赛的题……
   1606   Jugs                简单题
   1862   Stripies   简单题
A 1095   Trees Made to Order   简单题
A 1045   Bode Plot   简单题
A 1047   Round and Round We Go   简单题,142857,我喜欢^_^
   2402   Palindrom Numbers   简单题
A 1131   Octal Fractions   简单题
   1410   Intersection   简单题
   1519   Digital Roots   简单题
   1517   u Calculate e   简单题
A 1006   Biorhythms   简单题
A 1013   Counterfeit Dollar   简单题
   1512   Keeps Going and Going and ...   简单题,我喜欢:)
   1528   Perfection   简单题
   1312   Numerically Speaking   简单题
   1309   Coconuts, Revisited   简单题
   1473   There's Treasure Everywhere!   简单题
   1607   Deck   简单题
   1079   Ratio   简单题
   1365   Prime Land   简单题
   1019   Number Sequence   无聊题
   1246   Hilbert Curve Intersections   无聊题
   1543   Perfect Cubes   无聊题
   1445   Random Number   无聊题
   2346   Lucky tickets   无聊题
   1322   Chocolate            经典题……
   1276   Cash Machine         经典题!强烈推荐!
   1604   Just the Facts       经典题,没有完美解决,我的做法是O(logn^2)的,据说可能有O(logn)的做法,但我没想到:(
   1142   Smith Numbers   没有完美解决,数学

字符串:
   1119   Start Up the Startup 简单题
   1598   Excuses, Excuses!    简单题
   1580   String Matching   简单题
   1318   Word Amalgamation   简单题
   1451   T9                无聊题,单词树
   1542   DNA Translation   无聊题
   2271   HTML   无聊题
   1625   Censored!            经典题!强烈推荐!
   1204   Word Puzzles        没有完美解决的题,可以用后缀树……但是没多大意义……而且我通过的程序是错的……

搜索:
   1256   Anagram   简单题,同样faint
   1443   DEL command         简单题
   1314   Finding Rectangles   简单题
   1480   Optimal Programs   简单题
   1077   Eight   简单题
   1601   Pizza Anyone?   简单题
   1449   Enigma  无聊题,终于耐心读完题目后发现是简单的搜索+模拟……faint……建议不要看……
   2245   Lotto   无聊题
   1123   For the Porsche   无聊题
   1138   Ships               ……题
   1084   Square Destroyer    变态题,:(:(:(:(,狂剪枝才过的……
   1134   Hexagon   变态题,标准解法是搜索……
   1232   Microfiches         经典题!强烈推荐!
   1478   Island of Logic   经典题,不过也够老了……

模拟:
   1120   A New Growth Industry 简单题
   1132   Border   简单题
   1591   M*A*S*H   简单题
   1049   Microprocessor Simulation   简单题
   2410   Simple Computers   简单题
   1484   Blowing Fuses   简单题
   1016   Numbers That Count   简单题
   1104   Robbery   简单题
   2061   Pseudo-Random Numbers   简单题
   1310   Nonstop Travel   简单题
   1313   Booklet Printing   无聊题
   1589   Unix ls   无聊题,输出格式没说清楚~~~~~~~
   1524   Cowculations   无聊题
   1525   Hi-Q   无聊题
   1526   Call Forwarding   无聊题
   1548   Robots   变态题,太复杂啦~~~~~~~~~~~
   1433   Exchanges           经典题!强烈推荐!

几 何:
   1265   Area                简单题
   1262   Input               简单题
   1474   Video Surveillance   简单题,李彭煦的论文中写到过,好像是某年CTSC的……
   1136   Pendulum   简单题,我蛮喜欢的:)
   2242   The Circumference of the Circle   无聊题
   1311   Doing Windows   无聊题
   1269   Intersecting Lines   无聊题
   1133   Stars   经典变态题……
   1092   Farmland            变态题……现在我都为自己当时居然能做出来感到不可思议……
A 1106   Transmitters        变态题……好烦人……现在绝对没有信心再做一遍了……
   1066   Treasure Hunt   经典题,zig教会我的……
   1468   Rectangles   没有完美解决

其它:
A 1317   Do the Untwist      简单题
A 1068   Parencodings        简单题
A 1107   W's Cipher          简单题
   1111   Image Perimeters    简单题
   1083   Moving Tables       简单题,好像是线段树的经典题目之一,但是这题规模比较小,所以不必用。
   1244   Slots of Fun        简单题
   1597   Uniform Generator   简单题
   1590   Palindromes         简单题
   1442   Black Box           简单题,但当初我没做出来……被zig教会的……555……
   1495   LED Test            简单题
   1492   Up and Down Sequences   简单题
   1493   Machined Surfaces   简单题
   1327   Moving Object Recognition   简单题
   1298   The Hardest Problem Ever   简单题
   1247   Magnificent Meatballs   简单题
   1250   Tanning Salon   简单题
   1663   Number Steps   简单题
   1690   (Your)((Term)((Project)))   简单题
   1738   An Old Stone Game   简单题
   2479   Maximum Sum   简单题
   1291   This Sentence is False   简单题,并查集
A 1026   Cipher   简单题
   1629   Fillword   简单题,实在是有点……
   2174   Decoding Task   简单题
A 1028   Web Navigation   简单题
   1096   Space Station Shielding   简单题
   1046   Color Me Less   简单题
   1051   P,MTHBGWB   简单题
   1048   Follow My Logic   简单题,但很可爱:)
A 1050   To the Max   简单题
   1053   Set Me   简单题
   1128   Frame Stacking   简单题
   2243   Knight Moves   简单题
   2247   Humble Numbers   简单题
A 1007   DNA Sorting   简单题
   1103   Maze   简单题
   1151   Atlantis   简单题
   1521   Entropy   简单题
   1044   Date Bugs   简单题
   1102   LC-Display   简单题,LC……
   1002   487-3279   简单题
   1579   Function Run Fun   简单题
   1481   The Die Is Cast   简单题,并查集/bfs
   1530   Slurpys   不错的简单题
   1503   Integer Inquiry   简单题
   1477   Box of Bricks   简单题
   2085   Inversion   简单题
   2948   Martian Addition   简单题
   1472   Instant Complexity   简单题,好像是某年CTSC的……
   1363   Rails   简单题,构造
   1447   Ambiguous Dates     无聊题
   1110   Double Vision       无聊题,直接枚举就可以了,但是有一些很faint的极端情况,提交了n次才过……
   1522   N-Credible Mazes   无聊题,题义实在费解……
A 1105   S-Trees   无聊题
   1307   Mapping the Route   无聊题
   1367   Time   无聊题
   1527   Making the Grade   无聊题
   1065   Wooden Sticks       背诵题,排序+最长不xx子序列……
   1369   Append               经典题
   1429   Alice and Bob        经典题
   1435   Gates                经典题!强烈推荐!
   1052   Plato's Blocks       经典题,没有解决得非常完美……
   2414   Phylogenetic Trees Inherited   经典题,贪心
   1392   Ouroboros Snake      经典题,构造
   1235   Galactic Breakup    尚未完美解决……有没有“拆查集”?
   1071   Illusive Chase      没有完美解决的题,没给规模,最后发现我的弱智算法居然0.01秒通过,faint……

-------------
注: 题号前面的 A表示 偶 AC的题目...


posted @ 2010-05-09 21:48 ACme 阅读(391) | 评论 (0)编辑 收藏

2010年3月23日 #

升级之后,英文字体,中文字体感觉比windows 还爽,以后编程可很high了。
总结一下升级的步骤:
1 下载 Lucida Grande 和 STHeiti 这两种字体,下载地址分别是 下载Lucida Grande下载STHeiti
2 解压后复制到 /usr/share/fonts/truetype 下面。 分别设置三个ttf文件的可读权限: sudo chmod a+r /usr/fonts/truetype/stheiti.ttf
3 sudo gedit /etc/fonts/conf.d/69-language-selector-zh-cn.conf, 编辑如下所示:
 <fontconfig>

    <match target="pattern">
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>STHeiti</string> /*此处是新添加的*/
            <string>AR PL UMing CN</string>
            <string>AR PL ShanHeiSun Uni</string>
            <string>WenQuanYi Bitmap Song</string>
            <string>Bitstream Vera Serif</string>
            <string>DejaVu Serif</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Bitstream Vera Sans</string>
            <string>DejaVu Sans</string>
            <string>STHeiti</string> /*此处是新添加的*/
            <string>WenQuanYi Zen Hei</string>
            <string>AR PL UMing CN</string>
            <string>AR PL ShanHeiSun Uni</string>
            <string>WenQuanYi Bitmap Song</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Bitstream Vera Sans Mono</string>
            <string>DejaVu Sans Mono</string>
            <string>STHeiti</string> /*此处是新添加的*/
            <string>WenQuanYi Zen Hei</string>
            <string>AR PL UMing CN</string>
            <string>AR PL ShanHeiSun Uni</string>
            <string>WenQuanYi Bitmap Song</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match>

</fontconfig>

4 然后,刷新字体缓存: sudo fc-cache -f -v
5 设置system -> preference -> appearance 可以选择 新的字体了。
6 重启一下 X,就可以enjoy 新的字体。

p.s.
firefox 对于新的字体 看起来太cool,大有赶超 mac 之势啊 。。。。^_^

posted @ 2010-03-23 20:45 ACme 阅读(859) | 评论 (0)编辑 收藏

2010年3月6日 #

写论文latex要用到矢量图 eps格式,但是visio 不能直接导出eps。在网上找了找,这个方法比较完美:
首先安装几个文件
1、PostScript Printer 驱动。推荐使用Adobe的驱动,可以在Adobe的网站下载,
Adobe Universal PostScript Windows Driver Installer 1.0.6 - Chinese Simplified。在这里下载

2、中文PPD文件。PPD是PostScript Printer Description 的意思,也就是PostScript打印机描述文件。里面包含了字体,打印页面等的一些描述。PostScript打印机需要这些文件。推荐使用 Adobe提供的Adobe PPD文件,是一个压缩包:点这里下载

3、GhostScript程序。目前Windows的最新的版本是Ghostscript8.64。这是一个自由软件。可以分析PS文件,并可以将PS文件转换成PDF文件。而且它还是下面要安装的程序(GSview)的底层 驱动。在这里下载

4、GSview是一个查看PS和PDF文件的工具。它是目前查看这类文件最快的软件,要比Acrobat Reader快的多。但是没有Acrobat Reader漂亮。下载最新的4.9版
。在这里下载

开始安装,解压adobe.zip到一个目录中,这里假设下载到C:\downloads\adobe中。然后运行Winstchs.exe安装 PostScript 驱动。安装请注意:安装到“打印机连接类型时”,选择“本地打印机”;打印端口选择“FILE: 本地端口”;然后是选择打印机型号,这里很重要,点击“浏览”,找到C:\downloads\adobe目录,这时回显示5个型号的打印机,选择“Acrobat Distiller CS”表示中文简体,“Acrobat Distiller CT”则是中文繁体。选择好简体然后确定。后面就直接下一步就很快可以安装好了。安装好以后计算机可能需要重启,之后你会看到你的计算机会多处一个打印机,打印机名就是“Acrobat Distiller CS”。这就是安装好后的PostScript打印机了。如果你有多个打印机的话,也可以设为默认打印机。

使用方法:
编辑好文档,然后选取打印机为“Acrobat Distiller CS”开始打印。这时会出现一个对话框标题是“打印到文件”,你可以选择打印出的PS文件名以及路径。另外文件名后缀是ps而且保存文件类型选择“所有文 件”。这是是因为GSview自动与ps文件关联。可以双击直接打开ps文件。打开ps以后,就可以在GSview中 File-> PS to EPS,把弹出的对话框中的 选框 去掉勾选,这样你可以自己选择 图片的bounding box更加方便。

替代方法:(感谢网友sanit
使用visio替代工具 DIA,开源的,真是好东西,不仅能导出eps,还能导出pdf和其它N多格式。太cool了。。



posted @ 2010-03-06 13:32 ACme 阅读(3150) | 评论 (2)编辑 收藏

2010年1月11日 #

原题在这里,不再赘述。原文中的解法挺不错,递归思想,很实用。但是,本文要讨论的是针对这个问题的“举一反三”,说白了,就是扩展思考。。。 自己造题。。。 自己解题。。。
想到的可能问题如下:
1 给定双向有序链表,转化为左右子树节点数相差不超过1,且左子树的节点数>=右子树。
注:不能创建节点。提示:该二叉搜索树的拓扑结构是唯一的。
2 给定一个最大堆,转化为二叉树
3 给定一个最大堆,转化为有序双向链表

待续。。。

posted @ 2010-01-11 15:55 ACme 阅读(448) | 评论 (0)编辑 收藏

2009年11月13日 #


如果不想看Nvidia 的logo ,可以修改 /etc/X11/xorg.conf
在Section "Device"中添加
Option "NoLogo" "True"
一行 即可。
posted @ 2009-11-13 17:33 ACme 阅读(556) | 评论 (0)编辑 收藏

2009年10月16日 #

1 在firefox地址栏输入 about:config
2 在过滤器中输入browser.session
3 将 browser.sessionstore.resume_from_crash 设置为true,重启浏览器即可。

posted @ 2009-10-16 12:58 ACme 阅读(571) | 评论 (0)编辑 收藏

2009年10月5日 #

首先,用vi编辑ssh设定档sshd_config

sudo vi /etc/ssh/sshd_config

找到#Authentication 段落,将以下选项设置为 no

PermitRemoteLogin yes /*将yes 改为 no*/

最后重启ssh服务

sudo /etc/init.d/ssh restart



posted @ 2009-10-05 19:18 ACme 阅读(521) | 评论 (0)编辑 收藏

2009年9月15日 #

[转载]解决Matlab中文乱码 - [Matlab]
作者:gosman

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://gosman.blogbus.com/logs/5027357.html

原创文章,转载请注明出自gosman的博客(http://gosman.blogbus.com) 。参考文章:再提 Ubuntu/Debian 下 JAVA 中文显示(http://www.linuxsir.org/bbs/showthread.php?t=222214)

由于Linux下Matlab的图形界面是用Java写的,所以只要搞定Java的中文显示就行了。

1、我Matlab2007a的JRE目录为:/opt/matlab/sys/java/jre/glnx86/jre1.5.0 请根据自己的安装目录和版本确定JRE的目录;

2、 $ cd /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/fonts/;

3、建立目录fallback: $ mkdir fallback;

4、把字体复制或链接到fallback目录:
$ cp /media/disk/WINDOWS/Fonts/simsun.ttc fallback/ 我用的是Windows XP的simsun字体,你也可以用别的支持中文的字体;

5、进入fallback目录,执行 mkfontscale 命令

6、将上一步生成的文件添加到 lib/fonts/fonts.dir文件中,可用以下命令完成,当然也可以用编辑器复制粘贴:
$ cat fallback/fonts.scale >> fonts.dir (注意fonts.dir应该设为可写)

7、至此Matlab的Java环境中文支持安装完了,接下来配置Matlab;

8、进入Matlab,选择 菜单 File>>Preferences>>Fonts 选择SimSun字体就行了;

9、如果没有相应的(我的是SimSun)字体,请把fallback下的字体加上可读属性:$ chmod a+r fallback/*

10、至此Matlab应该可以正常显示中文了。
posted @ 2009-09-15 01:14 ACme 阅读(2483) | 评论 (0)编辑 收藏

2009年9月13日 #

近来局域网内 总有人 ARP中毒,所以就打算 绑定mac,动手来做。
1 制作 脚本
sudo gedit /etc/network.script
输入 要执行的语句 sudo arp -s S:S:S:S X:X:X:X:X:X -i wlan0
2 添加启动 语句
sudo gedit /etc/rc.local
输入 sh /etc/network.script
注意 : 在 exit 0 语句之前添加。

重启,一切解决。

posted @ 2009-09-13 15:04 ACme 阅读(676) | 评论 (0)编辑 收藏

2009年8月28日 #

1 进入Ubuntu,制作引导文件
查看一下你的硬盘类型:
sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d32a3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2080    16707568+   7  HPFS/NTFS
/dev/sda2            2081        9729    61440592+   5  Extended
/dev/sda5            2081        4008    15486628+   7  HPFS/NTFS
/dev/sda6            4009        7269    26193951   af  Unknown
/dev/sda7            7270        7944     5421906    7  HPFS/NTFS
/dev/sda8            7945        8037      746991   82  Linux swap / Solaris
/dev/sda9            8038        9729    13590958+  83  Linux

我的硬盘是sata类型。
sudo dd if=/dev/sda<x> of=/media/linux.lnx bs=512 count=1
如果你的是IDE硬盘
sudo dd if=/dev/hda<x> of=/media/linux.lnx bs=512 count=1
其中<x>指的是你的ext分区,例如我的是 sda9

2 然后将linux.lnx cp到Win系统分区
sudo cp linux.lnx /media/sda1

重新启动进入Win,修改c:\boot.ini,添加
C:\linux.lnx="Ubuntu 9.04"

一切搞定。
posted @ 2009-08-28 13:21 ACme 阅读(349) | 评论 (0)编辑 收藏

仅列出标题  下一页