Little Peter Ivanov likes to play knights. Or musketeers. Or samurai. It depends on his mood. For parents, it is still always looks like “he again found a stick and peels the trees.” They cannot understand that it is a sword. Or epee. Or katana. Toda…
目录 Ural 1298 Knight 题解 题意 题解 程序 Ural 1298 Knight 题解 题意 给定一个\(n\times n(1\le n\le8)\)的国际象棋棋盘和一个骑士(基本上相当于中国象棋的马),问可否用经过每个格子\(1\)次.如果可以,输出路径,否则输出IMPOSSIBLE. 题解 考虑回溯.暴力程序十分好写,但是会超时. 可以用启发式优化. 设当前点为\((x,y)\),可到达的点为\((x',y')\).优先选择\((x',y')\)状态种数少的回溯,即可以转移…
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029. 1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093. 1094.1095.1096.1097.1098.1106.1108.1157.116…
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY…
The statement of this problem is very simple: you are to determine how many squares of the chessboard can be attacked by a knight standing alone on the board. Recall that a knight moves two squares forward (horizontally or vertically in any direction…
2036. Intersect Until You're Sick of It 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=2036 Description Ural contests usually contain a lot of geometry problems. Many participants do not conceal their discontent with such disbalance. Still, we ha…
B - Space BowlingTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87643#problem/B Description The inhabitants of planets orbiting around the pulsar PSR 2010+15 enjoy playing space bowling. A few cylin…
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1046 参考博客:http://hi.baidu.com/cloudygoose/item/21fee021a5db348d9d63d17b 参考资料(向量的旋转):http://www.cnblogs.com/woodfish1988/archive/2007/09/10/888439.html 题目大意:就是已知n个点,n个角.点Mi可以与多边形Ai和Ai+1构成等腰三角形,顶角为ang[i…
啥也不说了,直接看图吧…… 代码如下: #include<stdio.h> #include<iostream> #include<math.h> using namespace std; #define LL long long struct point { LL x,y,z; }; bool fun(point a,point b,point c,point d) { point p1, p2,p3; p1.x = a.x-d.x; p1.y = a.y-d.y;…
Cycling Roads 题目连接: http://acm.hust.edu.cn/vjudge/contest/123332#problem/F Description When Vova was in Shenzhen, he rented a bike and spent most of the time cycling around the city. Vova was approaching one of the city parks when he noticed the park…