
ACM
文章平均质量分 87
_Scarlett
这个作者很懒,什么都没留下…
展开
-
POJ2362
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int a[250],vis[205],sum,l,n; int dfs(int x,int pos,int len) { if(x == 3)原创 2016-03-10 19:44:13 · 326 阅读 · 0 评论 -
hdu5775 Bubble Sort 树状数组维护逆序数
题目链接###题意解读理解冒泡排序的过程最左坐标值为当前坐标和最终坐标的最小值()最右坐标值为当前坐标加右边较小数据的个数(每个比当前值小的右边的数据都会和当前值交换)树状数组从右往左扫,将当前值对应在数组中的位置更新为1,求比其小的数已经有几个存在。ps:描述不太严谨不想用数学公式咋办,还是看代码吧,理解就好。#include<iostream>#include<cstdio>#i原创 2016-07-29 17:42:24 · 492 阅读 · 0 评论 -
莫队算法 HDU4638
区间问题 暴力解法+离线处理题目传送门:小Z的袜子#include <iostream>#include<cstring>#include<algorithm>#include<cmath>#include <cstdio>using namespace std;#define maxn 50010typedef long long ll;int n,m;int a[maxn]=原创 2016-07-31 15:33:21 · 526 阅读 · 0 评论 -
HDU 4707 pet
#include<iostream>#include<cstdio>#include<vector>#include<queue>#include<cstring>using namespace std;const int N=100010;vector<int> Tree[N];int d;int ans;int vis[N];void bfs(int u){ ans原创 2016-10-21 20:28:57 · 331 阅读 · 0 评论 -
树状数组的应用系列
HDU1556 Color the ballHDU1349 Minimum Inversion NumberHDU4417 Super Mario原创 2016-07-29 19:05:52 · 1552 阅读 · 0 评论 -
STL--set multiset
set用法转载 2016-10-26 19:55:13 · 334 阅读 · 0 评论 -
hdu5952 Counting Cliques 2016 沈阳 1005 vector还是慢
#include<iostream>#include<bitset>#include<cstdio>#include<vector>#include<cstring>using namespace std;const int N=105;int mp[N][N];int du[N];int n,m,s;vector<int> R,RR;int result;void dfs(i原创 2016-10-30 17:06:59 · 431 阅读 · 0 评论 -
bitset 使用
http://blog.163.com/lixiangqiu_9202/blog/static/53575037201251121331412/转载 2016-10-30 14:11:29 · 372 阅读 · 0 评论 -
HDU4576 A very hard mathematic problem(很好的搜索)
#include<iostream>#include<cmath>#include<cstdio>using namespace std;typedef long long ll;ll power(ll a,ll n){ ll ans=1; while(n>0){ if(n&1) ans*=a; a=a*a;//a=a的 2的i次方 的次方原创 2017-05-26 23:45:03 · 332 阅读 · 0 评论 -
zhishangbuzaixianxilie
#include<iostream>#include<cstdio>#include<string>#include<cstring>#include<cmath>using namespace std;bool dis[200010];int main(){ long long t,n,m; int x[700],y[700]; cin>>t; while原创 2016-07-26 16:24:36 · 276 阅读 · 0 评论 -
HDU5592 ZYB's Premutation 树状数组应用
#include<iostream>#include<stdio.h>#include<string>#include<algorithm>using namespace std;int a[50005];//已知数组;int c[50005];//树状数组;int n; int lowBit(int x) //计算2^K的值,即下标为X的结点管辖的范围 {原创 2016-06-03 10:16:06 · 299 阅读 · 0 评论 -
HDU 3349-lazy gege
#include<iostream>#include<cmath>#include<cstdio>using namespace std;int main(){ int t; double a,b,l,sl; double s; cin>>t; while(t--){ cin>>l>>a>>b; b=b<a?b:a;原创 2016-04-29 19:35:29 · 397 阅读 · 0 评论 -
Codeforces 584C Marina and Vasya
先上俩链接,过后再来补题 题意理解加分类讨论 贪心原创 2016-05-04 18:28:36 · 363 阅读 · 0 评论 -
CodeForces 580C 树+dfs搜索
Description Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1.原创 2016-05-05 22:11:24 · 808 阅读 · 0 评论 -
CodeForces 505B Mr. Kitayuta's Colorful Graph
关于昨晚的B题 正常说,水题,深搜或者并查集都能做 然而 是谁说过看了看数据觉得能做就敲代码了。要保存错误现场的代码#include<iostream>#include<cstdio>#include<string>#include<cstring>#include<vector>#include<set>#include<algorithm>using namespace st原创 2016-05-18 09:23:37 · 445 阅读 · 0 评论 -
poj1129Channel Allocation 乱做,dfs或+四色定理
DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each repea原创 2016-05-04 08:42:58 · 388 阅读 · 0 评论 -
CodeForces Round #305 (div1) B. Mike and Feet (单调栈)
B - Mike and Feet Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Description Mike is原创 2016-05-12 20:57:42 · 436 阅读 · 0 评论 -
HDU3760 Ideal Path 逆bfs+贪心
题目链接题意最短路径 1–>n;多条路径情况下选择路径字典序最小的解题n–>1 bfs最短路 1–>n 满足最短路的条件下找最小颜色代码#include<iostream>#include<cstdio>#include<algorithm>#include<queue>#include<cstring>#include<vector>#define inf 0x3f3f3f3f原创 2016-05-19 11:21:01 · 504 阅读 · 0 评论 -
HDU 3199 Hamming Problem 丑数
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description For each three prime numbers p1, p2 and p3, let’s define Hamming sequence Hi(p1, p2,原创 2016-05-14 14:18:08 · 861 阅读 · 0 评论 -
2016ICPC北京现场赛打铁退役之旅
流水账11月11日出行,两支队伍一起去北京,也没什么好说的,我们先到站上车,后来他们也到了。上午走,下午到,然后找宾馆入住。晚饭六个人一起披萨自助,拍了照也不想传图。第二天上午要去北大报道(PS:反正是游客身份进北大清华不是第一次了,不像某昱学长考进清华前绝不以游客身份进清华),所以前一晚和男生们约了第二天九点出门吃早饭去北大报道。结果是第二天去敲门的时候还有俩没醒,ok好吧,然后我们就出门原创 2016-11-15 15:00:46 · 1444 阅读 · 5 评论