自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 资源 (10)
  • 收藏
  • 关注

原创 【代码超详解】LightOJ 1213 Fantasy of a Summation(思维 + 快速幂取模,8 ms)

一、题目描述样例输入:23 1 350001 2 32 3 350001 2二、算法分析说明与代码编写指导已知:三、AC 代码(8 ms)#include<cstdio>#pragma warning(disable:4996)template<class _Ty> inline _Ty PowerMod(_Ty radix, _Ty exp,...

2020-02-29 18:44:24 134

原创 【代码超详解】LightOJ 1214 Large Division(取余的性质,0 ms)

一、题目描述样例输入:6101 1010 67-101 1017678123668327637674887634 10111010000000000000000 256-202202202202000202202202 -101二、算法分析说明已知:取余的性质(C++ / Java 的 % 运算符为取余):1、当被除数能被除数整除时,无论被除数和除数的正负,余数都是 ...

2020-02-29 17:08:22 321

原创 负数的取余

取余的性质:1、当被除数能被除数整除时,无论被除数和除数的正负,余数都是 0。2、仅被除数为负时,余数才可能为负。3、余数的正负和除数无关。...

2020-02-29 16:50:59 6775

原创 【代码超详解】LightOJ 1234 Harmonic Number(技巧,260 ms)

一、题目描述Time limit3000 msMemory limit32768 kBOSLinuxSourceProblem Setter: Jane Alam JanIn mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In ...

2020-02-29 15:42:01 254

原创 【代码超详解】LightOJ 1236 Pairs Forming LCM(唯一分解定理)

一、题目描述Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++ ) ...

2020-02-29 14:31:46 158

原创 【代码超详解】LightOJ 1245 Harmonic Number (II)(除法分块 / 整除分块 / 找规律)

一、题目描述I was trying to solve problem ‘1234 - Harmonic Number’, I wrote the following codelong long H( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) res = res + n / i;...

2020-02-29 10:51:51 154

原创 【代码超详解】LightOJ 1259 Goldbach`s Conjecture(欧拉筛)

一、题目描述Goldbach’s conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the sum of two primes...

2020-02-28 21:38:35 257

原创 【代码超详解】洛谷 P3383 【模板】线性筛素数(题目已更新 · 数据已加强)(欧拉筛,总时间:4.42 s)

一、题目描述二、算法分析说明与代码编写指导事实上在此之前我一直使用自己写的埃氏筛法的模板来快速打出前若干个质数:unsigned prime[6542] = { 2,3 }, _PrimeTy, MaxPrime, * prime_end = prime + sizeof(prime) / sizeof(prime[0]);inline void gen_prime() { declt...

2020-02-28 20:04:56 335

原创 LightOJ 1282 Leading and Trailing(数学的简单变换,1 ms)

一、题目描述You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting th...

2020-02-28 15:00:42 155

原创 【代码超详解】LightOJ 1336 Sigma Function(约数和定理 +思维,0 ms)

一、题目描述Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = ...

2020-02-28 11:39:15 217

原创 【代码超详解】LightOJ 1370 Bi-shoe and Phi-shoe(线性时间内列举 1 ~ n 的欧拉函数值)

一、题目描述Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Sho...

2020-02-26 23:14:12 161

原创 【代码超详解】HDU 1495 非常可乐(BFS,15 ms)

一、题目描述非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 36045 Accepted Submission(s): 14027Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但...

2020-02-25 23:03:02 190

原创 【代码超详解】POJ 3414 Pots(BFS,0 ms)

一、题目描述PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29772 Accepted: 12428 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The ...

2020-02-24 11:32:35 206

原创 POJ 3087 Shuffle'm Up(模拟,0 ms)

一、题目描述Shuffle’m UpTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19873 Accepted: 8979DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shu...

2020-02-23 17:32:43 130

原创 【代码超详解】POJ 1426 Find The Multiple(找规律递推,32 ms)

一、题目描述Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 56395 Accepted: 23320 Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero...

2020-02-23 11:46:33 166

原创 【代码超详解】POJ 3279 Fliptile(开关问题,DFS)

一、题目描述FliptileTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25691 Accepted: 9099DescriptionFarmer John knows that an intellectually satisfied cow is a happy cow who will give more m...

2020-02-22 23:15:57 399

原创 【代码超详解】POJ 3278 Catch That Cow(BFS,16 ms)

一、题目描述Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 159339 Accepted: 48608DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch...

2020-02-22 18:17:06 203

原创 【代码超详解】POJ 2251 Dungeon Master(BFS 求最短路,0 ms)

传送门一、题目描述Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 68551 Accepted: 24795DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dung...

2020-02-22 15:18:37 171 1

原创 【代码超详解】POJ 1321 棋盘问题(DFS,282 ms)

一、题目描述棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 94188 Accepted: 43014Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行...

2020-02-22 11:36:08 242 1

原创 【代码超详解】洛谷 P2043 质因子分解(分解质因数)

一、题目描述题目描述对N!进行质因子分解。输入格式输入数据仅有一行包含一个正整数N,N<=10000。输出格式输出数据包含若干行,每行两个正整数p,a,中间用一个空格隔开。表示N!包含a个质因子p,要求按p的值从小到大输出。输入输出样例输入 #110输出 #12 83 45 27 1说明/提示10!=3628800=(28)*(34)*(5^2)*7二...

2020-02-21 20:34:16 1833 1

转载 【代码超详解】CometOJ C1403(洛谷 P2520) [HAOI2011]向量(贝祖定理)

一、题目描述题目描述给你一对数a,b,你可以任意使用(a,b), (a,-b), (-a,b), (-a,-b), (b,a), (b,-a), (-b,a), (-b,-a)这些向量,问你能不能拼出另一个向量(x,y)。说明:这里的拼就是使得你选出的向量之和为(x,y)输入格式第一行数组组数t,(t<=50000)接下来t行每行四个整数a,b,x,y (-2*109<=a...

2020-02-20 21:44:43 308

原创 【代码超详解】CometOJ C0896 [SDOI2008]仪仗队(欧拉函数 + 思维,4 ms)

一、题目描述1000 ms / 256 MB作为体育委员,C 君负责这次运动会仪仗队的训练。仪仗队是由学生组成的 N×N 的方阵,为了保证队伍在行进中整齐划一,C 君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图)。现在,C 君希望你告诉他队伍整齐时能看到的学生人数。二、算法分析说明与代码编写指导设C所在位置的坐标为(0,0)。如果(x,y)能够被(0,0)...

2020-02-20 17:49:29 486

原创 CometOJ C0219 [2014普及组-B]比例简化(暴力,1 ms)

一、题目描述二、算法分析说明要求输出A’和B’,且A’、B’ ≤ L,1 ≤ L ≤ 100,可见枚举次数不超过 10000,可以暴力枚举。三、AC 代码(1 ms)#include<cstdio>#pragma warning(disable:4996)unsigned a, b, c, d, l; double m, n, p = 1e+12; const doubl...

2020-02-20 14:05:18 300

原创 洛谷 P1002 过河卒(递推)

一、题目描述二、算法分析说明与代码编写指导设 f[m][n] 为卒从 (0,0)走到(m,n)的路径数。卒只能向右走或向下走,易得递推公式的第二种情形:当某位置的正左方和正上方都为马可以跳到的点或是马本身,那么这点不可能被被卒走到,路径数为 0。我们将马所在位置和马可以跳到的八个点都标记为 -1。这题有一个非常坑的地方:如果马可以跳至的点或者马本身在左边或上边,那么最上方一行的最右侧(...

2020-02-19 13:41:34 761

原创 POJ 1163 The Triangle(递推,0 ms)

一、题目描述The TriangleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 64432 Accepted: 38563Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number ...

2020-02-18 23:23:37 128

原创 【代码超详解】Codeforces 432D. Prefixes and Suffixes(KMP 的 next 数组的应用,46 ms)

传送门一、题目描述D. Prefixes and Suffixestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a string s = s1s2…s|s|, where |s| is the lengt...

2020-02-18 17:36:23 247

原创 【代码超详解】Codeforces 126B. Password(KMP 的 next 数组的应用,154 ms)

传送门一、题目描述B. Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAsterix, Obelix and their temporary buddies Suffix and Prefix has f...

2020-02-17 22:07:09 323

原创 【代码超详解】洛谷 P5410【模板】扩展 KMP(总时间:381 ms)

一、题目描述二、算法分析说明与代码编写指导三、AC 代码(总时间:381 ms)题目要求对 b 串构造 z 数组时记 z[0] = strlen(b)。#include<cstdio>#include<cstring>#pragma warning(disable:4996)template<class _Zty> inline void ex...

2020-02-16 22:05:11 233

原创 Codeforces 471D. MUH and Cube Walls(差分 + KMP,93 ms)

一、题目描述D. MUH and Cube Wallstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolar bears Menshykov and Uslada from the zoo of St. Petersbu...

2020-02-15 23:28:55 210

原创 【代码超详解】洛谷 P3375 【模板】KMP字符串匹配(总时间:229 ms)

一、题目描述提交 46.03k 通过 20.66k 时间限制 1.00s 内存限制 125.00MB二、算法分析说明与代码编写指导三、AC 代码总时间:229 ms(C++17 O2)#include<cstdio>#include<cstring>#pragma warning(disable:4996)template<class _NTy&g...

2020-02-15 18:25:27 355

原创 【代码超详解】洛谷 P2922 [USACO08DEC]秘密消息Secret Message

一、题目描述题目描述Bessie is leading the cows in an attempt to escape! To do this, the cows are sending secret binary messages to each other.Ever the clever counterspy, Farmer John has intercepted the first...

2020-02-14 20:26:34 383

原创 HDU 1251 统计难题(字典树)

一、题目描述统计难题Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 73692 Accepted Submission(s): 25355(2020/2/14 17:31)Problem DescriptionIgnati...

2020-02-14 17:46:39 131

原创 【代码超详解】HDU 1075 What Are You Talking About(字典树,452 ms)

传送门一、题目描述What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 33833 Accepted Submission(s): 11668(2020/2/13 20:2...

2020-02-13 20:49:16 555

原创 HDU 1247 Hat's Words(字典树 + 枚举,46 ms)

一、题目描述Hat’s WordsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21972 Accepted Submission(s): 7702(2020/2/13 19:59)Problem Description...

2020-02-13 20:02:57 146

原创 洛谷 P3879 [TJOI2010]阅读理解(字典树)

一、题目描述题目描述英语老师留了N篇阅读理解作业,但是每篇英文短文都有很多生词需要查字典,为了节约时间,现在要做个统计,算一算某些生词都在哪几篇短文中出现过。输入格式第一行为整数N,表示短文篇数,其中每篇短文只含空格和小写字母。按下来的N行,每行描述一篇短文。每行的开头是一个整数L,表示这篇短文由L个单词组成。接下来是L个单词,单词之间用一个空格分隔。然后为一个整数M,表示要做几次询问...

2020-02-13 11:31:39 455

原创 洛谷 P2580 于是他错误的点名开始了(Trie / 字典树)

一、题目描述题目背景XS中学(萧山中学?)化学竞赛组教练是一个酷爱炉石的人。他会一边搓炉石一边点名以至于有一天他连续点到了某个同学两次,然后正好被路过的校长发现了然后就是一顿欧拉欧拉欧拉(详情请见已结束比赛CON900)。题目描述这之后校长任命你为特派探员,每天记录他的点名。校长会提供化学竞赛学生的人数和名单,而你需要告诉校长他有没有点错名。(为什么不直接不让他玩炉石。)输入格式第一...

2020-02-12 21:04:36 225

原创 洛谷 P3370【模板】字符串哈希

一、题目描述题目提供者 HansBug难度 普及-标签高性能题目描述如题,给定N个字符串(第i个字符串长度为Mi,字符串内包含数字、大小写字母,大小写敏感),请求出N个字符串中共有多少个不同的字符串。#友情提醒:如果真的想好好练习哈希的话,请自觉,否则请右转PJ试炼场:)输入格式第一行包含一个整数N,为字符串的个数。接下来N行每行包含一个字符串,为所提供的字符串。输出...

2020-02-11 11:49:02 423

原创 【代码超详解】洛谷 P3372 【模板】线段树 1

一、题目描述如题,已知一个数列,你需要进行下面两种操作:1.将某区间每一个数加上x2.求出某区间每一个数的和输入格式第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含3或4个整数,表示一个操作,具体如下:操作1: 格式:1 x y k 含义:将区间[x,y]内每个数加上k操作2...

2020-02-09 11:10:19 261

原创 【代码超详解】LOJ #132. 树状数组 3 :区间修改,区间查询

一、题目描述样例样例输入5 102 6 6 1 12 1 41 2 5 102 1 32 2 31 2 2 81 2 3 71 4 4 102 1 21 4 5 62 3 4样例输出1534323350二、算法分析说明与代码编写指导如果不了解树状数组,建议先阅读之前的题解:https://blog.csdn.net/COFACTOR/arti...

2020-02-07 20:50:03 576

原创 【代码超详解】LOJ #131. 树状数组 2 :区间修改,单点查询

一、题目描述样例样例输入3 21 2 31 1 3 02 2样例输出2二、算法分析说明与代码编写指导如果你尚不了解树状数组,建议先阅读以下题解:(LOJ 130)https://blog.csdn.net/COFACTOR/article/details/104199313通过原数组构造差分数组,然后用这个差分数组建立树状数组,其前 i 项和即为原数组的第 i ...

2020-02-07 11:35:58 253

第十二章 三相电路.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第十二章 三相电路》(https://blog.csdn.net/COFACTOR/article/details/94636334)原文档

2019-07-04

第十一章 电路的频率响应.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第十一章 电路的频率响应》(https://blog.csdn.net/COFACTOR/article/details/94595582)原文档

2019-07-04

第十章 含有耦合电感的电路.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第十章 含有耦合电感的电路》(https://blog.csdn.net/COFACTOR/article/details/94590342)原文档

2019-07-03

第九章 正弦稳态电路的分析.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第九章 正弦稳态电路的分析》(https://blog.csdn.net/COFACTOR/article/details/94571818)原文档

2019-07-03

第八章 相量法.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第八章 相量法》(https://blog.csdn.net/COFACTOR/article/details/94565695)原文档

2019-07-03

第五章 含有运算放大器的电阻电路 (1).docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第五章 含有运算放大器的电阻电路》(https://blog.csdn.net/COFACTOR/article/details/93871666)原文

2019-06-28

第四章 电路定理 (1).docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第四章 电路定理》(https://blog.csdn.net/COFACTOR/article/details/93868351)原文

2019-06-28

第六章 储能元件.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第六章 储能元件》(https://blog.csdn.net/COFACTOR/article/details/93872298)原文

2019-06-27

第三章 电阻电路的一般分析.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第三章 电阻电路的一般分析》(https://blog.csdn.net/COFACTOR/article/details/93654945)原DOCX文档

2019-06-25

第二章 电阻电路的等效变换.docx

《电路分析 极简复习指导、公式推导、常用结论归纳 第二章 电阻电路的等效变换》(https://blog.csdn.net/COFACTOR/article/details/93624763)原文DOCX。

2019-06-25

空空如也

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

TA关注的人

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