sdutoj 2604 Thrall’s Dream】的更多相关文章

http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2604 Thrall’s Dream Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 We never paid any heed to the ancient prophecies, like fools we clung to the old hatreds, and fought…
2013年省赛I题判断单向联通,用bfs剪枝:从小到大跑,如果遇到之前跑过的点(也就是编号小于当前点的点),就o(n)传递关系. bfs #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime> #include<set> #include<map> #inclu…
题目链接:题目 AC代码: #include<iostream> #include<algorithm> #include<vector> #include<cstring> #include<cstdio> using namespace std; ; int m,n; bool vis[N][N],vis1[N]; vector< int >mm[N]; void dfs(int m,int x) { ) return; ;i&l…
排名:http://acm.sdut.edu.cn/sd2012/2013.htm 解题报告:http://www.tuicool.com/articles/FnEZJb A.Rescue The Princess(几何,向量) B.The number of steps(记忆化搜索,概率dp) C.Boring Counting(划分树) D.A-Number and B-Number E.Alice and Bob F.Mountain Subsequences(dp) G.Rubik’s…
A.Rescue The Princess 已知一个等边三角形的两个顶点A.B,求第三个顶点C,A.B.C成逆时针方向. 常规的解题思路就是用已知的两个点列出x,y方程,但这样求出方程的解的表达式比较复杂.更为简单的方法就是以A的坐标加A.C直线的角度求解,使用atan2函数求出A.B直线的角度再加上60就是A.C的角度,使用A.B求出等边三角形的边长. #include <cstdio> #include <cmath> #include <iostream> usi…
2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contest Print Server [题解]: 题目大意:输入 n,s,x,y,mod  分别队伍数n,还有一个s生成函数 s=((s*x)+y)%mod,就是打印机根据要求打印纸张,打印到s时,打印机将重置,生成新的s [code]: #include <iostream> #include <…
Rescue The PrincessCrawling in process... Crawling failed   Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry  the princess set out immediately.…
A : Rescue The Princess 题意: 给你平面上的两个点A,B,求点C使得A,B,C逆时针成等边三角形. 思路: http://www.cnblogs.com/E-star/archive/2013/06/11/3131563.html   向量的旋转. 直接套公式就行,或者我们可以找到等式解一个二元一次方程然后向量判断方向即可.我比较懒,就写了向量旋转的. #include <iostream> #include <cstdio> #include <cm…
题目地址:http://acm.upc.edu.cn/problemset.php?page=13  2217~2226 A.Rescue The Princess 一个等边三角形告诉前2个点,求逆时针序的第三个点坐标. 简单几何,其实做法有很多,好像大多数都是带直线方程然后判断方向做的.我觉得直接将A放在原点,让B绕A逆时针旋转60度,最后加上A的偏移更简单.旋转直接用方向向量乘旋转矩阵就好. #include <map> #include <set> #include <…
    今年双十一淘宝推出了虚拟现实VR购物"BUY+",用户可以在虚拟环境中选购商品.那作为竞争对手的京东将使出什么绝招呢?在近日上海举办的谷歌开发者大会上得到了答案.会上京东推出了一款基于谷歌Tangao技术开发的国内首款AR购物应用.       这款名为JD Dream的AR应用吸引了无数人的目光,来自谷歌的工程师现场演示了JD Dream中AR购物的功能.目前这部分功能针对于家居家装,用户可挑选该场馆中的虚拟家居产品,并在手机上看到真实空间中1:1的摆放效果.用户可移动和旋转…