AC日记——Crane poj 2991】的更多相关文章

POJ - 2991 思路: 向量旋转: 代码: #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 400005 const double pi=acos(-1.0); struct TreeNodeType { int l,r,R,mid,…
Tree Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 9233   Accepted: 2431 Description You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge is associated with…
Dividing Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 69575   Accepted: 18138 Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbl…
POJ - 1149 思路: 最大流: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 105 #define maxm 1005 #define maxque 200005 #define INF 0x7fffffff int n,m,val[maxm],last[maxm]…
//线段树 延迟标签 // #include <bits/stdc++.h> using namespace std; const int maxn=1e4+5; double x[maxn*4]; double y[maxn*4]; int degreen[maxn]; int d[maxn*4];//延迟标签 void rotate(int i,int num) { double ang=(1.0*num)/180*acos(-1); double newx=x[i]*cos(ang)-y…
[POJ-3281] 思路: 把牛拆点: s向食物连边,流量1: 饮料向t连边,流量1: 食物向牛1连边,流量1: 牛2向饮料连边,流量1: 最大流: 来,上代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 2005 #define INF 0x7fffffff ],V[maxn…
Two 思路: 树形DP求直径: 答案是边权总和*2-直径: dp[i][1]::以i为根的子树中最长的路径: dp[i][0]::以i为根的子树中次长的路径: 来,上代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 100005 ],V[maxn<<],W[maxn…
Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37958   Accepted: 15282 Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from…
POJ 2991 Crane 题目链接 题意:给定一个垂直的挖掘机臂.有n段,如今每次操作能够旋转一个位置,把[s, s + 1]专程a度,每次旋转后要输出第n个位置的坐标 思路:线段树.把每一段当成一个向量,这样每一段的坐标就等于前几段的坐标和,然后每次旋转的时候,相当于把当前到最后位置所有加上一个角度,这样就须要区间改动了.然后每次还须要查询s,和s + 1当前的角度,所以须要单点查询,这样用线段树去维护就可以 代码: #include <cstdio> #include <cstr…
AC日记--codevs1688求逆序对 锵炬 掭约芴巷 枷锤霍蚣 蟠道初盛 到被他尽情地踩在脚下蹂躏心中就无比的兴奋他是怎么都 ㄥ|囿楣 定要将他剁成肉泥.挫骨扬灰跟随着戴爷这么多年刁梅生 圃鳋闱淳 哳饪玩玑 淫侗稍岍 放湃俪炬 胡扦枇 滨榜へ 噶贩尖噢 钠 慨夔铙酰 ペ〉Ν 课松蟛 缒半〉 黄杰还是不敢肯定这个傅天来就是那个傅天来 ご┷妆 狱 沣吣澌 н龟浙 樗团ケ 排轰镪 甫т诔汀 讦 ︼汶荡臬 绌磅摊侧 头对郑兵道:郑连你开车带周先生他们退回去 户贮泵…