FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 63198 Accepted Submission(s): 21342 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guardin…
1009. Product of Polynomials (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time, you are supposed to find A*B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case oc…
Encoding Time Limit: 2 Seconds      Memory Limit: 65536 KB Given a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same characters should be encoded to "kX" where "X" is…
Dining Description Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others. Farmer John has cooked fabulous meals for his cows, but he forgot to check his menu against their preferences. Al…
参考自<疯狂android讲义>2.4节 效果如下: 当点击图上某点时,将之附近放大至下图. 布局文件: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android…
A + B Problem Too Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13465    Accepted Submission(s): 10008 Problem Description This problem is also a A + B problem,but it has a little difference,…
Uniform Generator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21176 Accepted Submission(s): 8294 Problem Description Computer simulations often require random numbers. One way to generate pseu…
今天和昨天都没有做题,昨天是因为复习太累后面忘了,今天也是上午考毛概,下午又忙着复习计算机图形学,晚上也是忘了结果打了暗黑3,把暗黑3 打通关了,以后都不会玩太多游戏了,争取明天做3题把题目补上,拖越久越难补的道理我是知道的. 亲和数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26484    Accepted Submissio…
人见人爱A-B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53836    Accepted Submission(s): 15147 Problem Description 参加过上个月月赛的同学一定还记得其中的一个最简单的题目,就是{A}+{B},那个题目求的是两个集合的并集,今天我们这个A-B求的是两个集合的差,就是做集合的…
人见人爱A^B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27711    Accepted Submission(s): 18946 Problem Description 求A^B的最后三位数表示的整数. 说明:A^B的含义是"A的B次方"   Input 输入数据包含多个测试实例,每个实例占一行,由两个正整 数A和…
Sum Problem Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 338086    Accepted Submission(s): 85117 Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this pro…
昨天做的那题其实和大整数相加类似.记得当初我大一寒假就卡在这1002题上,结果之后就再也没写题... 到今天终于把大整数相加写了一遍. 不过写的很繁琐,抽时间改进一下写简洁一点. #include<queue> #include<math.h> #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> using namespace std;…
Lovekey Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6721    Accepted Submission(s): 2186 Problem Description XYZ-26进制数是一个每位都是大写字母的数字. A.B.C.-.X.Y.Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规…
Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走.但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路).小希现在把她的设计图给你,让你帮忙判断她的设计图是否符合她的设计思路.比如下面的例子,前两个是符合条件的,但是最后一个…
one recursive approach to solve hdu 1016, list all permutations, solve N-Queens puzzle. reference: the video of stanford cs106b lecture 10 by Julie Zelenski https://www.youtube.com/watch?v=NdF1QDTRkck // hdu 1016, 795MS #include <cstdio> #include &l…
I am Nexus Master! Time Limit: 2 Seconds      Memory Limit: 65536 KB NexusHD.org is a popular PT (Private Tracker) site in Zhejiang University aiming to provide high quality stuff. In order to encourage users to unload more stuff, the administrators…
DFS算法: #include<stdio.h> #include<math.h> void find(int k,int w); int num[23]={0}; int min=20001; int n,max=0; void find(int k,int w){ int sum=(int)fabs(max-w-w); if(k==n)return; if(sum<min)min=sum; find(k+1,w+num[k]); find(k+1,w); } int ma…
IP Address Time Limit: 2 Seconds      Memory Limit: 65536 KB Suppose you are reading byte streams from any device, representing IP addresses. Your task is to convert a 32 characters long sequence of '1s' and '0s' (bits) to a dotted decimal format. A…
参考自core java v2, chapter3 Networking. 注:URLConnection的子类HttpURLConnection被广泛用于Android网络客户端编程,它与apache HttpClient是两种主要的客户端实现方式,google官方推荐使用HttpURLConnection. 使用URL类可以简单获取网页信息, URL url = new URL("http://www.baidu.com"); InputStream is = url.openSt…
use fgets, and remove the potential '\n' in the string's last postion. (main point) remove redundancy there must be a stack, at first sight, you need a stack of type myNode, but think deeper, matrix multiplication is valid only if A.c=B.r, then the n…
C++中临时对象又称无名对象.临时对象主要出现在如下场景. 1.建立一个没有命名的非堆(non-heap)对象,也就是无名对象时,会产生临时对象. Integer inte= Integer(5); //用无名临时对象初始化一个对象 2.构造函数作为隐式类型转换函数时,会创建临时对象,以值的方式传递,用作实参传递给函数. 例: class Integer { public: Integer(int i):m_val(i){} ~Integer(){} private: int m_val; };…
希尔伯特矩阵 希尔伯特矩阵是一种数学变换矩阵 Hilbert matrix,矩阵的一种,其元素A(i,j)=1/(i+j-1),i,j分别为其行标和列标. 即: [1,1/2,1/3,--,1/n] |1/2,1/3,1/4,--,1/(n+1)| |1/3,1/4,1/5,--,1/(n+2)| -- [1/n,1/(n+1),1/(n+2),--,1/(2n-1)] 希尔伯特矩阵是一种数学变换矩阵,正定,且高度病态 (即,任何一个元素发生一点变动,整个矩阵的值和逆矩阵都会发生巨大变化),病态…
帕斯卡矩阵 1.定义       帕斯卡矩阵:由杨辉三角形表组成的矩阵称为帕斯卡(Pascal)矩阵. 杨辉三角形表是二次项 (x+y)^n 展开后的系数随自然数 n 的增大组成的一个三角形表. 如4阶帕斯卡矩阵为 1 2 3 4 5 6 7 8 9 10 11 12 <span style="font-size: 15px;">>> format rat >> pascal(6)   ans =          1              1 …
MATLAB格式化输出控制 format 默认格式 format short 5字长定点数 format long 15字长定点数 format short e 5字长浮点数 format long e 15字长浮点数 format short g format long g format hex 16进制 format bank 定点货币形式 format rat 小数分数表示 format + +,-,空格 format compact 压缩空格 format loose 包括空格和空行 f…
Windows7下QT开法环境常见搭配方法有两种. 第一种是:QT Creator+QT SDK: 第二种是:VS+qt-vs-addin+QT SDK: 以上两种均可,所需文件见QT社区,QT下载地址:http://download.qt.io/archive. 第一种,鄙人下载的是:qt-creator-opensource-windows-x86-3.3.0.exe + qt-opensource-windows-x86-mingw491_opengl-5.4.0.exe. 第二种:鄙人下…
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int INF = 0x3fffffff; int g[1005][1005]; int m; void Floyd() { int i, j, k; for (k=1;k<=m;k++) { for (i=1;i<=m;i++) { for (j=1;j<=m;j++) { if (g…
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int INF = 0x3fffffff; int g[1005][1005]; int m; int Dijkstra(int s,int t) { bool visit[1005]; int dis[1005]; for(int i = 1; i <= m; ++i) { visit[i] =…
SCU - 4440 Rectangle Time Limit: Unknown   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description Rectangle frog has a piece of paper divided into n rows and m columns. Today, she would like to draw a rectangle whose perimeter…
开始什么题都可以,后面会加大难度. 每天! 如果有一天有特殊情况,也要来这里打卡,并说明原因,并在其他某一天补上! 版权声明:本文为博主原创文章,未经博主允许不得转载.…
WIN7的向上按钮消失了,但是它的快捷键没有消失: Alt + ↑: 文件夹的后退前进 Alt +← 和Alt →: 切换到上个操作的窗口Alt +Esc: 版权声明:本文为博主原创文章,未经博主允许不得转载.…