自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 A - 棋盘问题 (太久不刷题了 从头开始)

A - 棋盘问题#include<string>#include<set>#include<map>#include<queue>#include<stack>#include<cmath>#include<vector>#include<iostream>#include<algorithm>#include<cstdio>#include<cstring&g

2021-04-28 20:22:18 80

原创 D ABC Conjecture(欧拉筛)2020 China Collegiate Programming Contest Weihai Site

题意定义函数rad(x)为x的质因子之积给定c,求是否能找到两个正整数a,b,使得a+b=c且c>rad(abc)T(1<=T<=10)c(1<=c<=1e18)Sample Input341830Sample Outputyesyesno思路对于一个符合条件的数n,我们可以得出,该数一定可以拆分成n=abccd的模式即该数的因子中一定有某个完全平方数。那么问题就被简化成了判断是否含有一个完全平方因子,不过我们观察到c<=1e18

2020-10-27 16:53:55 335 1

原创 L Clock Master(分组背包)2020 China Collegiate Programming Contest Weihai Site

With the rapid development of society, the demand for high-precision clocks is constantly rising. Recently, the China Clock Production Company is developing a new type of clock, which can represent a wide range of times.The novel clock displays the curren

2020-10-27 15:33:17 352

原创 Searchlights (CodeForces - 1408D)

Searchlights题目There are nn robbers at coordinates (a1,b1),(a2,b2), …,(an,bn) and mm searchlight at coordinates (c1,d1), (c2,d2), …, (cm,dm).In one move you can move each robber to the right (increase ai of each robber by one) or move each robber up (inc

2020-10-10 16:17:50 121

原创 Returning Home(CodeForces - 1422D)

Returning HomeYura has been walking for some time already and is planning to return home. He needs to get home as fast as possible. To do this, Yura can use the instant-movement locations around the city.Let’s represent the city as an area of n×n square

2020-10-07 16:39:24 238

原创 ACM之博弈论

1.巴什博弈所谓巴什博弈,是ACM题中最简单的组合游戏,大致上是这样的:只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取1个,最多取m个,最后取光者得胜。显然,如果n = m + 1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果 n = (m + 1) * r + s ,(r为任意自然数,s≤m),即n%(m+1) != 0,则先手必胜。巴什博弈还是很好理解的,以你是先手的角度考虑。你想把对手给弄垮

2020-10-03 17:29:16 996

原创 HDU - 6736(找环)

HDU - 6736(找环)The kingdom of Z is fighting against desertification these years since there are plenty of deserts in its wide and huge territory. The deserts are too arid to have rainfall or human habitation, and the only creatures that can live inside the

2020-09-29 16:50:11 149

原创 HDU - 6739 Invoker(DP)

HDU - 6739 Invoker(DP)In dota2, there is a hero named Invoker. He has 3 basic skills in the game, which are Quas, Wex and Exort. Once he launches a basic skill, he will gain the corresponding element, where Quas gives “Q”, Wex gives “W” and Exort gives “E

2020-09-29 15:52:08 198

原创 快乐补题-SDNU_ACM_ICPC_2020_Winter_Practice_2st——E

Yuanfang is puzzled with the question below:There are n integers, a 1, a 2, …, a n. The initial values of them are 0. There are four kinds of operations.Operation 1: Add c to each number between a x...

2020-02-15 18:02:33 148

原创 快乐补题-SDNU_ACM_ICPC_2020_Winter_Practice_1st——F

Thor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this phone. Thor is fascinated by this phone. He has only one minor issue: he can’t count the numbe...

2020-02-15 17:53:54 369

原创 快乐补题-SDNU_ACM_ICPC_2020_Winter_Practice_1st——D

Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation...

2020-02-10 18:52:12 317

原创 ACM模板(自用)

目录常用头文件读入优化并查集欧拉筛快速幂常用头文件#include<set>#include<map>#include<cmath>#include<queue>#include<stack>#include<string>#include<cstdio>#include<cstring&g...

2019-11-26 18:48:16 324

原创 线段树(fake)模板

应该是区间修改+区间求和=.=#include<set>#include<string>#include<cstring>#include<cmath>#include<iostream>#include<cstdio>#include<map>#include<queue>#incl...

2019-11-24 19:11:49 266

原创 拓扑排序(未完善 谨慎套用)

#include<map>#include<set>#include<vector>#include<cmath>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<queue...

2019-11-19 21:21:04 104 1

原创 读入优化与输出优化

#include<cmath>#include<bits/stdc++.h>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<string>using namespace std;#defin...

2019-11-19 18:25:22 75

原创 STL之优先队列

//https://www.luogu.org/problem/P3378#include<cmath>#include<bits/stdc++.h>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<...

2019-11-19 18:24:27 86

原创 最小生成树——Kruskal与Prim

最小生成树例题: 洛谷3366题目描述如题,给出一个无向图,求出最小生成树,如果该图不连通,则输出orz输入格式第一行包含两个整数N、M,表示该图共有N个结点和M条无向边。(N<=5000,M<=200000)接下来M行每行包含三个整数Xi、Yi、Zi,表示有一条长度为Zi的无向边连接结点Xi、Yi输出格式输出包含一个数,即最小生成树的各边的长度之和;如果该图不连通则输...

2019-11-06 19:48:26 185

原创 优先队列优化dij

优先队列优化dij例题: 洛谷4779题目描述给定一个 NN 个点,MM 条有向边的带非负权图,请你计算从 SS 出发,到每个点的距离。数据保证你能从 SS 出发到任意点。输入格式第一行为三个正整数 N, M, S。 第二行起 MM 行,每行三个非负整数 ui,vi,w,表示从 ui到 vi有一条权值为 wi 的边。输出格式输出一行 N个空格分隔的非负整数,表示 S到每个点的距离。...

2019-11-06 19:05:23 469

原创 欧拉筛

欧拉筛例题: 洛谷3383题目描述如题,给定一个范围N,你需要处理M个某数字是否为质数的询问(每个数字均在范围1-N内)输入格式第一行包含两个正整数N、M,分别表示查询的范围和查询的个数。接下来M行每行包含一个不小于1且不大于N的整数,即询问该数是否为质数。输出格式输出包含M行,每行为Yes或No,即依次为每一个询问的结果。s为运算结果输入输出样例输入#1100 523...

2019-11-06 18:28:05 404

原创 快速幂

快速幂例题: 洛谷1226题目描述输入b,p,k的值,求b^p mod k的值。其中b,p,k*k为长整型数。输入格式三个整数b,p,k.输出格式输出“b^p mod k=s”s为运算结果输入输出样例输入#12 10 9输出#12^10 mod 9=7//https://www.luogu.org/problem/P1226#include<cmath&gt...

2019-11-06 18:24:42 51

原创 gcd与exgcd

gcd与exgcd#include<cmath>#include<bits/stdc++.h>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<string>using namespace s...

2019-11-06 18:19:39 111

原创 并查集

并查集例题 洛谷3367题目描述如题,现在有一个并查集,你需要完成合并和查询操作。输入格式第一行包含两个正整数N、M,分别表示查询的范围和查询的个数。接下来M行每行包含一个不小于1且不大于N的整数,即询问该数是否为质数。输出格式输出包含M行,每行为Yes或No,即依次为每一个询问的结果。输入输出样例输入4 72 1 21 1 22 1 21 3 42 1...

2019-11-06 18:14:41 109

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除