07 2013 档案
摘要:7.29 黄昏时刻(一) 全排列建模: 给了数字n 代表从1-n 个数全排列思路: 1. 输入n,如果n值为‘0’,则退出程序 2. vis[i] 保存 是否对第i个数字进行访问 3. dfs 遍历1-n 个数字的全排列,若重复访问,则越过。直到最终访问结束输出访问的的结果。之后回溯删掉对数字的访问。优化: none代码: 1 #include 2 #include 3 4 int a[20] ,n, vis[20]; 5 6 void dfs(int s) { 7 int i; 8 //如果dfs 次数为n,则输出a数组的内容 9 if(s...
阅读全文
摘要:Judge InfoMemory Limit: 65536KBCase Time Limit: 3000MSTime Limit: 3000MSJudger: Number Only JudgerDescriptionWithin Settlers of Catan, the 1995 German game of the year, players attempt to dominate an island by building roads, settlements and cities across its uncharted wilderness.You are employed by
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: NormalDescriptionPlease calculate the answer of A+B and the answer of A-B, both A and B are integer.InputThe first line of input contains, the number of test cases. There is only line for each test case. It contains tw
阅读全文
摘要:思想:目的:将中缀表达式(即标准形式的表达式)转换为后缀式。例子:a+b*c+(d*e+f)*g转换成abc*+de*f+g*+转换原则:1.当读到一个操作数时,立即将它放到输出中。操作符则不立即输出,放入栈中。遇到左圆括号也推入栈中。2.如果遇到一个右括号,那么就将栈元素弹出,将符号写出直到遇到一个对应的左括号。但是这个左括号只被弹出,并不输出。3.在读到操作符时,如果此时栈顶操作符优先性大于或等于此操作符,弹出栈顶操作符直到发现优先级更低的元素位置。除了处理)的时候,否则决不从栈中移走"("。操作符中,+-优先级最低,()优先级最高。4.如果读到输入的末尾,将栈元素弹出
阅读全文
摘要:1. 将代码存放到 GitHub , 不然找起来很不方便。2. 集训时,上午看书总结,下午开始刷题。重质不重量。3. 由于SZUOJ 英文晦涩难懂,先从Vijos 开始刷起。4. 每次刷完题后,花10分钟总结一下。不然等于白刷。5. 保持简洁,唯美的风格。6. 每天睡觉前来这里总结一下一天的收获。
阅读全文
摘要:dd版本:实战中,未被超越。 1 void quick_sort(int *a,int f,int t) 2 { 3 int i,j,k; 4 i=f; 5 j=t; 6 k=a[f]; 7 8 if(i>=j) return; 9 10 while(i=k)13 j--;14 if(i 2 #define N 250000 3 4 void quick_sort(int *a,int f,int t) 5 { 6 int i,j,k; 7 8 while(f =k)16 ...
阅读全文
摘要:判断素数:第一种方法用于小数据。 1 int k=0; 2 int isprime(int num) 3 { 4 int i, j; 5 j = sqrt(num); 6 for (i = 2; i 2 #include 3 #include 4 5 #define N 100000 6 #define yes '1' 7 #define no '0' 8 char flag[N+1]; 9 10 void is_prime(int n)11 {12 int i, j;13 memset(flag, yes, sizeof(flag)...
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 5000MSTime Limit: 5000MSJudger: Float Numbers (1e-4) JudgerDescriptionThe chemists are well known because of their weird. Especially when they add water or salt in the same beaker over and over again. Moreover, the still hope you can tell him the mass
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 1000MSTime Limit: 1000MSJudger: Number Only JudgerDescription现在假设:2进制对应的基数是0,1;3进制对应的基数是0,1,2;……10进制对应的基数是0,1,2,3,4,5,6,7,8,9.……n进制对应的基数是0,1,2,3,……,n-1;你的任务是实现进制之间的转换。Input第一行,有t(t 2 #include 3 4 char str[1000];//输入字符串 5 int start[500],ans[500],res[5..
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: Number Only JudgerDescriptionA number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes hav
阅读全文
摘要:DescriptionThere is a company that makes plastic digits which are primarily put on the front door of each house to form the house number. In order to make sure that they don’t waste any resources, they want to make the exact number of digits for the house numbers needed. You are to write a program t
阅读全文
摘要:进制转换Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18495Accepted Submission(s): 10386Problem Description输入一个十进制数N,将它转换成R进制数输出。Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(210)。Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample In
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: NormalDescriptionA boy and a girl both like studying code in their extra-curricular. Of course, they like each other. Therefore, the boy shows his love to the girl one day. The girl smiles and leaves a series of Morse
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: Number Only JudgerDescriptionFrog Frank likes 30 more than likes 40, yet he likes 12 and 39 equally. This is because he likes numbers that have a lot of different prime factors. For example, 30 have 3 prime factors (2,
阅读全文
摘要:描述某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同:1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得;2) 五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成绩高于80分(>80)的学生均可获得;3) 成绩优秀奖,每人2000元,期末平均成绩高于90分(>90)的学生均可获得;4) 西部奖学金,每人1000元,期末平均成绩高于85分(>85)的西部省份学生均可获得;5) 班级贡献奖,每人850元,班级评议成绩高于80分(>8
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: NormalDescriptionAn anagram is formed by rearranging the letters of a word. You are given a string, please find out if it is an anagram of a word or not. No word will have have more than 50 characters.InputThe input wi
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: Number Only JudgerDescriptionIn the kingdom of frog, the most popular sport is jumping up and down. Frog likes to jump up(go higher) or jump down(go lower) but jump at the same height(not go higher,and not go lower). T
阅读全文
摘要://H1 1 2 3 BeiJing 4 5 6 唐诗三百首 7 8 目录 9 第一首:静夜思10 第二首:忆江南11 第三首:长恨歌12 13 静夜思14 作者: 李白15 床前明月光, 疑是地上霜, 举头望明月, 低头思故乡。16 17 【李白简介】18 李白 字太白。。。。。bra.bra..19 20 H2: 1 ...
阅读全文
摘要:Judge InfoMemory Limit: 65536KBCase Time Limit: 3000MSTime Limit: 3000MSJudger: NormalDescription青蛙们发现在传输信件时经常会被别人偷看,愤怒的青蛙向码农们求救。于是,码农们为它们提供了一套加密和解密的方法,从而将它们的信件内容加密成一段莫尔斯电码。现在给出译码程序:0.加密序列为:----**----***--**---**---*------******--***--**---**---*----**---***---*****----***--**-----******--1.每五个字符为一段
阅读全文
摘要:4.了解/etc目录下的各种配置文章,学会查看/var/log下的系统日志,以及/proc下的系统运行信息了解/etc目录下的各种配置文章/etc/hosts 主机配置文件/etc/networks 路由表功能/etc/passwd 用户配置文件/etc/exports 系统自动挂载盘配置文件/etc/fstab 系统自动挂载盘配置文件/etc/group 用户组文件其他用处不是很大查看/var/log下的系统日志1)/var/log/secure:记录登录系统存取数据的文件;例如pop3,ssh,telnet,ftp等都会记录在此.2)/ar/log/wtmp:记录登录这的...
阅读全文
摘要:3.学会使用一些管理命令 ps/top/lsof/netstat/kill/tcpdump/iptables/dd 端口查看ps -- process statusps aux 观察程序所有程序资料ps l 显示程序 uid pid ppid 等内容ps AI 显示所有程序 的uid pid ppidtop -- display and update sorted information about processes不用多说,这个命令观察系统信息进程top -b -n 2 > top.txt 保存top信息到top.txt文件中,貌似mac不可以,用linux 测试下才行lso...
阅读全文
摘要:2.学会使用一些文本操作命令sed -- stream editor1. Sed简介sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输出。Sed主要用来自动编辑一个或多个文件;简化对文件的反复操作;编写转换程序等。以下介绍的是Gnu版本的Sed 3.02。2. 定址可以通过定址来定位你所希望编辑的行,该地址用数字构成,用逗号分隔的两个行数表示以这两行为
阅读全文
摘要:1.文件系统结构和基本操作ls - - list directory contents-a/A 列出全部文件(包含隐藏文件)- i 列出inode号码-n 查看UID and GID-d +目录名 列出目录内的指定目录ls -R 递归列出目录中所有文件,包括子目录中的文件。ls -S 按文件容量大小排序ls -t 修改时间排序chown -- change file owner and groupchown root /var/run/httpd.pid 修改httpd.pid 拥有者为rootchown -R newuser:newgroup ACM...
阅读全文
摘要:1. 熟悉Unix/Linux Shell和常见的命令行 (start : 7.9 - end: 7.12)1.文件系统结构和基本操作 ls/chmod/chown/rm/find/ln/cat/mount/mkdir/tar/gzip …2.学会使用一些文本操作命令 sed/awk/grep/tail/less/more …3.学会使用一些管理命令 ps/top/lsof/netstat/kill/tcpdump/iptables/dd…4.了解/etc目录下的各种配置文章,学会查看/var/log下的系统日志,以及/proc下的系统运行信息5.了解正则表达式,使用正则表达式来查找文件。(g
阅读全文
摘要:更新后step 1 :A07, A11, A12,A14,A15,A18,A22,A24,A25,A26A27,A29,A31,A32,A34,A59,A66,A69,A84,B24B45,B54,B70,B98,B99,C04,G27,G34,G32,J38,H28H21,B35,H63,I74蓝色 以前做过红色 是暑假做的必做: A25,A59,A69,B98,C04,G34,H28,H21,B35,I74
阅读全文
摘要:DescriptionWe are given a integer sequence, your job is find the length of the longest contiguous subsequence that is strictly increasing or strictly decreasing.InputFirst number, represent how many test cases.For each test case the first number is.Thenpositive integers are followed, all of them are
阅读全文
摘要:DescriptionEggsAlec has a lot of eggs. One day, he want to sort them in a ascending sequence by weight. But he only can switch two eggs which are adjoining by each other because he has two hands only. Now he ask for your help, and you are enthusiastic. You decide help him calculate the total numbers
阅读全文
摘要:Judge InfoMemory Limit: 32768KBCase Time Limit: 10000MSTime Limit: 10000MSJudger: Number Only JudgerDescriptionOne day frog Frank fall into a deep well, the well is very deep. Everyday Frank try to climb up, at day time, he can get himselffeet up, but when he fall sleep at night , he slippedfeet dow
阅读全文
摘要:一道道刷完它!A07, A11, A12, A14, A15, A18, A22, A24, A25, A26, A27A29, A32, A34, A59, A66, A69, A84, B24, B45, B54, B70B98, B99, C04, G27, G34, G32, J38, H21, H22, B35, H63I74共 34 道 !刷的题贴到这里来吧。坚持不是说说而已,放弃该放弃的,争取该争取的,仅此而已!!
阅读全文
摘要:SELECTION-SORT(A)n : length[A] for j : 1 to n − 1 do smallest : j for i : j + 1 to n do if A[i] 0 and A[i]>key do A[i+1] : A[i] i : i-1 A[i+1] : keyMERGE(A, p, q, r) n1 : q-p+1 n2 : r-q create arrays L[1..n1+1] and R[1..n2+1]for i : 1 to n1 do L[i] : A[p+i-1] for j : 1 to n2 do R[...
阅读全文

浙公网安备 33010602011771号