echobfy

博客园 首页 新随笔 联系 订阅 管理

2014年3月2日 #

摘要: 排序题#include #include #include #include #include using namespace std;const int N = 100005;int score[10];struct Node{ int id; int problem; int get;}person[N];struct ANS{ int rank; int id; int total; int get[6]; bool flag; int perfect;}ans[10005];int cmp1(const ANS &a, const ANS &b){ if (a.tota 阅读全文
posted @ 2014-03-02 15:05 小白哥哥啊 阅读(290) 评论(0) 推荐(0) 编辑

摘要: BFS,题意比较难懂,是求离query L层的总共人数#include #include #include #include #include #include #include using namespace std;const int N = 1005;struct E{ int node;};vector v[N];int mark[N];void add_edge(int a, int b){ E tmp; tmp.node = b; v[a].push_back(tmp);}struct ANS{ int num; int lev;};void BFS(int x, int ll){ 阅读全文
posted @ 2014-03-02 15:03 小白哥哥啊 阅读(438) 评论(0) 推荐(0) 编辑

摘要: 模拟题,注意当k == 1 与 k == n时情况#include #include #include #include #include using namespace std;const int N = 100005;struct Node{ int pre; int value; int lat;}node[N];int order[N];int size;map pre2idx;void solve1(int fir, int n){ map::iterator it = pre2idx.find(fir); order[size++] = it->second; while ( 阅读全文
posted @ 2014-03-02 15:00 小白哥哥啊 阅读(606) 评论(8) 推荐(0) 编辑