
日常错题总结
在路上Ven
每天学习真逍遥
展开
-
ICPC第九届河南省赛 机器设备
样例分析:题解:#include<iostream>#include<stack>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int n,sx,sy;int start,endd,rr;int vis[10010];stack<int> st; //存从原点到所求圆的所有相切圆的数据...原创 2021-05-09 20:24:51 · 234 阅读 · 2 评论 -
Hdu3652 B-number详解
B-numberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10866Accepted Submission(s): 6455Problem DescriptionA wqb-number, or B-numb...原创 2019-08-19 17:36:37 · 254 阅读 · 1 评论 -
hihocoder1828 : Saving Tang Monk II (BFS 优先队列)
时间限制:1000ms单点时限:1000ms内存限制:256MB描述《Journey to the West》(also 《Monkey》) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng'en during the Ming Dynasty...原创 2019-10-24 19:42:11 · 245 阅读 · 0 评论 -
归并排序求逆序对
O( nlog(n) )/*归并排序: 1.[L,R] ——> [L,mid][mid+1,R] 2.递归排序 [L,mid][mid+1,R] 3.归并,讲左右两个有序序列合成一个有序序列 解题思路: 1.左半边内部的逆序对数量:merge_sort(L,mid) 2.右半边内部的逆序对数量:merge_sort(mid+1,R) 3.右边比左边大的 S...原创 2020-03-23 20:00:07 · 195 阅读 · 0 评论 -
航班时间
小 hh 前往美国参加了蓝桥杯国际赛。小 hh 的女朋友发现小 hh 上午十点出发,上午十二点到达美国,于是感叹到“现在飞机飞得真快,两小时就能到美国了”。小 hh 对超音速飞行感到十分恐惧。仔细观察后发现飞机的起降时间都是当地时间。由于北京和美国东部有 1212 小时时差,故飞机总共需要 1414 小时的飞行时间。不久后小 hh 的女朋友去中东交换。小 hh 并不知道中东...原创 2020-03-22 11:28:31 · 351 阅读 · 0 评论 -
飞行员兄弟
“飞行员兄弟”这个游戏,需要玩家顺利的打开一个拥有16个把手的冰箱。已知每个把手可以处于以下两种状态之一:打开或关闭。只有当所有把手都打开时,冰箱才会打开。把手可以表示为一个4х4的矩阵,您可以改变任何一个位置[i,j]上把手的状态。但是,这也会使得第i行和第j列上的所有把手的状态也随着改变。请你求出打开冰箱所需的切换把手的次数最小值是多少。输入格式输入一共包含四行,每...原创 2020-03-11 20:39:33 · 205 阅读 · 0 评论 -
PTA L2链表去重 (25分)
L2-002 链表去重 (25分)给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K 的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表 21→-15→-7,还有被删...原创 2020-01-18 10:52:17 · 1349 阅读 · 0 评论 -
NCPC-2017 D-Distinctive Character
题意:给定多个串,求一个串与其他串相似性最小,即每一位相同的字符数最少。思路:bfs搜,类似于数据结构学的访问树的层数#include<stdio.h>#include<iostream>#include<queue>#include<string.h>using namespace std;char a[25];int d...原创 2020-01-12 11:28:13 · 410 阅读 · 0 评论 -
Educational Codeforces Round 76 (Rated for Div. 2) C. Dominated Subarray
Dominated Subarray题意:给n个数,找出这个数组中出现数字最多且仅出现一次的子区间,简单来想即首尾数字相同区间内各个字符不同。自我反思:一道简单的思维题,就是理解题意挺费劲的。#include<iostream>#include<algorithm>#define maxn 200010using namespace std;int a...原创 2019-11-15 09:23:15 · 234 阅读 · 0 评论 -
National Contest for Private Universities (NCPU), 2019 C题 Boxes
这道题数组模拟双向链表,其实就是将单向链表改成双向的,左右两个数组标记一下即可,循环链表将头尾连接即可。题意:给出一个数n,表示存在一个整数序列1……n,然后进行四种操作: 操作一:输入x,y,表示将x移到y的左边(若x本来就在y的左边则忽略); 操作二:输入x,y,表示将x移到y的右边(若x本来就在y的右边则忽略);...原创 2019-09-22 14:01:31 · 338 阅读 · 0 评论 -
L Digit sum
A digit sum Sb(n) is a sum of the base-bbb digits of nnn. Such as S10(233)=2+3+3=8 , S2(8)=1+0+0=1 S2(7)=1+1+1=3Given N and b, you need to calculate ∑n=1NSb(n)InputFileThe first line of the in...原创 2019-09-17 09:50:15 · 305 阅读 · 0 评论 -
B Light bulbs (2019icpc上海网络赛 )
There are N light bulbs indexed from 0 to N−1. Initially, all of them are off.A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L,R)means to flip all bulbs xsuch that L≤x≤R. ...原创 2019-09-17 09:39:47 · 328 阅读 · 1 评论 -
hdu 5938 Four Operations
Four OperationsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4690Accepted Submission(s): 1349Problem DescriptionLittle Ruins is a...原创 2019-08-21 11:09:18 · 229 阅读 · 0 评论 -
F题 Sequence Decoding
National Contest for Private Universities (NCPU), 2019题意:[ ]内的字符,重复前面的数字次,输出最终结果方法一:dfs循环#include<bits/stdc++.h>using namespace std;char *dfs(char s[]) { char *p; while(1) {...原创 2019-10-08 23:23:53 · 265 阅读 · 0 评论 -
POJ 1068 括号匹配问题
DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses befo...原创 2019-06-03 23:05:37 · 431 阅读 · 0 评论 -
2019/6/15 错题总结
刚写好的一篇忘记保存刷新了一下全都没了原创 2019-06-15 16:25:52 · 199 阅读 · 0 评论 -
2019/06/11 题目总结
救救原创 2019-06-11 22:56:57 · 152 阅读 · 0 评论 -
各种错误状态总结
因为各种原因没有AC的次数太多了,事后也没有及时总结,所以导致某些同类型错误再而三的出现。所以打算写此篇博客用来记录我一路走下来的所有出现的错误。 容器不能分配内存的错误 出现的原因:一个string类型的字符串s,s[i]并不存在,但是被访问...原创 2019-08-10 16:02:39 · 281 阅读 · 0 评论 -
HDU6666 Quailty and CCPC
Problem DescriptionConsidering the overall difficulty of other problems, we invite Quailty to propose an easy problem for this contest.Quailty accidentally won both gold medal and silver medal in 20...原创 2019-10-08 17:02:07 · 225 阅读 · 0 评论 -
2019/05/26 总结
题目描述2018年,icebound打开了神殿。而在2019年,icebound正在试图破解天神的密码,以期获得天神的力量。icebound发现,想要得到神的密码,必须先要完成一个祭祀仪式。在这个祭祀仪式上,我们首先会追随神的指引,得到两个正整数 N和 K。随后,我们令 X=N^K ,得到天神喜欢的数字X。利用 X,我们进行以下方式得到天神最后的密码:步骤 1 将 X每个数位上的数字相加...原创 2019-05-26 15:52:18 · 192 阅读 · 0 评论