上一页 1 ··· 72 73 74 75 76 77 78 79 80 ··· 97 下一页
摘要: 【概述】 LexBFS 是字典序广度优先搜索(Lexicographic BFS),其常用于弦图的判定。 每次按从 n 到 1 的顺序依次给点编号,每个点维护一个 list,用于记录与其相邻的已标号点的标号,每次选择 list 中字典序最大的未标号点标号。 L... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(113) 评论(0) 推荐(0)
摘要: 【本文思路】 整理自 CDQ 巨佬的弦图与区间图,具体内容:点击这里 【概述】 1.基本概念 设有图 G=(V,E),则: 当 V'∈V,E'∈E 时,图 G'=(V',E') 是图 G 的子图当 V'∈V,E'={∀x∈V',∀y∈V',(x,y)∈E'} ... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(335) 评论(0) 推荐(0)
摘要: 题目描述 小 N 最近在研究 NP 完全问题,小 O 看小 N 研究得热火朝天,便给他出了一道这样的题目: 有 n 个球,用整数 1 到 n 编号。还有 m 个筐子,用整数 1 到 m 编号。每个筐子最多能装 3 个球。 每个球只能放进特定的筐子中。... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(30) 评论(0) 推荐(0)
摘要: 【唯一分解定理】 对于任意一个大于 1 的正整数 n,都有且只有一种方式写出其素因子的乘积表达式。 即:,其中, 均为素数 因此,当给出一个数 n 时,可以暴力枚举,以获取 n 的素因子 map num;//记录素因子个数int factor[N],cntF;... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(167) 评论(0) 推荐(0)
摘要: Problem Description Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and ... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(14) 评论(0) 推荐(0)
摘要: Problem Description Stancu likes space travels but he is a poor software developer and will never be able to buy his own spacec... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(40) 评论(0) 推荐(0)
摘要: 题目描述 给出一个有理数 ,求c mod 19260817的值。 输入输出格式 输入格式: 一共两行。 第一行,一个整数a。 第二行,一个整数b。 对于所有数据,0≤a,b≤10^10001 输出格式: 一个整数,代表求余后的结果。如果无解... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(63) 评论(0) 推荐(0)
摘要: 题目描述 给定n,p求1~n中所有整数在模p意义下的乘法逆元。 输入输出格式 输入格式: 一行n,p 1≤n≤3×10^6 ,n#include#include#include#include#include#include#include#in... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(25) 评论(0) 推荐(0)
摘要: Problem Description You are given an elliptical shaped land and you are asked to choose n arbitrary points on its boundary. The... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(37) 评论(0) 推荐(0)
摘要: Problem Description Given a list of N integers with absolute values no larger than 10 15, find a non empty subset of these numb... 阅读全文
posted @ 2022-09-20 22:52 老程序员111 阅读(112) 评论(0) 推荐(0)
上一页 1 ··· 72 73 74 75 76 77 78 79 80 ··· 97 下一页