uva 12097 Pie
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my par...
//又被题虐了MD
#include
#include
char ch[18];
int dis[(1
int min(int a,int b)
{
if(a
return b;
}
int main()
{
int i,j,n,m;
while(scanf("%d",&n)!=EOF)
{
scanf("%s",ch);
int len=strlen(ch);
...
F - Rope
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Plotters have barbarously hammered N nails into an innocent plane shap...
uva 11520 Fill the Square
In this problem, you have to draw a square using uppercase English Alphabets.
To be more precise, you will be given a square grid with some empty blocks and other...
帝都的宇宙中心,古老文明的发源地,coding的传统在码农手中世代延续,CGI作为传承了一千多年的古老工艺,并没有被AJAX收割殆尽,仍在这里焕发着勃勃生机。--舌尖上的ABCD
背景
借着开发Stroy的机会,把一个古老的CGI脚本做了一下重构,有点心得,赶紧写下来,因为以后不太可能有机会经常接触perl的CGI了。
产品中现有的CGI并非像很多年以前那样用来产生web页面,而是作为系...
题目:Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai)
and (i, 0). ...
原题链接:https://oj.leetcode.com/problems/powx-n/
1. 首先处理特殊情况,比如0,1,-1
2. 关于普遍情况,考虑x^7 = x^(4 + 2 + 1),注意4,2,1都是2的n次方,所以转化为((x ^ 2) ^ 2) * (x ^ 2) * (x)。更加直观来看,我们可以将指数7看为二进制表示111,每一位从右到左对应的是x ^ 4,x ...
题解:
如果i、j不能共存,那么就中间连一条边,然后i连源流量b[i],j连汇流量b[j],就可以满足性质。
但是问题是哪个点连源,哪个点连汇呢?
这种做法需要图是二分图,这样某些点就可以只连源,某些点只连汇。
当且仅当这种情况才可以有上述建图。
而这道题有个很好的性质:
任意两个奇数肯定满足条件一(把奇数看成2k+1,然后最后形式是2*奇数),
任意两个偶数...
点击打开链接
Football
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 3309
Accepted: 1696
Description
Consider a single-elimination football t...