求割点模板:void dfs(int fa, int u){ low[u] = dfn[u] = cnt++; for (int i = 0; i < n; i++) if (g[u][i] && i != fa) { if (dfn[i] == -1) { dfs(u, i); low[u] = min(low[i], low[u]); if (dfn[u] <= low[i]) i...
转载 2011-08-29 15:27:00
70阅读
2评论
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains
转载 2020-04-14 16:53:00
79阅读
2评论
1 class Solution: 2 def movesToMakeZigzag(self, nums: 'List[int]') -> int: 3 n = len(nums) 4 if n == 1: 5 return 0 6 elif n == 2: 7 if nu
转载 2019-08-04 12:21:00
24阅读
【题目链接】 点击打开链接 【算法】 Tarjan算法求割点 【代码】
转载 2018-06-10 10:43:00
50阅读
2评论
点击打开链接套的啊哈算法上的板子当初学割点割边板子都是靠背的.. 节点u...
原创 2022-06-15 21:47:48
32阅读
题目地址:点击打开链接思路:简单模拟AC代码:#includeint a[110];int main(){ int k,m,i,j,l,x,sum,flag; int c,r; while(scanf("%d%d",&k,&m) && k) { flag = 1; for(i=0; i<k; i++) { scanf("%04d",&a[i]);
原创 2022-08-04 09:11:18
85阅读
Network http://poj.org/problem?id=1144 Time Limit: 1000MS Memory Limit: 10000K Description A Telephone Line Company (TLC) is establishing a new teleph
原创 2021-08-05 10:50:20
61阅读
NetworkTime Limit: 1000msMemory Limit: 10000KBThis problem will be judged onPKU. Original ID:114464-bit integer IO format:%lld Java class name:MainA T...
转载 2014-08-25 21:48:00
30阅读
题目题意:找出第一个未出现的正整数#include<iostream>#include<set>#include<vector>#include<algorithm>using namespace std;int main() { int n,m=1; cin>>n; set<int> an; f...
原创 2023-06-27 10:24:34
63阅读
用了#include <sstream> 来处理前面的数据,太好用了其他的就是用类似tarjan的算法来求割点.NetworkTime Limit:1000MSMemory Limit:10000KTotal Submissions:7537Accepted:3546DescriptionA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . N
转载 2013-05-14 09:49:00
61阅读
Description A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the same number. T
原创 2023-04-24 03:38:28
288阅读
1144A.DS 给出一个字符串,只可能包含小写字母,要求不能有重复的字符和里面的字母是一串连续的数字(bcdef...),输出Yes或No。 对字符串排序即可。 #include<bits/stdc++.h> using namespace std; const int maxn=2e5+100;
转载 2020-07-16 16:47:00
49阅读
2评论
PAT 1144 java 版1.题意给出N个整数的序列,你需要找出序列中未出现的最小正整数。2.分析使用数组存储未被找到过的数字使用Set粗出未被找到过的数字3.测试用例105 -25 9 6 1 3 4 2 5 17105 7 9 6 1 3 4 2 8 104.代码import java.io.BufferedReader;import java.io.I...
原创 2021-07-07 14:26:30
140阅读
PAT 1144 java 版1.题意给出N个整数的序列,你需要找出序列中未出现的最小正整数。2.分析使用数组存储未被找到过的数字使用Set粗出未被找到过的数字3.测试用例105 -25 9 6 1 3 4 2 5 17105 7 9 6 1 3 4 2 8 104.代码import java.io.BufferedReader;import java.io.I...
原创 2022-01-26 10:29:15
51阅读
#include<iostream>#include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h>#include<algorithm> #include<map>#include<vector>#inclu...
原创 2022-07-14 10:17:32
27阅读
PAT 1144 C++ 版1.题意不再分析。2.测试用例105 -25 9 6 1 3 4 2 5 1751 2 3 4 551 2 3 5 62 1 -13.代码#include<cstdio> #include<algorithm># define N 100001int main(){ int total; scanf...
原创 2022-01-26 10:28:03
31阅读
问题 Fate 有 n 个 ACM/ICPC 比赛的模板,每个都是一个独立的 PDF 文件。为了便于打印,万神希望将这些模板合并成一个 PDF 文件。万神有一个工具,可以将至多 k 个 PDF 文件合并为 1 个,合并后的文件大小是原来 k 个文件的大小之和。万神发现,这个工具每次运行的时间正比于输
原创 2021-07-22 14:06:37
86阅读
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains
转载 2019-03-01 20:24:00
122阅读
2评论
= 哈希函数构造方法:H(key) = key % TSize (除留余数法) 处理冲突方法:Hi = (H(key) + di) % TSize (开放地址发——二次方探测再散列) 其中di为 1*1 , -1*1 , 2*2 ...
原创 2022-06-16 06:11:46
64阅读
1144Th
原创 2022-09-15 11:03:07
48阅读
  • 1
  • 2
  • 3
  • 4
  • 5