- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 2020-10-13
莫队简单入门题(二)https://vjudge.net/problem/CodeForces-86DAn array of positive integers a1, a2, …, an is given. Let us consider its arbitrary subarray al, al + 1…, ar, where 1 ≤ l ≤ r ≤ n. For every positive integer s denote by Ks the number of occurrences of s
2020-10-13 16:49:49 108 1
原创 莫队最简单入门题
莫队–最简单入门题链接: https://www.spoj.com/problems/DQUERY/en/.Given a sequence of n numbers a1, a2, …, an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the su
2020-10-13 10:29:16 101
原创 dfs水题
复习完一门,顺便写写水题。。。。。。题目链接: https://www.luogu.org/problemnew/show/P2670很水,但是我想把自己写过的搜索都整理起来。水不水都记录一下不知道这道题算不算dfs,连回溯递归都没有用上呢?管他呢,先记录一下。//#include<iostream>using namespace std;int o[8][2]={{0...
2019-06-21 15:11:12 123 1
原创 dfs,超简单入门题
写递推也写了有一些题了,这次用dfs写一遍,居然和我推的样例对上了!!!之前交了三次用递推写出的规律都WA,这次试了一下dfs,居然是TLE!!!果断打表,居然过了!!!开心O(∩_∩)O需要注意的是,刚写完这个dfs时我样例都过不了,出错的原因也是让我感到无语的:a[3][2]={(9,-1),(-1,0),(0,1)}这样写是错的!!!还是基础有问题!!里面要写花括号,记住了!!! ,a[...
2019-06-17 10:10:54 1692
原创 stl初涉map,启蒙题
初涉map,启蒙题1505: 酷酷的单词Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 1900 Solved: 888Description输入一些仅由小写字母组成的单词。你的任务是统计有多少个单词是“酷”的,即每种字母出现的次数都不同。比如ada是酷的,因为a出现2次,d出现1次,而1和2不同。再比如,ban...
2019-03-28 17:53:14 100
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人