ICode9

精准搜索请尝试: 精确搜索
  • P1596 [USACO10OCT]Lake Counting S2021-04-06 23:32:44

        #include<bits/stdc++.h> using namespace std; int dir[8][2]={ {1,1}, {1,-1}, {1,0}, {0,1}, {0,-1}, {-1,-1}, {-1,0}, {-1,1} }; char maps[101][101]; int ans,n,m; bool check(int x,int y) { return x>=0&&

  • 洛谷-P1596 [USACO10OCT]Lake Counting S2020-12-21 09:34:59

    洛谷-P1596 [USACO10OCT]Lake Counting S 原题链接:https://www.luogu.com.cn/problem/P1596 题目描述 输入格式 输出格式 输入输出样例 说明/提示 C++代码 题目描述 Due to recent rains, water has pooled in various places in Farmer John's field, which is represented

  • P1596 [USACO10OCT]Lake Counting S2020-05-15 15:54:45

    一篇比较水的题,我还是卡了好久,其实一开始我用了stl队列写出来了,为了挑战一下自己,就决定分别用DFS,BFS(手写队列),BFS(queue)三种方法写了出来## DFS代码如下```cpp#include<iostream>#include<cstdio>#include<math.h>#include<algorithm>#include<cstring>//常规五行起步 using namespa

  • P1596 [USACO10OCT]Lake Counting S(八连通问题)2020-04-18 18:01:15

    由于近期的降雨,雨水汇集在农民约翰的田地不同的地方。我们用一个NxM(1<=N<=100;1<=M<=100)网格图表示。每个网格中有水('W') 或是旱地('.')。一个网格与其周围的八个网格相连,而一组相连的网格视为一个水坑。约翰想弄清楚他的田地已经形成了多少水坑。给出约翰田地的示意图,确定当

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

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

ICode9版权所有