codeforces divisible numbers version
[Codeforces] CF1704C Virus
CF1704C Virus 题意 有一个长度为\(n\)的环,即对于\(1\leq i\leq n\),满足第\(i\)个与第\(i+1\)个房子相邻,特别地,第 \(n\) 个房子与第 \(1\) 个房子也相邻。 一开始,这 \(n\) 个房子中有 \(m\) 个房子被病毒感染了。在之后的每天早上 ......
[Codeforces] CF1703E Mirror Grid
CF1703E Mirror Grid 题意 给定一个 \(n\times n\ (n\le100)\) 的 01 矩形,求至少修改多少次后能使矩形旋转 0°,90°,180°,270°后所形成的矩形都完全相同。 思路 吸纳分为两种情况讨论: \(n\)为奇数 那么会出现这种情况:(以\(5\tim ......
Codeforces Round 811 (Div. 3)
基本情况 ABC秒了。 DE都给了我希望,但都做不下去。 两道题反复横跳,结果最后谁也没做出来。 E还是比D亲切的,先补E吧。 E. Add Modulo 10 做的时候想着说对每个个位数的变化找找规律,但是没有进一步的发现。 实际上就应该从这里下手。 首先共识:相同的两个数经过操作后必然相同。 分 ......
Codeforces Round 913 (Div. 3)
A. Rook 打印出象棋车的下一步 using namespace std; void solve(){ string s; cin>>s; char a=s[0]; char b=s[1]; set<string>ans; for(char i='1';i<='8';i++){ string t ......
火狐:SSL_ERROR_UNSUPPORTED_VERSION,谷歌、EDGE: ERR_SSL_VERSION_OR_CIPHER_MISMATCH
一些老的系统,在登陆的时候会报如下错误 现象:火狐:SSL_ERROR_UNSUPPORTED_VERSION,谷歌、EDGE: ERR_SSL_VERSION_OR_CIPHER_MISMATCH 原因:就是老系统https使用的协议太老,不安全,新的浏览器版本不兼容 解决方法:chrome和ed ......
Calculate the geometric mean of inputs a and b. The geometric mean of two numbers is the square root of a * b.
计算输入a和b的几何平均值。两个数字的几何平均值是a * b的平方根。 import java.util.*; import java.io.*; import java.math.*; /** * Auto-generated code below aims at helping you pars ......
CF1870F-Lazy Numbers
CF1870 F - Lazy Numbers 题意 给定 \(n,k\) ,设 \(rank_i\) 表示 \(i\) 的无前导 \(0\) 的 \(k\) 进制串在 \([1,n]\) 所有数的无前导 \(0\) 的 \(k\) 进制串中的字典序排名(从小到大)。求 \(rank_i=i,i\i ......
Codeforces Edu 154 (A-E)
Codeforces Edu154 (Rated for Div2) (A-E) A.Prime Deletion 可以发现只要存在一个两位数(两位不相同),其正着看和反着看都是质数,则原问题有解。这时我们可以把除了这两位上的数之外的其他数从 \(s\) 中剔除,就有答案。上述两位数不少,如:13, ......
Codeforces Pinely Round 2 (D~G)
D - Two-Colored Dominoes by yzt E - Speedrun 题意 给定 \(n,m,k\) 。你需要考虑一个序列 \(t\)。 \(n\) 个要求:\(t_i \equiv h_i\mod k\)。 \(m\) 个要求:\(t_{u_i} \le t_{v_i}\)。 ......
[LeetCode] 1903. Largest Odd Number in String
You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or ......
Codeforces Round 894 G
玩一下样例就能知道 这个是和 每个seg的最大间隔相关 为了好写我们可以直接写成元素间隔 这样我们用两个multiset维护元素间隔以及元素即可 注意删除的时候我们只删一个值 需要删指针 还有考虑长度为1的情况 multiset<int>st,st1; void Erase(int x){ auto ......
Codeforces Round 913 (Div. 3)
Codeforces Round 913 (Div. 3) 比赛链接 ROOK 题目 思路: 我没有下过国际象棋,但这个题跟国际象棋真是没有一点关系,就是一个简单的输出 代码: #include<bits/stdc++.h> using namespace std; #define int long ......
CodeForces 1901F Landscaping
洛谷传送门 CF 传送门 还是很有趣的一道题。场上直接暴拆式子,要维护动态凸包,本来以为是 \(\log^2\) 的,写着写着发现是 \(\log^3\),遂弃。 显然梯形面积最小等价于 \(y_0 + y_1\) 最小,而 \(y_0 + y_1\) 最小等价于梯形在 \(m = \frac{n} ......
转:ROW_NUMBER() OVER函数的基本用法
ROW_NUMBER() OVER函数的基本用法 分组后排序 在oracle 中分组倒叙排序,取出每一组的第一个值,如何通过 ROW_NUMBER() OVER 实现 ChatGPT ChatGPT 在Oracle中,你可以使用ROW_NUMBER()窗口函数结合PARTITION BY和ORDER ......
Codeforces Round 913 (Div. 3)
Codeforces Round 913 (Div. 3) div3 两题 新纪录.. 我再也不喝完酒打cf了 A. Rook #include <bits/stdc++.h> //#define int long long #define endl '\n' using namespace std ......
【题解】CodeForces 1902F Trees and XOR Queries Again
传送门:https://codeforces.com/contest/1902/problem/F 数据结构题,这里讲两种思路。 $ST$ 表思路: 判定“从若干个数中能否取出其中一些,使得异或和为 $x$”的问题,第一时间想到线性基,本题要做的显然就是快速求出询问路径上所有数的线性基。两组数的线性 ......
Educational Codeforces Round 158 (Rated for Div. 2)
Preface 补题,妈的现在Edu E都做不来这搞毛啊 A. Line Trip 签到 #include<cstdio> #include<iostream> #include<utility> #include<vector> #include<cstring> #include<cmath> ......
Codeforces Round 913 (Div. 3)(A~F)
A. Rook 题意:在一个国际象棋棋盘中,横坐标为a-h,纵坐标为1-8,字母在前,数字在后,输入一个棋子的位置,输出该棋子所在的行与列中非棋子本身位置的所有位置。 分析:模拟。 代码: #include <iostream> #include <algorithm> using namespac ......
Codeforces Round 908 C
111 发现要是所有的l r求和 L R 的差距>n 我们总可以找到一个x不在n个不同的aij里 然后我们知道L R 的差距不大于1e5 我们枚举这个最终的个数为now 我们钦定选满所有的非now的元素 看是否差一些元素达到now 当然维护过程中我们要注意l[i] r[i]的限制 但是我们枚举now ......
CMC-ORACLE-函數row_number() over(partition by )函数用法
row_number() over(partition by )函数用法 row_number() over(partition by),作为oracle常用的分析函数,身为数据开发时必须要掌握的。不过一段时间不用,难免会有些忘记,今天整理一下一些场景下的用法。 现有表(test_rownumber ......
【题解】CodeForces 686E Optimal Point
传送门:https://codeforces.com/contest/686/problem/E 前言:本题解来源于作者某天晚上和一位朋友的发电内容(没错,这个作者直接把自己和朋友发电时发的话用markdown排了一下,传上来了),当时本来就比较口语化,加上作者的做法又实在太过离谱,因此可能语言表述 ......
Codeforces Round 912 (Div. 2)
Preface 这场题莫名很对我胃口,因为F是个究极套路题,还是我最拿手的2-SAT,想+写不到半小时就搞定了 然后E的核心思想和上周末VP的一场省赛的题一样,因此看一眼就会了 唯一抽象的是D2要用对超集的sosdp,由于之前没写过就不知道还能这么搞 A. Halloumi Boxes 当\(k\g ......
Educational Codeforces Round 154 (Rated for Div. 2)
Educational Codeforces Round 154 (Rated for Div. 2) # Name A Prime Deletion x14422 B Two Binary Strings x10743 C Queries for the Array x3639 D Sorting ......
Codeforces Round 911 D
111 排序之后 我们可以枚举最大值 因为之前的任意两个gcd都不能超过这个最大值 但是 我们每次往下枚举 就要加入这个最大值 我们可以枚举他的因子 要是之前出现过 那么这个因子的贡献显然就可以求出来 但是这样有可能 多算了贡献比如 20可能算到 20 也算了 2 我们设sum_i 表示gcd为i的 ......
InvalidVersionSpecError: Invalid version spec: =2.7
解决方式:将~/anaconda3/lib/python3.7/site-packages/conda/models/version.py中 这一行version_relation_re = re.compile(r'(==|!=|<=|>=|<|>)(?![=<>!])(\S+)$')改成vers ......
Codeforces Round 913 (Div. 3)
A. Rook #include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; using node = pii; using i32 = int32_t; void so ......
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 103 Current browser version is 106.0.5239.0
pyhon 调selenium报: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chro ......
【解决方案】adb server version (41) doesn't match this client (36);
【GiraKoo】adb server version (41) doesn't match this client (36); 环境 夜神模拟器无法与Android Studio连接。使用命令行连接时会提示adb server version (41) doesn't match this cli ......
Codeforces Round 913 (Div. 3)
Codeforces Round 913 (Div. 3) 基本情况 A、B题秒了。 C题找了好几个规律,一开始一直找错,但是最后终于对的。 因为C题耗时太久,D、E题看都没看。准备先做一下再补题。 ......
CodeForces 1497E2 Square-free division (hard version)
洛谷传送门 CF 传送门 感觉和 CF1889C2 Doremy's Drying Plan (Hard Version) 有异曲同工之妙。 显然去除每个数的平方因子后,两个数相乘为完全平方数当且仅当它们相等。 考虑若确定了分段方案,那么修改次数就是,每一段重复出现的数的个数。 那么我们设 \(f_ ......