题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3209dancing links 每个点作为一列。每个块作为一行。不知道为什么插节点的时候 如果把循环写成for(int i = y1+1; i 2 #inclu.....
分类:
其他好文 时间:
2015-04-24 06:36:07
阅读次数:
114
题意:n+m个人,各自喜欢num个人。 然后q个询问,每个询问给你num个人,问你在这num个人中,是否有个孤独者喜欢这num个人中的所有人,但是这num个人都没喜欢他。
做法:首先明确的是,这里只可能有一个人符合要求,否者 条件矛盾 。先假设这个人 是0号,从从小到大枚举 这num个人,假设第i个人是这个孤独者,那么i+j个人如果喜欢i,或者i不喜欢i+j,那么i就不符合条件,接下来就假设这个孤独者是i+j。i+j之前可以断定不是孤独者。 到最后就可以得到假设的孤独者,然后从0开始再循环一遍,判断他是...
分类:
其他好文 时间:
2015-04-23 23:30:38
阅读次数:
201
Crazy ShoppingTime Limit: 3000msMemory Limit: 65536KBThis problem will be judged onZJU. Original ID:352464-bit integer IO format:%lld Java class name:...
分类:
其他好文 时间:
2015-04-23 23:24:05
阅读次数:
190
原题链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1112 1 #include 2 #include 3 #include 4 #include 5 #define lc rootsize + ...
分类:
其他好文 时间:
2015-04-23 23:12:42
阅读次数:
211
某人到了一个陌生城市,这个城市的特点就是:每两个城市之间都有飞机直接到达,不是双向的,给出城市的数量n,以及n * (n - 1) / 2 条城市 x 到 城市 y 的路,(表示x 到 y 有飞机),问你是不是可以每个城市都经过并且只经过一次可以的话,输出经过的城市的路径,否则输出Impossibl...
分类:
其他好文 时间:
2015-04-23 21:39:29
阅读次数:
152
SudokuTime Limit:10000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeZOJ 3122Appoint description:DescriptionA Sudoku grid is a 1...
分类:
其他好文 时间:
2015-04-23 19:35:35
阅读次数:
121
Calculate the Function
Time Limit: 2 Seconds
Memory Limit: 65536 KB
You are given a list of numbers A1 A2 ..
AN and M queries. For the i-th query:
The query has two parameters L...
分类:
其他好文 时间:
2015-04-23 17:39:54
阅读次数:
185
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3328
题面:
Wu Xing
Time Limit: 1 Second Memory Limit: 32768 KB
Introduction
The Wu Xing, or the Five Movements...
分类:
其他好文 时间:
2015-04-23 09:44:58
阅读次数:
138
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3326
题面:
An Awful Problem
Time Limit: 1 Second Memory Limit: 32768 KB
In order to encourage Hiqivenfin to study m...
分类:
其他好文 时间:
2015-04-22 22:20:29
阅读次数:
138
简单的模拟题,类似于高精度加法运算。理解题意即可。#include#include#include#includeusing namespace std;const int maxn = 111;char s[maxn];char ji[maxn];int gg[maxn];void RevStr(...
分类:
其他好文 时间:
2015-04-22 22:01:33
阅读次数:
160