ICode9

精准搜索请尝试: 精确搜索
  • [Swift]LeetCode780. 到达终点 | Reaching Points2019-03-16 13:54:23

    A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) and a target point (tx, ty), return True if and only if a sequence of moves exists to transform the point (sx, sy) to (tx,

  • Codeforces Round #541 (Div. 2)F. Asya And Kittens(启发式合并+并查集+构造)2019-03-06 22:57:09

    题目链接:http://codeforces.com/contest/1131/problem/F 题目大意 给定n个操作,其意义是把两个线段区间合并成一个, 现在要构造一种排列使得这些操作合法。 题目分析  我们可以用并查集来表示一个已经归为一种类型的区间, 那么对于下一种操作x,y我们可以用vector数组来模拟合并

  • dfs关于按钮问题(flip游戏POJ1753)以及和bfs的区别+板子2019-02-26 21:02:46

         DFS深度搜索;之前一直和bfs的用法搞不太清楚;写了题才能慢慢参透吧,看了别的博客的代码,感觉能更好理解dfs在图中的应用; 这个题目的意思是一个人去救另一个人,找出最短的寻找路径; #include<stdio.h>int n,m,p,q,min=99999999;int a[51][51],book[51][51];void dfs(int x,int y,

  • auto_prt的VS版本源码剖析2019-02-22 23:41:29

    通过对VC版本的auto_ptr的源代码得知VC版本还有一点小缺陷,又对VS版本的auto_ptr做了一些剖析,具体代码和注释如下: 1 //假设全局pa2都是用pa1来构造 2 //如:pa2(pa1)、pa2=pa1 3 4 template<class _Ty> //auto_ptr类声明 5 class auto_ptr; 6 7 template<class _T

  • 洛谷 P2895 [USACO08FEB]流星雨Meteor Shower 题解2019-02-16 19:48:12

    一起来看流星雨吧(话说我还没看到过流星雨呢) Problem 小A则听说另一个骇人听闻的消息: 一场流星雨即将袭击整个霸中,由于流星体积过大,它们无法在撞击到地面前燃烧殆尽,届时将会对它撞到的一切东西造成毁灭性的打击。 很自然地,小A开始担心自己的安全问题。他一定要在被流星砸到前,到达一

  • java写bfs2019-02-06 12:42:42

    Find a way  HDU - 2612 Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the countryside, but Merceki’s home is

  • 牛客寒假6-J.迷宫2019-02-05 17:42:20

    链接:https://ac.nowcoder.com/acm/contest/332/J 题意: 你在一个 n 行 m 列的网格迷宫中,迷宫的每一格要么为空,要么有一个障碍。 你当前在第 r 行第 c 列(保证该格子为空)。每次移动你可以向上下左右任意一个方向移动一格,前提是不能走到障碍上,也不能超出迷宫的边界。 你向左移动的次

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有