题解sorting binary string

P2480 古代猪文 题解

题意:求 $$ g^{\sum_{k\mid n}{n\choose k}} $$ 对 $999911659$ 取模。 $1\le n,g\le 10^9$。 思路: 首先根据欧拉定理,题目转化为求 $\displaystyle\sum_{k\mid n}{n\choose k}$ 对 $99991 ......
题解 P2480 2480

JOISC 2021 题解

#### JOISC21 フードコート (Food Court) 首先我们发现我们这个删除实际上可以假删除,我们每次问询时求出这个队列目前被删了几个(维护区间加,区间 $\max(0,A-x)$)就可以把删除操作给弄掉了。 然后我们考虑对商店做扫描线!因为我们现在其实就是对商店的单点问询,我们这个加 ......
题解 JOISC 2021

【题解】Codeforces Round 737 (CF1557)

VP 情况: solve:4/5 rank:431st 评价: VP 了一下,我这个 shaber B 直接 5 发罚时,耽误了二十多分钟,以及被 D 各种细节差点搞死。 ## A.Ezzat and Two Subsequences(*800) ### 题目描述: 给定一个序列,将其分为 $2$ ......
题解 Codeforces Round 1557 737

Swift中常见的String用法,Array高阶使用,Set集合操作

String字符串常见用法 生成字符串 创建字符串 let greeting = "Hello, world!" let name = String("John") 连接字符串:使用加号(+)或者字符串插值(使用())来将多个字符串连接起来。 var firstName = "John" let l ......
高阶 常见 String Swift Array

【题解】CF1062E Company

[传送门](https://www.luogu.com.cn/problem/CF1062E) 先考虑如何求解区间 LCA ![](https://img2023.cnblogs.com/blog/2751294/202305/2751294-20230525152449076-352315544. ......
题解 Company 1062E 1062 CF

题解(教主的魔法)P2801

## [题目](https://www.luogu.com.cn/problem/P2801) # 教主的魔法 ## 题目描述 教主最近学会了一种神奇的魔法,能够使人长高。于是他准备演示给 XMYZ 信息组每个英雄看。于是 $N$ 个英雄们又一次聚集在了一起,这次他们排成了一列,被编号为 $1, 2 ......
题解 教主 魔法 P2801 2801

String 和 StringBuilder的区别与性能

`string` 和 `StringBuilder` 都可以用在串联字符串上,但是其性能在不同的场景下会有很大的差别。 1、 使用==string +==场景: 多个字串通过 `+`来进行连接,如下所示,此时都在一条语句里面,因此内部会通过 `StringBuilder`对象来完成对应的连接,此时推 ......
StringBuilder 性能 String

java 通过String关键词 和 String对象创建字符串 耗时对比

``` import java.util.ArrayList; import java.util.Vector; public class ImoocStudent { public static void main(String args[]){ long startTime = System.c ......
String 字符串 字符 关键词 对象

[LeetCode] 2451. Odd String Difference

You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a differe ......
Difference LeetCode String 2451 Odd

AtCoder Beginner Contest 302 H. Ball Collector 题解

[AtCoder Beginner Contest 302 H. Ball Collector](https://atcoder.jp/contests/abc302/tasks/abc302_h) 题意跳过。 可以视作将 $a_i, b_i$ 之间连了一条边,然后 $a_i, b_i$ 之间只能选 ......
题解 Collector Beginner AtCoder Contest

NOIP2014普及组试题题解

1.珠心算测验 代码: #include<bits/stdc++.h> #define ll long long using namespace std; const int N = 2e4+39+7; int mp[N],n,a[N],ans=0; int main(){ cin>>n; for( ......
题解 试题 NOIP 2014

题解:Code Feat

[题目链接](https://www.luogu.com.cn/problem/UVA11754) 数据范围分治。沿用题目中的变量意义。设 $K = \Pi k_i$,即我们总共有 $K$ 种组合情况,当 $K$ 比较小的时候,直接枚举每个集合得到的余数是哪个,然后做 CRT 记录后排序答案即可。当 ......
题解 Code Feat

Linux shell command strings All In One

Linux shell command strings All In One 打印文件(默认为标准输入) 中可打印的字符串 ......
command strings Linux shell All

abc260_f Find 4-cycle 题解

# [Find 4-cycle](https://vjudge.csgrandeur.cn/problem/AtCoder-abc260_f) ## 题意 有一个 $s + t$ 个点 $m$ 条边的简单无向图 $G$。点标号为 $1 \cdots s + t$,边标号为 $1 \cdots m$。 ......
题解 cycle Find abc 260

abc260_e At Least One 题解

# [At Least One](https://vjudge.csgrandeur.cn/problem/AtCoder-abc260_e) ## 题意 给定一个整数 $m$ 和 $n$ 对数 $(a_i, b_i)$,我们定义一个 $f(x)$ 函数表示满足以下要求的整数序列数量: - 整数序列 ......
题解 Least abc 260 One

C#-字符串String的各种常用操作

记录下日常用到的字符串的一些操作: //整数与16进制字符串的互相转换string str = (2748).ToString("X"); int iData = Convert.ToInt32(str, 16); 整数与字符串的互相转换 str = (123).ToString(); iData ......
字符串 字符 常用 String

abc273_e Notebook 题解

# [Notebook](https://vjudge.csgrandeur.cn/problem/AtCoder-abc273_e) ## 题意 有 $q$ 次操作。 现在你有一个空序列 $a$ 和一本 $10^9$ 页的笔记本,每页纸上都有一个空序列。 每次操作是以下四种中的一种: - `ADD ......
题解 Notebook abc 273

Game on Paper 题解

[题目传送门](https://www.luogu.com.cn/problem/CF203B) 一道模拟题。 如果每涂一个格子就判断整个矩阵,那时间复杂度显然会炸。 我们每涂一个格子,影响的应该只是以这个格子为中心的 $3 \times 3$ 矩阵,判断以这些点为中心的话会不会涂出 $3 \tim ......
题解 Paper Game on

修改arm板开机logo,ppm转换需要用ascii而不是rawbits binary

网上在线转ppm格式不好用,转出来的是rawbits的二进制格式,PPM编码(ASCII或binary),关于图片格式编码参见 此处我需要ascii编码 sudo apt-get install netpbm $bmptoppm pic.bmp > temp1.ppm //生成ppm $ppmqua ......
rawbits binary ascii logo arm

1110 Complete Binary Tree(附测试点2,3,4,6分析)

题目: Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case ......
Complete Binary 1110 Tree

2023(ICPC)江西省赛I题题解

I. Tree 题意: 两种操作,操作1:将一棵树一条路径上的边权异或上一个数,操作2:或者询问一个点周 围所有边权的异或和。 题解: 首先,异或有一个性质 A ⨁ A = 0 ⇒ A ⨁ B ⨁ A = B 在进行操作一时,对X到Y的简单路径上的每一条边权异或,会是这样的情况 X _ w1_ Z ......
题解 2023 ICPC

abc271_f XOR on Grid Path 题解

# [XOR on Grid Path](https://vjudge.csgrandeur.cn/problem/AtCoder-abc271_f) ## 题意 有一个 $n \times n$ 的整数矩阵,第 $i$ 行 $j$ 列的数字为 $a_{i,j}$。 你站在 $(1,1)$,每次你可 ......
题解 Grid Path abc 271

ABC134F 题解

[$\text{link}$](https://www.luogu.com.cn/problem/AT_abc134_f) 。难想的 $\texttt{dp}$ 。 ![](https://img2023.cnblogs.com/blog/2803184/202305/2803184-2023052 ......
题解 134F ABC 134

2023江西省省赛H、J题题解

##**[原题链接](https://codeforces.com/gym/104385)** #1. H题 ![](https://img2023.cnblogs.com/blog/2725144/202305/2725144-20230523161540199-1097838755.png) # ......
题解 2023

CF1765C 题解

## 题意 [传送门](https://www.luogu.com.cn/problem/CF1765C) 有 $4$ 种花色的牌,每种牌均为 $n$ 张,则牌的排列一共有 $(4n)!$ 种。 现在你从牌堆种逐张地取出牌,取牌之前你会猜一下这张牌是什么花色。你会根据之前的 $k$ 张牌中出现最少的 ......
题解 1765C 1765 CF

CF1196F K-th Path 题解 floyd

题目链接:[https://codeforces.com/problemset/problem/1196/F](https://codeforces.com/problemset/problem/1196/F) 题目大意: 给定一个包含 $n$ 个节点 $m$ 条边的无向图($n,m \le 2 \ ......
题解 1196F floyd 1196 K-th

NOIP2015普及组试题题解

1.金币 代码: #include<bits/stdc++.h> #define ll long long using namespace std; int ans=0,t=1,n; int main(){ cin>>n; while(n){ for(int i=1;i<=t;i++){ ans+= ......
题解 试题 NOIP 2015

1099 Build A Binary Search Tree

题目: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only no ......
Binary Search Build 1099 Tree

JOISC 2022 题解

##### JOISC2022 Day1 监狱 Jail 首先我们发现操作一定是给所有人排序,然后按照顺序直接从 $s_i$ 挪到 $t_i$,要求是对于 $i$,所有在它之前挪的 $t$ 不能在 $s_i\to t_i$ 上,所有在它之后挪的 $s$ 不能在 $s_i\to t_i$ 上。有了这个 ......
题解 JOISC 2022

「题解」P7275 计树

快进完生成函数,现在我们知道如果令一个长度为 $i$ 的连续段权值为 $in[z^i]\frac{z^2}{1-z+z^2}$,一个连续段权值的 ogf 是 $F$,那么答案的 ogf 就是 $\frac{1}{1-F}$. 先看看 $\frac{z^2}{1-z+z^2}$ 展开,发现形式很好看, ......
题解 P7275 7275