摘要: J - GCD Permutation 传送门: J - GCD Permutation **知识点:**素数筛、容斥定理、gcd 题意:长度为n的一个排列a中,求满足$gcd(i,j)!=1 且 gcd(a_i,a_j)!=1$的i,j对数。i,j可以相同。n<=2e5 解法: 根据埃氏筛的原理, 阅读全文
posted @ 2022-12-28 21:15 wtn135687 阅读(55) 评论(0) 推荐(0)
摘要: I - Cloud Retainer's Game 传送门: I. Cloud Retainer's Game (codeforces.com) 题意: 在坐标轴上有2个边界:y=0和y=H。有n个质点(木板),m个宝物(硬币)。一个小球从(0,0)点开始移动方向为↗。 小球遇到木板或边界之后,y轴 阅读全文
posted @ 2022-11-09 16:13 wtn135687 阅读(185) 评论(0) 推荐(0)
摘要: H. Permutation Counting 2022/7/28 传送门:https://codeforces.com/group/5zHJ4CTyoU/contest/392060/problem/H 图上计数,判环,拓扑。 题意:求n个数排列的方案数,满足m个限制条件:$P_{x_i}<P_{ 阅读全文
posted @ 2022-07-28 18:16 wtn135687 阅读(54) 评论(0) 推荐(0)
摘要: F. K-th Power 传送门: 牛客:https://ac.nowcoder.com/acm/contest/34866/F cf:https://codeforces.com/group/5zHJ4CTyoU/contest/392060/problem/F 题意:求区间[l,r]中,不含有 阅读全文
posted @ 2022-07-28 17:56 wtn135687 阅读(52) 评论(0) 推荐(0)
摘要: Educational Codeforces Round 132 (Rated for Div. 2) 传送门:https://codeforces.com/contest/1709 A. Three Doors 随便乱搞都行 #include <bits/stdc++.h> #define int 阅读全文
posted @ 2022-07-24 17:15 wtn135687 阅读(43) 评论(0) 推荐(0)
摘要: Codeforces Round #803 (Div. 2) 2022/7/24 上午VP 传送门:https://codeforces.com/contest/1698 A. XOR Mixup 随便输出数组里的一个数字就行 #include<bits/stdc++.h> signed main( 阅读全文
posted @ 2022-07-24 13:05 wtn135687 阅读(38) 评论(0) 推荐(0)
摘要: Codeforces Round #809 (Div. 2) 2022/7/19 下午VP 传送门:https://codeforces.com/contest/1706 A. Another String Minimization Problem #include <bits/stdc++.h> 阅读全文
posted @ 2022-07-21 11:45 wtn135687 阅读(53) 评论(0) 推荐(0)
摘要: 参考教程: 裴蜀定理 - OI Wiki (oi-wiki.org) 内容: 设a,b是不全为零的整数,则存在整数x,y使得$ax+by=gcd(a,b)$。 例题: Problem - D - Codeforces 传送门: Problem - D - Codeforces 题意: 思路: 裴蜀定 阅读全文
posted @ 2022-07-18 20:54 wtn135687 阅读(102) 评论(0) 推荐(0)
摘要: 参考教程: (6条消息) 逆元原理详解_跑起来要带风!的博客-CSDN博客 (6条消息) 密码学中模运算的逆元求解_Gardenia Minwentel的博客-CSDN博客_模逆元怎么求 原理: $a^{m-1}mod m=1modm$(m为素数) $a*a^{m-2}mod m=1modm$ $\ 阅读全文
posted @ 2022-07-18 19:50 wtn135687 阅读(75) 评论(0) 推荐(0)
摘要: Codeforces Round #808 (Div. 2) 传送门:https://codeforces.com/contest/1708 错过了,第二天vp的,只写出了AB就卡C了,竟然看不出是贪心555 A. Difference Operations 题意:给一个数组,由如下操作,问能不能使 阅读全文
posted @ 2022-07-18 11:52 wtn135687 阅读(50) 评论(0) 推荐(0)