codeforces library 1776c game

Codeforces Round 909 (Div. 3)

Codeforces Round 909 (Div. 3) A. Game with Integers 题意: 给定一个数\(x\),\(A,B\)两人轮流进行操作,\(A\)先操作。每次给\(x\)加一或者减一,操作完后\(x \% 3 == 0\)者获胜。判断获胜者。 解题思路: 判断\(A\) ......
Codeforces Round 909 Div

codeforces 50题精选训练

本章节参考:2020,2021 年 CF 简单题精选 - 题单 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 首先,很容易观察到点的一些特征: - 都在第一象限;- 点的分布越来越稀疏。 以样例为例: 还有无限个点没有画出来。 根据点的分布越来越稀疏的特性,能不能发现收集点的规律 ......
codeforces

Codeforces Round 905 (Div. 3) ABCDEG1

Codeforces Round 905 (Div. 3)ABCDEG1 A. Morning 思路:签到,直接模拟。 // AC one more times // nndbk #include <bits/stdc++.h> using namespace std; typedef long l ......
Codeforces ABCDEG1 ABCDEG Round 905

Educational Codeforces Round 99 (Rated for Div. 2)

https://codeforces.com/contest/1455 很久没有vp了,感觉思维又僵化了 A题直接看样例,直接猜是长度。 B题首先如果是 \(x=\frac{n(n+1)}{2}\),那么就是n 否则如果\(x=\frac{n(n+1)}{2}+y\),分成两类 y=n,ans=n+ ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 156 (Rated for Div. 2) ABCD

Educational Codeforces Round 156 (Rated for Div. 2) ABCD A. Sum of Three 题意:给定正整数 \(n\),判断是否存在正整数 \(a\),\(b\),\(c\) 满足: \(a+b+c=n\)。 \(a\),\(b\),\(c\) ......
Educational Codeforces Round Rated ABCD

Codeforces Round 904 (Div. 2)

\(A. Simple Design\) https://codeforces.com/contest/1884/submission/233628914 \(B. Haunted House\) https://codeforces.com/contest/1884/submission/2336 ......
Codeforces Round 904 Div

Codeforces Round 910 (Div. 2) - D

目录D. Absolute Beauty Codeforces Round 910 (Div. 2) D. Absolute Beauty 观察可知,只要当交换的 \(i\) 和 \(j\) 满足 $ max(a_i, b_i) < min(a_j, b_j)$ 或者 $ min(a_i, b_i) ......
Codeforces Round 910 Div

CodeForces 合集第三弹

这个合集主要是近期的 CodeForces 比赛题。 1898. Codeforces Round 910 (Div. 2) https://codeforces.com/contest/1898 A. Milica and String 很容易发现答案不超过 \(1\),然后分类讨论当前 B 的个 ......
CodeForces

Codeforces Round 785 (Div. 2)

A - Subtle Substring Subtraction /* * __ ~~~~~~~~~~~ ___ * . . ~~// ...... __--~ ~~ * -. \_|// |||\\ ~~~~~~::::... /~ * ___ _ _-~o~ \/ ||| \\ _/~~- * ......
Codeforces Round 785 Div

Codeforces Round 908 (Div. 2)

Preface 补一下之前期中考落下的CF yysy因为这学期又开始断电了,所以除了周五周六晚上的CF可能都不一定会去打,都会以后面补题为主 A. Secret Sport 由于题目保证给出的状态合法,因此直接输出最后一个字符即可 #include<cstdio> #include<iostream ......
Codeforces Round 908 Div

Codeforces Round 910 (Div. 2)

Codeforces Round 910 (Div. 2) 基本情况 做A题的速度比之前快多了,大概20分钟搞定。 B题想了一个贪心错解,想用链表实现,但是不熟练,实现太慢,而且还被hack了。 但是自己hack掉了,造数据上进步。 B. Milena and Admirer 贪心思路 发现一个大于 ......
Codeforces Round 910 Div

Codeforces Round 910 (Div. 2)

\(A. Milica and String\) https://codeforces.com/contest/1898/submission/233431132 \(B. Milena and Admirer\) https://codeforces.com/contest/1898/submis ......
Codeforces Round 910 Div

Codeforces Round 909 (Div. 3)

Codeforces Round 909 (Div. 3) 基本情况 第一次在 CF 上 AC 了超过一道题。(毕竟是Div3) B 题卡住了很久。 D 没有深入思考。 [B. 250 Thousand Tons of TNT](Problem - B - Codeforces) 一开始死活过不了的 ......
Codeforces Round 909 Div

Mysql报:error while loading shared libraries libtinfo.so.5的解决办法

版权声明:原创作品,谢绝转载!否则将追究法律责任。 ————— 作者:kirin #、今天闲来无事,想在Anolis8的系统上装一个MySQL8.0玩。前期在安装和配置的过程中没有什么问题,但是在我想查看一下数据库版本的时候报了一个错。具体报错信息如下: mysql: error while loa ......
libraries libtinfo loading 办法 shared

Educational Codeforces Round 13 E

tilian 最开始看错了以为是 可以任意选择两人or选择一人胜出 但题意是 可以选择下一个擂主是谁 考虑dp的话 我们显然需要记录一个state以及当前擂主是谁 转移就是 dp[state][i]=max(dp[state][i],dp[state(1<<j)][j]*a[i][j]+dp[sta ......
Educational Codeforces Round 13

No libraries found for 'tk.mybatis.mapper.common.Mapper'

1,无法导入tk.mybatis.mapper.common.Mapper 2.Mapper报错No libraries found for 'tk.mybatis.mapper.common.Mapper' 解决方法如下(添加通用mybatis这个依赖) 1.在pom.xml中添加tk.mybat ......
libraries mybatis Mapper common mapper

Codeforces Round 909 (Div. 3) A-E

Codeforces Round 909 (Div. 3) A. Game with Integers 题意: 两人轮流操作,可以加一或减一,若结果能被3整除则输出First,否则输出Second 思路: 若n不能被3整除,则第一个人可以直接通过加一或减一使结果被3整除,反之则一定不能 代码: #i ......
Codeforces Round 909 A-E Div

练习记录-cf-Codeforces Round 909 (Div. 3)(A-G)

好久没打div了 然后思维太差 现在被抓回来继续打了QWQ 终于被我逮到一场G数据结构的 ak了 既然ak了就开心地写下题解 别被hack别被hack别被hack 这场挺简单的 之前打的div3都好难qaq A. Game with Integers 题意:给一个数字,两人轮流操作,可以+1或者-1 ......
cf-Codeforces Codeforces Round 909 A-G

No libraries found for 'javax.persistence.GeneratedValue'

maven添加 <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0.2</version> </dependency> ......

Solution - Partition Game

Link. 做 vjudge 的题有一种美丽的窒息的感觉。 设 \(f_{i, j}\) 表示前 \(i\) 个选 \(j\) 段出来的最小代价,转移 \(f_{i, j} = \min_{0 \leq k < i} \{f_{k, j - 1} + w_{k + 1, i} \}\),\(w_{k ......
Partition Solution Game

【题解 CF1628D2】 Game on Sum

Game on Sum (Hard Version) 题面翻译 Alice 和 Bob 正在玩一个游戏,游戏分为 \(n\) 个回合,Alice 和 Bob 要轮流对一个数 \(x\) 进行操作,已知这个数初始值是 \(0\)。 具体每个回合的行动规则如下: Alice 选择一个在区间 \([0,k ......
题解 1628D 1628 Game Sum

CodeForces 1709F Multiset of Strings

洛谷传送门 CF 传送门 考虑若确定了所有 \(c_s\),如何计算集合最大大小。 下文令原题面中的 \(f\) 为 \(m\)。 发现我们可以类似倒推地确定。比如若 \(n = 3\),\(c_{00} = \min(c_{000}, c_{001})\),\(c_{01} = \min(c_{0 ......
CodeForces Multiset Strings 1709F 1709

CodeForces 1895G Two Characters, Two Colors

洛谷传送门 CF 传送门 要求最大化收益加上支出,又因为每个字符有染红和染蓝两种选择,考虑最小割模型。可以看成是一开始先获得 \(r_i + b_i\) 的收益,然后对于每个 \(0\),连边 \((S, i, b_i), (i, T, r_i)\);对于每个 \(1\),连边 \((S, i, r ......
CodeForces Characters Two Colors 1895G

安装warp-transducer时cmake.. 出现 Building shared library with no GPU support的解决办法

warp-transducer A fast parallel implementation of RNN Transducer (Graves 2013 joint network), on both CPU and GPU. GPU implementation is now available ......

Picamera2 Python library

安装 目前2022年之后的镜像已经预装了picamera2, 如果需要安装使用 sudo apt install -y python3-picamera2 此包会安装X-windows和GUI依赖, 如果不需要使用, sudo apt install -y python3-picamera2 --n ......
Picamera2 Picamera library Python

Educational Codeforces Round 94 (Rated for Div. 2) D. Zigzags 题解

题意 给你一个数组 \(a1,a2…an\) 请计算有多少个四元组 \((i,j,k,l)\) 符合以下条件: \(1 <= i < j < k < l <= n\) \(a_i=a_k \ \&\&\ a_j=a_l\) \(4<=n<=3000,1<=a_i<=n\) \(input\) 2 5 ......
题解 Educational Codeforces Zigzags Round

CodeForces 1895E Infinite Card Game

洛谷传送门 CF 传送门 容易转化成经典的有向图博弈模型。每张牌建一个点,若 \(x\) 能打败 \(y\) 就连一条 \(x \to y\) 的边。入度为 \(0\) 的点为必败态,之后类似拓扑排序倒推即可。 具体就是若存在边 \(u \to v\),若 \(u\) 为必败态则 \(v\) 为必胜 ......
CodeForces Infinite 1895E 1895 Card

windows bat批处理 hack小工具的文件编写(除了library要自己调整外都可以用)

@echo off color 0A mode con cols=1500 lines=1500 mshta vbscript:msgbox("welcome to the 江南的江 万能工具箱")(window.close) title " hack jiang " :HACK cls echo ......
windows library 文件 工具 hack

CodeForces 1895F Fancy Arrays

洛谷传送门 CF 传送门 看到题目感觉很怪,没有什么很好的直接做的办法。于是考虑容斥,\(\min a_i \le x + k - 1\) 的方案数减去 \(\max a_i < x\) 的方案数即为答案。 前者的方案数是好算的。注意到只要确定了 \(\min a_i\) 和差分数组 \(a_i - ......
CodeForces Arrays 1895F Fancy 1895

Codeforces Round 907 (Div. 2)

\(A. Sorting with Twos\) https://codeforces.com/contest/1891/submission/232689614 \(B. Deja Vu\) https://codeforces.com/contest/1891/submission/232690 ......
Codeforces Round 907 Div