Logs Stacking堆木头 总时间限制: 1000ms 内存限制: 131072kB [描述] Daxinganling produces a lot of timber. Before loading onto trains, the timberjacks will place the logs to some place in the open air first. Looking from the sideway, the figure of a logs stack is as…
题目链接:http://noi.openjudge.cn/ch0206/9277/ ... #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> using namespace std; struct Matrix{ long long m[3][3]; }A,E,ans; long long n,k, mod = 1e5; Matrix mul(Matri…
Problem H. Cups and Beans 2017.8.11 原题: There are N cups numbered 0 through N − 1. For each i(1 ≤ i ≤ N − 1), the cup i contains Ai beans,and this cup is labeled with an integer Ci.Two people will play the following game:• In each turn, the player ch…
Description A well known algorithm called heapsort is a deterministic sorting algorithm taking O(n log n) time and O(1) additional memory. Let us describe ascending sorting of an array of different integer numbers. The algorithm consists of two phas…
支离破碎 Time Limit: 4000/2000ms (Java/Others) Problem Description: 远古时期有一位魔王想向一座宫殿里的公主求婚.为了考验魔王的智力,太后给了他这样一道题:给出一串珠子(大小相同)共 n 个,现在要求魔王将所有的珠子分成不超过(<=)m 堆并求出所有可能的总情况数.考虑到m,n较大时,整座宫殿都可能放不下,现在只需要他求出总情况数 mod M 的答案,聪明的你能帮魔王解决这个问题吗? Input: 第一行输入两个整数 n 和 m.第二行输…