奇数阶魔方 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4861 Accepted Submission(s): 2770 Problem Description 一个 n 阶方阵的元素是1,2,...,n^2,它的每行,每列和2条对角线上元素的和相等,这样的方阵叫魔方.n为奇数时我们有1种构造方法,叫做“右上方” ,例如下面给…
#include<stdio.h>#include <string.h>int main(){ int n,m; int a[40][40]={0}; scanf("%d",&n); while(n--) { scanf("%d",&m); int i; int j; memset(a,0,sizeof(a)); i=0; j=m/2; int k=1; while(k<=m*m) { if(i<0&&am…
题目链接:hdu_5831_Rikka with Parenthesis II 题意: 给你一些括号的排列,必须交换一次,能不能将全部的括号匹配 题解: 模拟一下括号的匹配就行了,注意要特判只有一对括号是NO,因为必须要交换一次 #include <cstdio> #include <cstring> ; char s[N]; int st[N],top; int main() { int t; scanf("%d", &t); while (t--)…
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 242959 Accepted Submission(s): 46863 Problem Description I have a very simple problem for you. Given two integers A and B, you…
Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes…
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 260585 Accepted Submission(s): 50389 Problem Description I have a very simple problem for you. Given two integers A and B, you…
Problem Description Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followed Input Each line of input will contain a pair of integers…
位运算.. .. Revenge of Nim II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 229 Accepted Submission(s): 79 Problem Description Nim is a mathematical game of strategy in which two players take…
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 241933 Accepted Submission(s): 46646 Problem Description I have a very simple problem for you. Given two integers A and B, you…
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1027 题目: Problem Description Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero fir…
DP的时候记录下能否够从两个位置转移过来. ... Revenge of LIS II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 393 Accepted Submission(s): 116 Problem Description In computer science, the longest increasing su…
士兵队列训练问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4558 Accepted Submission(s): 2125 Problem Description 某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行…
Problem Description Consecutive sum come again. Are you ready? Go ~~ 1 = 0 + 1 2+3+4 = 1 + 8 5+6+7+8+9 = 8 + 27 - You can see the consecutive sum can be representing like that. The nth line will have 2*n+1 consecutive numbers on the left, the first n…