代码改变世界

随笔分类 -  ACM

2013年山东省第四届ACM大学生程序设计竞赛J题:Contest Print Server

2015-04-22 19:49 by 星星之火✨🔥, 257 阅读, 收藏, 编辑
摘要: 题目描述 In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code any time. Here you need to write a contest print serv 阅读全文

2013年山东省第四届ACM大学生程序设计竞赛E题:Alice and Bob

2015-04-22 13:03 by 星星之火✨🔥, 276 阅读, 收藏, 编辑
摘要: 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*. 阅读全文

2014年山东省第五届ACM大学生程序设计竞赛F题:Full Binary Tree

2015-04-21 21:05 by 星星之火✨🔥, 237 阅读, 收藏, 编辑
摘要: 题目描述In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (ea... 阅读全文

SDUT_2146:最小子序列和

2015-04-20 22:47 by 星星之火✨🔥, 485 阅读, 收藏, 编辑
摘要: 题目描述给你一个长为n(10 // Time Limit Exceeded: 1010MS#define MAXN 10000#define INF 1000000000000000 // 大于(1+1000)*1000/2*1000000即可,inf: infinitelong long int ... 阅读全文

OpenJudge_1321:棋盘问题

2015-04-19 23:56 by 星星之火✨🔥, 299 阅读, 收藏, 编辑
摘要: 题目描述在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。输入输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在... 阅读全文

SDUT_2502:火星计数法

2015-04-19 18:20 by 星星之火✨🔥, 166 阅读, 收藏, 编辑
摘要: 火星人的计数规则里只有a,b,c,d四个字母,计数规则从小到大是 a,b,c,d,aa,ab,ac,ad,ba,……。给出来由a,b,c,d四种字母组成的火星数字,算出该数字是第几个(从1开始)。输入第一行输入一个数T代表测试用例组数(T#include#define MOD 10000007int... 阅读全文

OpenJudge_1477:Box of Bricks

2015-04-18 20:42 by 星星之火✨🔥, 170 阅读, 收藏, 编辑
摘要: 描述 Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. "Look, I've built a wal 阅读全文

OpenJudge_2757:最长上升子序列

2015-04-18 19:51 by 星星之火✨🔥, 164 阅读, 收藏, 编辑
摘要: 描述一个数的序列bi,当b1#define MAXN 1000int a[MAXN+10];int dp[MAXN+10];int main(void){ int n, max, max_len; scanf("%d", &n); for(int i = 0; i < n; i++... 阅读全文

OpenJudge_1936:All in All

2015-04-18 19:29 by 星星之火✨&#128293;, 162 阅读, 收藏, 编辑
摘要: 描述You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. ... 阅读全文

HDU_2035:人见人爱A^B

2015-04-10 09:44 by 星星之火✨&#128293;, 445 阅读, 收藏, 编辑
摘要: Problem Description求A^B的最后三位数表示的整数。 说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1int main(void){ int a, b, result; while(scanf("%d%d"... 阅读全文

HDU_1061:Rightmost Digit

2015-04-09 22:49 by 星星之火✨&#128293;, 246 阅读, 收藏, 编辑
摘要: Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first lin... 阅读全文

HDU_1021:Fibonacci Again

2015-04-09 21:55 by 星星之火✨&#128293;, 244 阅读, 收藏, 编辑
摘要: Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).InputInput consists of a sequence o... 阅读全文

HDU_1005:Number Sequence

2015-04-09 21:08 by 星星之火✨&#128293;, 756 阅读, 收藏, 编辑
摘要: Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are t... 阅读全文

UVA_694:The Collatz Sequence

2015-04-03 21:46 by 星星之火✨&#128293;, 312 阅读, 收藏, 编辑
摘要: Language: C++ 4.8.2 阅读全文

UVA_489:Hangman Judge

2015-04-03 21:18 by 星星之火✨&#128293;, 228 阅读, 收藏, 编辑
摘要: Language:C++ 4.8.2#include#includeint main(void){ char str_original[30]; char str_guessed[30]; int arr_ori[30]; int mark[30]; // 标记数组 i... 阅读全文

UVA_488:Triangle Wave

2015-04-02 21:24 by 星星之火✨&#128293;, 204 阅读, 收藏, 编辑
摘要: PS:The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. ... 阅读全文

UVA_445:Marvelous Mazes

2015-04-02 18:29 by 星星之火✨&#128293;, 190 阅读, 收藏, 编辑
摘要: Language:C++ 4.8.2#include#include#includeint main(void){ char str[140]; int sum; while(1) { if(fgets(str, sizeof(str), stdin) == N... 阅读全文

UVA_490:Rotating Sentences

2015-04-02 17:14 by 星星之火✨&#128293;, 283 阅读, 收藏, 编辑
摘要: "R Ie n te h iD ne kc ,a r tt he es r eo fn oc re e s Ia i ad m, . "Language:C++ 4.8.2#include#include#define MAXN 100+10char str[MAXN][MAXN];int mai... 阅读全文

UVA_414:Machined Surfaces

2015-04-02 17:06 by 星星之火✨&#128293;, 251 阅读, 收藏, 编辑
摘要: Language : C++ 4.8.2 阅读全文

UVA_494:Kindergarten Counting Game

2015-03-25 12:47 by 星星之火✨&#128293;, 182 阅读, 收藏, 编辑
摘要: Language: C++ 4.8.2#include#includeint main(void){ int ch; int word_count = 0; int in_word = 1; // 标志变量辅助字符串读入 while((ch=getchar()) != EOF) { if(ch =... 阅读全文