BNUOJ 33898 Cannon】的更多相关文章

Cannon Time Limit: 1000ms Memory Limit: 65535KB This problem will be judged on HDU. Original ID: 449964-bit integer IO format: %I64d      Java class name: Main     In Chinese Chess, there is one kind of powerful chessmen called Cannon. It can move ho…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5091 Problem Description Recently, the γ galaxies broke out Star Wars. Each planet is warring for resources. In the Star Wars, Planet X is under attack by other planets. Now, a large wave of enemy spaces…
传送门:BNUOJ 52325 Increasing or Decreasing题意:求[l,r]非递增和非递减序列的个数思路:数位dp,dp[pos][pre][status] pos:处理到第几位 pre:前一位是什么 status:是否有前导零 递增递减差不多思路,不过他们计算的过程中像5555,444 这样的重复串会多算,所以要剪掉.个数是(pos-1)*9+digit[最高位],比如一位重复子串是:1,2,3,4...9,9个,二位重复子串:11,22,33,44,...,99,9个:…
原理不解释,直接上代码 代码中被注释的源程序可用于打印中间结果,检查运算是否正确. #include "mpi.h" #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void scatter_matrix(int* fstream,int n1,int n2,int*Q,int root,int tag){ /*每个矩阵块的大小*/…
一道简单的规律题,画出二维表将数字分别相加可以发现很明显的对称性 题目链接:http://www.bnuoj.com/v3/problem_show.php?pid=24251 #include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> #include<math.h> using namespace std; int main() { int sum,n…
http://www.bnuoj.com/contest/problem_show.php?pid=44359 快来买肉松饼 Time Limit: 5000 ms     Case Time Limit: 5000 ms     Memory Limit: 32768 KB Description 转眼又到了一年一度的圣战(光棍)节了,单身狗大表哥决定和一群一样孤独的盆友一起出来过节,一起玩游戏,输的人给赢的人买肉松饼,这样大家都不会感到孤单. 为了防止平局出现,大表哥给大家准备了一个奇数(大…
炮(cannon)[题目描述] 众所周知,双炮叠叠将是中国象棋中很厉害的一招必杀技.炮吃子时必须隔一个棋子跳吃,即俗称“炮打隔子”. 炮跟炮显然不能在一起打起来,于是rly一天借来了许多许多的炮在棋盘上摆了起来……他想知道,在N×M的矩形方格中摆若干炮(可以不摆)使其互不吃到的情况下方案数有几种. 棋子都是相同的.[输入说明] 一行,两个正整数N和M.[输出说明] 一行,输出方案数mod 999983.[样例输入] 1 3[样例输出] 7[数据范围] 对于40%的数据,N<=4,M<=4 对于…
Primary Arithmetic 来源:BNUOJ 1006http://www.bnuoj.com/v3/problem_show.php?pid=1006 当你在小学学习算数的时候,老师会教你把两个数由右至左按位加起来. 很多时候,加法过程中会出现进位.对于一部分孩子,理解这个“进位” 在当时是很困难的事情.现在你的工作就是编写一个程序来判断两个数 相加的过程中会产生多少次进位,用以确定这两个数相加的“难度”. Input 每一行有两个无符号整数(最大不超过1000000000),当输入…
题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=34985 We define a kind of strings as elegant string: among all the substrings of an elegant string, none of them is a permutation of "0, 1,…, k". Let function(n, k) be the number of elegant s…
Cannon Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4499 Description In Chinese Chess, there is one kind of powerful chessmen called Cannon. It can move horizontally or vertically along the chess grid. At eac…