自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 QJson详细介绍

JSON(JavaScript Object Notation, JS对象简谱)是一种轻量级的数据交换格式。它基于 ECMAScript(European Computer Manufacturers Association, 欧洲计算机协会制定的js规范)的一个子集,采用完全独立于编程语言的文本格式来存储和表示数据。简洁和清晰的层次结构使得 JSON 成为理想的数据交换语言。易于人阅读和编写,同时也易于机器解析和生成,并有效地提升网络传输效率。QJson相关类主要包括以下5种。

2023-03-30 00:29:23 796

原创 Qt Creator使用CMake配置第三方库

这里的 include_directories 直接向括号里加入第三方库的头文件路径即可。

2023-03-23 16:00:34 1937

原创 使用QLable显示图片

QLabel主要用来显示文本的组件,但是也有显示图片的方法,下面介绍一下如何用QL abel显示图片。

2023-03-19 14:02:44 5044

原创 【QImage类常用函数】

QImage常用函数

2023-03-17 23:30:34 1441

原创 【leetcode31. 下一个排列】

题意:找到下一个比当前序列字典序大且最小的排序。

2023-01-30 15:44:00 101 1

原创 E. Middle-Out(思维)

The problem was inspired by Pied Piper story. After a challenge from Hooli’s compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.You are ...

2019-10-01 15:59:58 283

原创 Codeforces Round #518 (Div. 1) [Thanks, Mail.Ru!] B. Multihedgehog (多叉树)

Someone give a strange birthday present to Ivan. It is hedgehog — connected undirected graph in which one vertex has degree at least 3 (we will call it center) and all other vertices has degree 1. Iva...

2019-09-16 23:42:19 339

原创 Codeforces Round #303 (Div. 2) E. Paths and Trees(最短路)

Little girl Susie accidentally found her elder brother’s notebook. She has many things to do, more important than solving problems, but she found this problem too interesting, so she wanted to know it...

2019-09-15 23:33:26 167

原创 Codeforces Round #582 (Div. 3) E. Two Small Strings (构造)

You are given two strings s and t both of length 2 and both consisting only of characters ‘a’, ‘b’ and ‘c’.Possible examples of strings s and t: “ab”, “ca”, “bb”.You have to find a string res consis...

2019-09-13 21:14:56 323 1

原创 Educational Codeforces Round 72 (Rated for Div. 2) C. The Number Of Good Substrings(思维)

You are given a binary string s (recall that a string is binary if each character is either 0 or 1).Let f(t) be the decimal representation of integer t written in binary form (possibly with leading z...

2019-09-10 09:17:15 172

原创 Educational Codeforces Round 72 (Rated for Div. 2) D. Coloring Edges (拓扑排序)

D. Coloring Edgestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a directed graph with n vertices and m directed edges without s...

2019-09-09 20:12:49 162

原创 Codeforces Round #583 E Petya and Construction (构造)

It’s Petya’s birthday party and his friends have presented him a brand new “Electrician-n” construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.Const...

2019-09-06 18:58:14 294

原创 Codeforces Round #583 (Div. 1 + Div. 2, based on Olympiad of Metropolises)(D. Treasure Island DFS)

All of us love treasures, right? That’s why young Vasya is heading for a Treasure Island.Treasure Island may be represented as a rectangular table n×m which is surrounded by the ocean. Let us number ...

2019-09-06 09:01:50 193

原创 HDU 5573 Binary Tree (思维+构造)

Problem DescriptionThe Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary tree.Since th...

2019-09-04 13:06:03 165

原创 Codeforces Round #579 (Div. 3) D Remove the Substring(思维)

You are given a string s and a string t, both consisting only of lowercase Latin letters. It is guaranteed that t can be obtained from s by removing some (possibly, zero) number of characters (not nec...

2019-08-27 10:31:54 151

原创 HDU - 2819 Swap(最大匹配+输出路径)

Given an NN matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1?InputThere are several test cases in ...

2019-08-26 19:08:13 186

原创 HDU - 1281 棋盘游戏(最大匹配)

小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也...

2019-08-26 18:53:54 182

原创 B. Shortest Cycle(最小环)

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n integer numbers a1,a2,…,an. Consider graph on n nodes, in which nodes i, j (i≠j...

2019-08-26 12:51:18 294

原创 2019 CCPC 网络赛 HDU - 6703 array(线段树)

Problem DescriptionYou are given an array a1,a2,…,an(∀i∈[1,n],1≤ai≤n). Initially, each element of the array is unique.Moreover, there are m instructions.Each instruction is in one of the following ...

2019-08-24 11:00:04 490 3

原创 洛谷 P2762 太空飞行计划问题(自己理解的口胡版)

题目描述W 教授正在为国家航天中心计划一系列的太空飞行。每次太空飞行可进行一系列商业性实验而获取利润。现已确定了一个可供选择的实验集合E={E1,E2,…,Em},和进行这些实验需要使用的全部仪器的集合I={I1,I2,…In}。实验Ej需要用到的仪器是I的子集RjÍI。配置仪器Ik的费用为ck美元。实验Ej的赞助商已同意为该实验结果支付pj美元。W教授的任务是找出一个有效算法,确定在一次太空飞...

2019-08-13 19:03:54 168

原创 HDU 6638 Snowy Smile (2019杭电多校第六场)(最大连续区间和)

题目链接Snowy SmileTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1644 Accepted Submission(s): 501Problem DescriptionThere are n pirate c...

2019-08-08 20:02:51 310

原创 HDU-4738 Caocao's Bridges(边强连通分量)

题目链接Caocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn’t give up. Caocao’s army still was not good at water battles, so he came up with another idea. He built many i...

2019-08-05 09:41:52 224

原创 HDU- 4612 Warm up(边强连通分量+缩点+树的直径)

题目链接N planets are connected by M bidirectional channels that allow instant transportation. It’s always possible to travel between any two planets through these channels.  If we can isolate some plan...

2019-08-05 09:34:05 279

原创 Poj - 3694 Network(桥+LCA)

题目连接A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successi...

2019-08-05 09:13:17 138

原创 UVA-796 Critical Links(割边)

In a computer network a link L, which interconnects two servers, is considered critical if there are atleast two servers A and B such that all network interconnection paths between A and B pass throu...

2019-08-05 00:15:51 154

原创 UVA-315 Network(割点)

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connectingseveral places numbered by integers from 1 to N. No two places have the same number. The linesare bid...

2019-08-05 00:09:26 97

原创 Poj - 1236 Network of Schools(缩点)(有向图加边变成强连通图)

题目链接A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receivi...

2019-08-05 00:01:19 129

原创 洛谷P1892 [BOI2003]团伙(并查集+反集思想)

题目链接题目描述1920年的芝加哥,出现了一群强盗。如果两个强盗遇上了,那么他们要么是朋友,要么是敌人。而且有一点是肯定的,就是:我朋友的朋友是我的朋友;我敌人的敌人也是我的朋友。两个强盗是同一团伙的条件是当且仅当他们是朋友。现在给你一些关于强盗们的信息,问你最多有多少个强盗团伙。输入格式输入文件gangs.in的第一行是一个整数N(2<=N<=1000),表示强盗的个数...

2019-07-31 23:12:30 343

原创 Codeforces Round #576 (Div. 2) D. Welfare State

题目链接There is a country with n citizens. The i-th of them initially has ai money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, ...

2019-07-31 10:33:48 148

原创 HDU-6609 Find the answer (2019杭电多校第三场1007)

题目链接Find the answerTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 470 Accepted Submission(s): 149Problem DescriptionGiven a sequence of...

2019-07-29 21:13:07 209

原创 HDU-6602 Longest Subarray(2019杭电多校第二场1012)

题目链接Problem DescriptionYou are given two integers C,K and an array of N integers a1,a2,…,aN. It is guaranteed that the value of ai is between 1 to C.We define that a continuous subsequence al,al+1,...

2019-07-26 19:47:36 147

原创 牛客小白月赛16 D小阳买水果(思维+二分)

题目链接题意: 有n个水果,每个水果有相应的满意度,需要买连续的水果,并且买到的水果满意度要大于零。思路: 是一个比较有趣的二分,刚开始想到的二分是先求他前缀和,然后再二分。但是后来想了一下,这样的前缀和不是一个单调的序列,没法二分。比赛结束后才明白,原来是这样子二分的,涨知识了。对于当前水果的满意度ai,如果说0~i的前缀和为si,那么我只需要找到0 ~ i中,前缀和小于si的即可。所以...

2019-07-13 14:07:39 248

原创 nbuoj 1587 最大乘积

Description一个正整数一般可以分为几个互不相同的自然数的和,如3=1+2,4=1+3,5=1+4=2+3,6=1+5=2+4,。。。。现在你的任务是将指定的正整数n分解成互不相同的自然数和,且使这些自然数的乘积最大。Input只一个正整数n,(3<=n<=10 000)。Output第一行是分解的方案,相邻两数用一个空格分开,并且按从小到大的顺序。第二行是最大的...

2019-07-04 19:24:45 440

原创 牛客练习赛48 B 小w的a=b问题

题意: 跟你两个序列,长度分别是n,m,问这两个序列中的每个数阶乘的累积是否相等。思路: 典型的质因子分解,在一个序列中,对每个数求阶乘的连乘积,可以统计从2开始每个数的乘积次数,然后把每个数质因子分解,转化成求这个质数乘积的次数即可。最后判两个序列中质数乘积次数是否相等。#include<bits/stdc++.h>using namespace std;#define ll...

2019-06-22 13:44:30 773

原创 2617 小O与小X的比赛(二)

Description在又一次失败后,小O深刻反省了自己本身,他感到自己是十分的菜,他想要自己的水平能够迅速提高起来,于是他向小X求助,小X在听了他的诉说后,决定先考考小O的水平如何,于是说道: “我有n个数字,我可以知道任意区间内任意两个数字异或和的和,你可以吗?”小O苦思冥想之后给出了答案。你能知道他是怎样解答的吗?Input先输入一个整数组数T,表示数据的组数,每组数据输入一个n,m表...

2019-06-13 19:59:15 360

原创 Codeforces Round #565 (Div. 3) E Cover it!

题目链接题意: 有n个顶点,m条边,选择最多n/2个顶点,在这个图每个顶尖顶点相邻(换句话说,一条边上的两个顶点)的至少选择一个的顶点。思路: 奇偶染色法,对于相邻的两个顶点标记为不同的颜色,dfs遍历一遍即可。#include<bits/stdc++.h>using namespace std;const int maxn=6e5+7;struct EDGE{ ...

2019-06-11 14:03:18 327

原创 AtCoder Beginner Contest 128 C - Switches

题目链接题意:有n个开关和m盏灯m行:对于第i盏灯,有x个开关控制这盏等,x1,x2,x3…第m+2行有m个数,由0 1构成,若控制(第i盏灯开关打开数量)%2与其一致时,则该灯可以亮,反之则不能。问:当所有灯打开时,开关打开的方案数。思路: 裸裸的状压dp#include<bits/stdc++.h>using namespace std;const int...

2019-06-09 00:21:25 397

原创 Comet OJ - Contest #1 B +1 复读(暴力)

题目描述在许多讨论算法的 qq 群里面,很多人都喜欢复读。在这里复读是重复上一个人所说的一模一样的话的意思。但也有很多人讨厌看到其他人一直在复读,觉得这会给其他人带来困扰,所以有些 qq 群会禁止大家复读。于是这些喜欢复读的人又发明了各种复读的变形方式,+1 复读就是其中一个例子。这里举个 +1 复读的例子,当有个人说:“羡慕+1”,则接下来喜欢复读的人会接着说:“羡慕+2”, “羡慕+3...

2019-05-31 01:02:09 188

原创 Codeforces Round #562 (Div. 2) C. Increasing by Modulo(二分)

题目链接Toad Zitz has an array of integers, each integer is between 0 and m−1 inclusive. The integers are a1,a2,…,an.In one operation Zitz can choose an integer k and k indices i1,i2,…,ik such that 1≤i1...

2019-05-28 19:13:30 200

原创 2018-2019 Pacific Northwest Regional (Div. 1) F Rectangles(线段树扫描线)

题目链接题意: 矩形覆盖面积奇数次的面积和思路: 线段树节点每次更新只用看其覆盖奇数次还是偶数次,反转一下即可!!节点的权值也要反转,当前区间长度-上次区间权值 即为节点反转后的权值。仔细想一下即可。#include<bits/stdc++.h>using namespace std;#define ll long long#define lson (rt<&lt...

2019-05-11 11:48:39 169

空空如也

空空如也

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

TA关注的人

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