简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxn 105bool map[maxn][maxn];int test(int x, int y, int l){ int ans = 0; for (int i = x; i < x + l; i++) for (int j = y; j < y + l; j++) if (map[i][j]) ans++
转载
2011-04-08 18:13:00
13阅读
2评论
#include<iostream>#include<string>using namespace std;int table[101][101];int main(){ string str; int n,x,y,l; cin>>n; while(n--) { cin>>str>>x>>y>>l; if(str=="BLACK") for(int i=x;i<x+l;++i) for(int j=y;j<y+l;++j) table[i][j]=1; else if(str==
转载
2011-07-22 20:24:00
48阅读
2评论
Jisoo tarjan求割边 对于一条$(u,v)$,如果他是割边,那么v子树中一定有一个点s$low_s>dfn_u$ 然后改造一下搜索函数 #include<iostream> #include<cstdio> #include<algorithm> #include<stack> using ...
转载
2021-07-27 23:36:00
76阅读
2评论
题目传送门知识点无向图边双连通分量模板\(vector+PII\)的自定义排序#include <bits/stdc++.h>using namespace std;const int N = 5010, M = 20010;typedef pair<int, int> PII;int n, m;int h[N], e[M], ne[M], idx;int dfn[
原创
2022-04-20 15:58:53
113阅读
题目描述 因为某国被某红色政权残酷的高压暴力统治。美国派出将军uim,对该国进行战略性措施,以解救涂炭的生灵。 该国有n个城市,这些城市以铁路相连。任意两个城市都可以通过铁路直接或者间接到达。 uim发现有些铁路被毁坏之后,某两个城市无法互相通过铁路到达。这样的铁路就被称为key road。 uim
转载
2016-09-11 14:38:00
93阅读
2评论
FZU
转载
2012-04-13 01:20:00
73阅读
2评论
How many different numbersTime Limit:1sMemory limit:32MAccepted Submit:70Total Submit:490 Recently oaiei has encountered a problem. And he needs your help. T
原创
2021-08-20 14:59:02
96阅读
如果流存储有 id = ptr 的 (id, value) 对,则找出从 id = ptr 开始的 最长 id 连续递增序列 ,并 按顺序 返能接收 n 个值的流,并将当前指针 ptr 设为 1。...
原创
2022-12-27 12:34:10
918阅读
传送门 题目大意:炸毁一条道路使图不连通 题解:tarjian求割边 代码: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define maxn 5202 using namespace std
转载
2017-10-23 21:04:00
20阅读
2评论
/*【题意】对于一个100*100棋盘,进行下列三种操作BLACK x y l 将(x,y)为左上角,边长为l的正方形涂黑WHITE x y
原创
2023-08-21 16:43:00
76阅读
题目描述 因为某国被某红色政权残酷的高压暴力统治。美国派出将军uim,对该国进行战略性措施,以解救涂炭的生灵。 该国有n个城市,这些城市以铁路相连。任意两个城市都可以通过铁路直接或者间接到达。 uim发现有些铁路被毁坏之后,某两个城市无法互相通过铁路到达。这样的铁路就被称为key road。 uim
原创
2021-07-27 16:18:44
109阅读
1656. 设计有序dStream(int n) 构造一个能接收 n 个值的流,并将当前指针 ptr 设为 1 。String[] insert(int id,
原创
2023-01-31 15:09:13
86阅读
tarjan求桥
原创
2023-02-16 08:19:01
45阅读
题目戳 题目描述 因为某国被某红色政权残酷的高压暴力统治。美国派出将军uim,对该国进行战略性措施,以解救涂炭的生灵。 该国有n个城市,这些城市以铁路相连。任意两个城市都可以通过铁路直接或者间接到达。 uim发现有些铁路被毁坏之后,某两个城市无法互相通过铁路到达。这样的铁路就被称为key road。
原创
2021-06-06 22:39:02
182阅读
Description FlyBrother is a superman, therefore he is always busy saving the world. To graduate from NUDT is boring but necessary for him. Typically W
转载
2018-01-22 21:26:00
39阅读
2评论
图论 连通分量 桥
转载
2016-11-11 23:52:00
38阅读
2评论
题目:原题链接(简单)标签:设计、数组解法时间复杂度空间复杂度执行用时Ans 1 (Python)初始化 = O(N)O(N)O(N) ; insert = O(L)O(L)O(L)O(N)O(N)O(N)184ms (45.19%)Ans 2 (Python)Ans 3 (Python)
原创
2022-02-24 11:15:06
45阅读
题目:原题链接(简单)标签:设计、数组解法时间复杂度空间复杂度执行用时Ans 1 (Python)初始化 = O(N)O(N)O(N) ; insert = O(L)O(L)O(L)O(N)O(N)O(N)184ms (45.19%)Ans 2 (Python)Ans 3 (Python)解法一:class OrderedStream: def __init__(self, n: int): self.array =
原创
2021-08-26 10:29:45
80阅读
1656. 设计有序流(C++)1 题目描述2 示例描述3 解题提示4 源码详解(C++)1 题目描述有 n 个 (id, value) 对,其中 id 是 1 到 n 之间的一个整数,value 是一个字符串。不存在 id 相同的两个 (id, value) 对。 设计一个流,以 任意 顺序获取 n 个 (id, value) 对,并在多次调用时 按 id 递增的
原创
2022-10-17 22:23:18
81阅读
方案:将Java的毫秒(ms)转换为秒(s)
### 问题描述
在Java编程中,经常会遇到将毫秒(ms)转换为秒(s)的需求。例如,有时需要将一个以毫秒为单位的时间间隔,转换为以秒为单位的时间间隔,以便更好地处理或展示。
### 解决方案
为了解决这个问题,我们可以使用Java提供的基本操作和类库来进行转换。下面是一个包含代码示例的解决方案。
#### 代码示例
```java
publ
原创
2023-10-20 13:27:33
96阅读