![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
J先生的编程笔记
一杯茶,一包烟,一个 BUG 改一天!
展开
-
1011
1011 Maximum element and its index from each row of a 2-D array. 1 Key Points int arr[3][3]; int index = max_element(arr[i], arr[i] + 3) - arr[i]; int value = *max_element(arr[i], arr[i] + 3); 2 Answ...原创 2019-04-21 15:13:08 · 136 阅读 · 0 评论 -
1013
1013 dfs and 并查集 1 Key Points 森林中, 连通分量的个数 = 树的个数 = 节点个数 - 边的条数, 但是在图中却不一定, 因为图中可能存在环. 图的dfs void dfs(int i) { visited[i] = 1; for (int j = 1; j <= N; j++) { if (visited[j] == 0 && g[...转载 2019-04-21 15:23:46 · 117 阅读 · 0 评论 -
1014
1014 1 Key Points Note that since the bank is closed everyday after 17:00, for those customers who cannot be served before 17:00, you must output “Sorry” instead. 如果不能在17:00之前开始服务,则输出“Sorry” vector&l...转载 2019-04-21 15:32:16 · 531 阅读 · 0 评论