![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
水
xiaoyulunUSC
这个作者很懒,什么都没留下…
展开
-
UVa 11995 I Can Guess the Data Structure!
I Can Guess the Data Structure!There is a bag-like data structure, supporting two operations:1 xThrow an element x into the bag.2Take out an element from the bag.Given a sequence of oper原创 2014-09-02 00:10:07 · 485 阅读 · 0 评论 -
Codeforces Round #291 (Div. 2) Han Solo and Lazer Gun
虽然好像是一道水题,但写这篇文章的意义在于——我第一次做出了CF的B题啊啊啊啊。做法就是计算所有卫兵的点与枪的点之间的斜率(其实用叉积做更好一些),然后对斜率排个序,再扫一遍就可以了嘛。#include #include #include #include #include using namespace std;#define eps 0.000000001#define原创 2015-02-17 16:24:06 · 544 阅读 · 0 评论 -
poj 2251 Dungeon Master
三维上的bfs,水题一发。#include #include #include #include #include using namespace std;#define INF 1000000queue q1,q2,q3;;char Map[35][35][35];int ans[35][35][35];int flag1[35][35][35];int L,R,C;原创 2014-12-17 21:56:47 · 492 阅读 · 0 评论 -
poj 3984 迷宫问题
最基本的bfs,只是要输出最短路径经过哪些点,网上的高端代码看不懂,只好弱弱的用STL上了。#include #include #include #include #include #include #include #include using namespace std;int Map[5][5];int Ans[5][5];bool flag[5][5];int原创 2014-12-24 21:23:27 · 563 阅读 · 0 评论 -
poj 3278 Catch That Cow
水水的bfs#include #include #include #include #include using namespace std;#define INF 100000int N,K;int ans[100005];int flag[100005];queue q;void bfs(){ while(!q.empty()){ int pos=q.fron原创 2014-12-19 22:15:55 · 546 阅读 · 0 评论 -
HDU 4716 A Computer Graphics Problem
#include #include #include using namespace std;int main(){ int t; scanf("%d",&t); int pos=1; while(t--){ printf("Case #%d:\n",pos++); int num; scanf("%d",&num); printf("*------------*\原创 2014-11-19 12:39:31 · 543 阅读 · 0 评论 -
HDU 4772 Zhuge Liang's Password
#include #include #include #include #include using namespace std;int a[305][305],b[305][305];int N;void solve(){memset(a,0,sizeof(a));memset(b,0,sizeof(b));for(int i=1;ifor(int原创 2014-11-17 22:51:24 · 601 阅读 · 0 评论 -
HDU 3342 Legal or Not
拓扑排序,直接pan原创 2014-11-12 23:04:35 · 563 阅读 · 0 评论 -
HDU 1869 六度分离(Floyd)
#include #include #include #include using namespace std;#define INF 10000000int n,m;int a[105][105];void warashall_floyd(){ for(int k=0;k<n;k++){ for(int i=0;i<n;i++){ for(int j=0;j<n;j+原创 2014-10-06 21:00:50 · 559 阅读 · 0 评论 -
UVa 11292 Dragon of Loowater
Problem C: The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime原创 2014-09-01 19:53:04 · 462 阅读 · 0 评论 -
HDU 2817 A sequence of numbers
水题,题目要求的就是等比数列或是等差数列的第k项等差数列就直接套通项公式嘛等比数列的话由于k可能非常大,所以要用快速幂#include #include #include #include using namespace std;#define MOD 200907int solve(int fac,int num){ if(fac==0) retu原创 2015-02-19 22:43:10 · 436 阅读 · 0 评论