codeforces 1864e guess game
Codeforces Round 881 (Div. 3)
比赛链接:https://codeforces.com/contest/1843 ## A. Sasha and Array Coloring **题意**:一个数组,可以任意分成任意组,每组的贡献是组最大值减最小值,求最大总贡献 **思路**:一组内只有最大值和最小值有用,所以每组只由两个数组成即 ......
[LeetCode][55]jump-game
# Content You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ......
Codeforces Round 893 (Div. 2)
# Preface 最战俘的一场,B题写挂一发后整个人脑子就不清醒了,放着D不写去写E1,然后忘了可持久化栈有一个经典的倍增写法,最主要当时暑假前集训我还上去讲了这个东西然后比赛的时候还没想起来 后面目送徐神爆切5题成功完成两场从蓝上橙,狠狠地把我这个在紫卡了半年的废物羞辱了一波 不过确实说实话我们 ......
Educational Codeforces Round 109 (Rated for Div. 2)
Educational Codeforces Round 109 (Rated for Div. 2) A - Potion-making 思路:求最小操作数即药水最简比 #include<bits/stdc++.h> using namespace std; #define int long lo ......
games101-homework-notes
Games101 作业笔记 Created: 2023-06-19T12:00+08:00 Published: 2023-08-17T16:23+08:00 Categories: ComputerGraphics [ToC] # pa0 使用宏节约 `angle / 180.0 * acos(- ......
Codeforces Round 883 (Div. 3)
比赛链接:https://codeforces.com/contest/1846 ## A. Rudolph and Cut the Rope **题意**:给n条绳子,知道一端所在高度坐标和各自绳长,他们另一端都连到一个糖果上,问至少剪掉多少绳子糖果能碰到地面 **思路**:显然只有坐标小于绳长的 ......
牛客多校赛第9场G Game
黑板上有一些数字,Alice和Bob轮流操作,每次操作可以选择黑板上的两个数(两个数可以相同),然后在黑板上写下这两个数的异或。谁先写出k谁赢。 首先重复的数字是没有用的,进而可以推出除整局游戏的第一步之外,都可以选择保持当前的局面不变. 比如如果一个玩家面对的是一个必输的局面,他就可以选择保持局面 ......
Codeforces Round 892 (Div. 2)
# Codeforces Round 892 (Div. 2) [TOC] ## A United We Stand > 给定长度为$n$的数组`a`,可以将`a`中元素添加到空数组`b`或`c`中,满足两个数组均非空,且`c`中的元素不是`b`中元素的约数。若不能满足输出`-1`。 `c`中的元素 ......
games101-lecture-notes
Games101 课程笔记 Created: 2023-06-07T20:54+08:00 Published: 2023-08-16T21:05+08:00 Categories: ComputerGraphics [ToC] # Lecture01: Overview of Computer G ......
2023.08.12 codeforces round 893 div2
年轻人的第四场div2 rank:8217 solved:2 rating change:+31 new rating:1354 A.Buttons 题意:给定a,b,c三种按钮的数量,a按钮只能被Anna按,b按钮只能被Katie按,两个人都可以按c按钮,最后没有按钮可以按的人输,Anna先手,问 ......
Codeforces Round 891 (Div. 3)
比赛链接:https://codeforces.com/contest/1857 ## A. Array Coloring **题意**:一个数列,问能否分成两个和的奇偶性相同的集合 **思路**:因为偶数不改变奇偶性,咱们就统计奇数的个数,能平分成两组就行 ## B. Maximum Roundi ......
Educational Codeforces Round 107 (Rated for Div. 2)
Educational Codeforces Round 107 (Rated for Div. 2) A - Review Site 思路:数1和3的个数 #include<bits/stdc++.h> using namespace std; #define int long long //#d ......
Codeforces Round 765 (Div. 2) A-E
## **A. Ancient Civilization** 好像就是对每个二进制位看一下0多还是1多,选择多的那个数就好了。 vp的时候直接猜的,交了一发直接过了 ```cpp void solve(){ int n=read(),m=read(); vectorcnt0(m+1),cnt1(m+ ......
Codeforces Round 893 (Div. 2)
Codeforces Round 893 (Div. 2) A - Buttons 思路:将第三种按钮平分给两人,若第一个人的按钮数大于第二个人则First #include<bits/stdc++.h> using namespace std; #define int long long //#d ......
Codeforces Round 893(div2)
# Codeforces Round 893(div2) [A题传送门]([Problem - A - Codeforces](https://codeforces.com/contest/1858/problem/A)) ## A题意: 我们有a+b+c个瓶盖,选手1可以拿指定的a个或者c个里面的 ......
AGC064C Erase and Divide Game
[题面传送门](https://atcoder.jp/contests/agc064/tasks/agc064_c) 首先考虑你只插入若干个数怎么做:按位从低到高插入一棵 Trie,问题就变成:在 Trie 上每次可以往左儿子走或者往右儿子走,如果当某个人操作的时候为空节点那么这个人就输了。 如果我 ......
CodeForces 1858D Trees and Segments
[洛谷传送门](https://www.luogu.com.cn/problem/CF1858D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1858/D "CF 传送门") 美丽度的式子可以写成 $(a - 1) \tim ......
[LeetCode] 2682. Find the Losers of the Circular Game
There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, movin ......
『题解』ABC261Ex Game on Graph
[题目链接](https://atcoder.jp/contests/abc261/tasks/abc261_h) 震惊!这个题竟然被神犇 szs 放进了博弈论里!我真的没看出来除了题面还有哪里像博弈论(也许是因为我菜)。 转移方式很显然,按照题面说的做就行了。那么正解也就呼之欲出了。 但是我知道大 ......
Codeforces Round 892 (Div. 2)
# Codeforces Round 892 (Div. 2) ## A. United We Stand ### 简述题意 给定一个长度为 $ n $ 的数列 $ a $ ,要求将 $ a $ 的每个元素分配到数列 $ b $ ,$ c $ 中,满足以下两个要求 1. $ b,c $ 不为空,即 ......
Codeforces Global Round 15
Codeforces Global Round 15 A - Subsequence Permutation 思路:找出原串与排序后的串不同的个数 #include <bits/stdc++.h> using namespace std; void solve(){ int n;cin>>n; st ......
Codeforces Round 892 (Div. 2) A-E
## A. United We Stand 题意:给出一个长为$n$的数组$a$,将其中的元素分别放到空数组$b$和$c$中,使得$c$中的任意一个元素都不是$b$中任意一个元素的因数,并且两个数组都不是空数组 ### Solution 把$a$中最小的数放到$b$,其它的都放到$c$,一定可以保证 ......
[补题] Codeforces Round 892 (Div. 2)
## Codeforces Round 892 (Div. 2) ~~感觉被诈骗了ww~~ ### A #### Translate & Description 你有一个$a$数组,你可以将$a$数组的每一个数放到$b$数组或者$c$数组中。构造完后你需要确保$\forall b_i$%$\fora ......
Codeforces Ronud 892(Div.2)
# Codeforces Ronud 892(Div.2) 关于A题我有话说 [传送门](https://codeforces.com/contest/1859/problem/A) ## 题意 给定一个长度为n的数组a,问能否将元素全部放入两个空数组b和c中,使得b和c数组同时满足非空,且c数组中 ......
CodeForces-1798#B 题解
## 正文 开个数组 $last_k$ 统计 $a_{i,j}$ 最后买彩票的时间,再开一排桶 $day_t$ 记录该天最后买彩票的有哪些人(即:有 $p$ 满足 $last_p=t$ 的集合)。 将 $last_k$ 放入 $day_t$ 中,判断 $day_t$ 中是否存在空桶,若有则无解(因为 ......
2023.08.12 codeforces round 892 div2
年轻人的第三场div2(已完成:ABCDE) rank:1265 solved:4 rating change:+276 new rating:1323 A.United We Stand 题意:给定一个数列a,问是否能分成两个非空的数列b和c,使得c中任意一个数不是b中任意一个数的因子; 若x是y ......
Druid连接池更换Guess数据源
[toc] ## 1. 遇到的问题 工作中有个db国产化的需求,需要在一个老项目中把DB从mysql更换为openGuess,将对应的驱动和Druid数据源改造后启动程序报错如下: ``` java.lang.IllegalStateException: dbType not support : n ......
「解题报告」AGC064C Erase and Divide Game
第二次打 AGC,场上过了 C,还是很开心的。 而且是在一整天没碰 OI 的情况下。所以长时间 AFO 再回来打比赛会不会对 OI 有一定的 buff?有时候思维过度疲惫的情况下貌似打比赛脑子是真的转不动。 不过为啥 D 过的比 C 多啊,我觉得 C 很简单啊,基本没有任何转化,可能 AT 的这类计 ......
Codeforces Round 892 (Div. 2)
c题jls的代码,拿过来仔细研究了一番,终于弄明白了。 https://codeforces.com/contest/1859/problem/C jls代码 ``` #include using i64 = long long; struct DSU { std::vector f, siz; D ......
Codeforces Round 878 (Div. 3)
比赛链接:https://codeforces.com/contest/1840 ## A. Cipher Shifer **题意**:给你一个加密后的字符串,加密规则是将原字符串每个字符连续写两次,并在其中添加任意长度大于等于零的子串,求解原字符串 **思路**:不用管添加的子串,从第一个字符开始 ......