Loading

上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 85 下一页
摘要: A题:走廊泼水节 链接:https://ac.nowcoder.com/acm/contest/1056/A 题目描述 给定一棵N个节点的树,要求增加若干条边,把这棵树扩充为完全图,并满足图的唯一最小生成树仍然是这棵树。 求增加的边的权值总和最小是多少。 输入描述: 第一行包含整数t,表示共有t组测 阅读全文
posted @ 2020-08-08 10:42 RioTian 阅读(240) 评论(0) 推荐(0)
摘要: 题目链接: https://ac.nowcoder.com/acm/contest/999/B 思路:(见图中解释) AC代码: #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1000 阅读全文
posted @ 2020-08-07 16:36 RioTian 阅读(130) 评论(0) 推荐(1)
摘要: 递归在计算机中是如何实现的 ? 换句话说,它最终被编译成什么样的机器语言 ? 这就要从函数调用说起。实际上,一台典型的32位计算机采用 “堆栈结构” 来实现函数调用,它在汇编语言中,把函数所需的第k个,第k - 1个,..第1个参数依次入栈,然后执行call(address)指令。该指令把返回地址( 阅读全文
posted @ 2020-08-07 15:24 RioTian 阅读(207) 评论(0) 推荐(2)
摘要: SAT 是适定性(Satisfiability)问题的简称。一般形式为 k - 适定性问题,简称 k-SAT。而当 \(k>2\) 时该问题为 NP 完全的。所以我们只研究 \(k=2\) 的情况。 定义 2-SAT,简单的说就是给出 \(n\) 个集合,每个集合有两个元素,已知若干个 \(<a,b 阅读全文
posted @ 2020-08-07 13:48 RioTian 阅读(739) 评论(0) 推荐(2)
摘要: A题:a^b https://ac.nowcoder.com/acm/contest/996/A 题目描述 求 a 的 b 次方对 p 取模的值,其中 0 ⇐ a,b,p ⇐ 10^9 输入描述: 三个用空格隔开的整数a,b和p。 输出描述: 一个整数,表示a^b mod p的值。 实例: 输入: 阅读全文
posted @ 2020-08-07 13:05 RioTian 阅读(561) 评论(0) 推荐(0)
摘要: 什么是连通图 ? 在图论中,连通图基于连通的概念。在一个无向图 G 中,若从顶点 \(i\) 到顶点 \(j\) 有路径相连(当然从 \(j\) 到 \(i\) 也一定有路径),则称 \(i\) 和 \(j\) 是连通的。如果 G 是有向图,那么连接 \(i\) 和j的路径中所有的边都必须同向。如果 阅读全文
posted @ 2020-08-06 10:46 RioTian 阅读(8627) 评论(2) 推荐(3)
该文被密码保护。 阅读全文
posted @ 2020-08-06 09:02 RioTian 阅读(41) 评论(0) 推荐(1)
摘要: B题 Telephone Lines https://ac.nowcoder.com/acm/contest/1055/B 中文题面:https://www.luogu.com.cn/problem/P1948 分层图最短路 #include <bits/stdc++.h> using namesp 阅读全文
posted @ 2020-08-05 15:51 RioTian 阅读(236) 评论(0) 推荐(1)
摘要: 简介 ST 表是用于解决 可重复贡献问题 的数据结构。 什么是可重复贡献问题? ​ 可重复贡献问题 是指对于运算 \(\operatorname{opt}\) ,满足 \(x\operatorname{opt} x=x\) ,则对应的区间询问就是一个可重复贡献问题。例如,最大值有 \(\max(x, 阅读全文
posted @ 2020-08-05 14:34 RioTian 阅读(4216) 评论(0) 推荐(4)
该文被密码保护。 阅读全文
posted @ 2020-08-05 14:28 RioTian 阅读(15) 评论(0) 推荐(1)
摘要: 珂朵莉树(Chtholly Tree)起源于CF896C,那道题要求我们实现一种数据结构,可以较快地实现: 区间加 区间赋值 求区间第k大值 求区间n次方和 原题如下: (CF896C Willem, Chtholly and Seniorious) Seniorious is made by li 阅读全文
posted @ 2020-08-04 17:19 RioTian 阅读(779) 评论(0) 推荐(3)
摘要: 题目链接:http://codeforces.com/problemset/problem/1191/B 题意:类似于麻将,三个一样花色一样数字的,或者三个同花顺就赢了,新抽的能当任何类型,问至少几个。 思路:分类判断即可。 AC代码: #include<bits/stdc++.h> using n 阅读全文
posted @ 2020-08-04 09:49 RioTian 阅读(179) 评论(1) 推荐(1)
该文被密码保护。 阅读全文
posted @ 2020-08-03 11:57 RioTian 阅读(12) 评论(0) 推荐(0)
摘要: A题 楼兰图腾 链接:https://ac.nowcoder.com/acm/contest/1032/A 树状数组 + 逆序对 #include<bits/stdc++.h> using namespace std; #define lowbit(x) (x & -x) typedef long 阅读全文
posted @ 2020-08-02 16:27 RioTian 阅读(198) 评论(1) 推荐(0)
摘要: A题 程序自动分析 题目链接:https://ac.nowcoder.com/acm/contest/1031/A 题目描述 在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足。 考虑一个约束满足问题的简化版本:假设 𝑥1, 𝑥2, 𝑥3, ⋯ 代表程序中出现的变量,给定 � 阅读全文
posted @ 2020-08-02 11:42 RioTian 阅读(334) 评论(0) 推荐(1)
上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 85 下一页