regionals multiply contest problem

AtCoder Beginner Contest 317

# A - Potions ```cpp #include using namespace std; #define int long long int power(int x, int y, int p) { x %= p; int ans = 1; while (y) { if (y & 1) ......
Beginner AtCoder Contest 317

AtCoder Beginner Contest 296 C - Gap Existence

# C - Gap Existence [原题链接](https://atcoder.jp/contests/abc296/tasks/abc296_c) 题意:是否存在Ai - Aj = x 思路:排序,双指针 ```c++ #include using namespace std; const ......
Existence Beginner AtCoder Contest 296

AtCoder Beginner Contest 292 E - Transitivity

# E - Transitivity [原题链接](https://atcoder.jp/contests/abc292/tasks/abc292_e) 题意:对于一个有向图,进行加边操作,使最终任意的个点具有传递效果,即若a到b有边,b到c有边,那么a到c也要有边,问最少需要进行多少次操作,使得每 ......
Transitivity Beginner AtCoder Contest 292

AtCoder Beginner Contest 292 D - Unicyclic Components

# D - Unicyclic Components [原题链接](https://atcoder.jp/contests/abc292/tasks/abc292_d) 题意:判断一个连通块的边和点个数是否相同 思路:对它使用并查集吧 点击查看代码 ``` #include using namesp ......

codeforces div 3 contest 894 solutions

IOI失利day1了,打div 3休息一下吧 https://codeforces.com/contest/1862/ A. Gift Carpet 贪心寻找第一个v, 其他的找最早的i,k,a就好了。 应该不需要多说(?) B.Sequence Game 就是想想看当我们有4 3的时候应该怎么做? ......
codeforces solutions contest 894 div

The 2022 ICPC Asia Nanjing Regional Contest

# [The 2022 ICPC Asia Nanjing Regional Contest](https://codeforces.com/gym/104128) [出题人题解](https://sua.ac/wiki/2022-icpc-nanjing/) [TOC] vp的不是很好,就不放出来 ......
Regional Contest Nanjing 2022 ICPC

CF1174E Ehab and the Expected GCD Problem 题解

## 题意 对于一个排列 $p$,定义 $g$ 为 $p$ 的前缀最大公约数序列,即 $g_i = \gcd\limits_{j = 1}^{i} p_j$。定义 $f(p)$ 为 $g$ 的元素种类数。 给定 $n$,求长度为 $n$ 的且使得 $f(p)$ 取最大值的排列个数,对 $10^9 + ......
题解 Expected Problem 1174E 1174

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)(B-D)

# Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)(B-D) ## B Swap and Reverse 有点小妙哈哈哈 注意到 **奇数位置和偶数位置的性质** 就是说,对于swap操作,奇数位置的顺序永远可以直接排成最小 ......
Scholarship Div Harbour Contest Space

Educational Codeforces Round 148 (Rated for Div. 2)E. Combinatorics Problem(组合数,动态规划)

题目链接:https://codeforces.com/contest/1832/problem/E 题意: 当然这是化简后的题意,原题面和这个差距还是有点大的; 分析: 因为组合数有公式: 所以: 嗯,然后就没有了; 时间复杂度:O(n*k); 代码: #include<bits/stdc++.h ......

AtCoder Regular Contest 164

# Preface 补一下好久之前的ARC,ABC的话如果没事会考虑从后往前补一下 # **A - Ternary Decomposition** 首先判掉当$k>n$时一定无解,否则可以贪心地对$n$进行三进制分解,得到最少可以拆成$k'$个数 不难发现我们总可以把其中较大的数拆成三个小的,以此来 ......
AtCoder Regular Contest 164

The 2021 ICPC Asia Shenyang Regional Contest 解题报告

[The 2021 ICPC Asia Shenyang Regional Contest](https://codeforces.com/gym/103427) solo 七题罚时 738 打到金尾了,但是这个 G 和 I 也应该是自己能做出来的。G 找了若干性质确实转化到最后一步了。但本应该搞出 ......
Shenyang Regional Contest 报告 2021

Atcoder Beginner Contest 317 解题报告

# Atcoder Beginner Contest 317 ABC316 咋没了。 暂时 A~E。 ## Hints D $\quad$可以算出每次选举需要的改票数。然后变成了一个经典问题。 E $\quad$有点 naive。不用担心暴力扫 T 掉,时间复杂度是真的。 F $\quad$F1 $ ......
Beginner Atcoder Contest 报告 317

AtCoder Beginner Contest 317 F - Nim

## 数位 DP ```cpp #include using namespace std; using ll = long long; int dp[64][10][10][10][2][2][2][2][2][2]; int main() { ll n; int b1, b2, b3; cin > ......
Beginner AtCoder Contest 317 Nim

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)

**A**. 给三个数 $x$ $y$ $n$ 。需要构造一个长度为 $n$ 的数组满足以下条件 1. $a_1 = x$, $a_n = y$ 。 2. $a$ 严格递增。 3. 定义 $b_i = a_{i + 1} - a_{i}$ ,$b$ 严格递减。 显然前两个条件非常宽松,定义好起始点, ......
Scholarship Div Harbour Contest Space

【1342C】Yet Another Counting Problem(数论)

**题目大意:** 求有多少$x(1\le l\le x\le r\le 10^{18})$满足$(x\mod a)\mod b\neq(x\mod b)\mod a(1\le a,b\le 200)$,有$q(1\le q\le 500)$次询问。 *** 设答案为$f(l,r)$,考虑前缀和$f ......
数论 Counting Another Problem 1342C

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)

# Preface 因为不清空E题调了好久才过,没时间看后面的题了遂2h下机,赛后感觉F还是可做的 这周三和周四的CF因为第二天有课可能都要开另一个小号随便打打了,毕竟有早八还打到两点钟实在是顶不住的说 # A. Increasing and Decreasing 从后往前贪心地确定每个数,最后检验 ......
Scholarship Div Harbour Contest Space

AtCoder Beginner Contest 317 G Rearranging

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc317_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc317/tasks/abc317_g "AtCoder 传送门") 考虑转化成匹配问题 ......
Rearranging Beginner AtCoder Contest 317

Atcoder Beginner Contest 317(F~G)

**两发罚时:** 1. D long long。 2. E bfs 不在把元素扔进队列前标记。 ## F. [Nim](https://atcoder.jp/contests/abc317/tasks/abc317_f) 考虑 $a_i$ 很小,$n$ 很大,于是不妨数位 dp。 设 $dp_{i ......
Beginner Atcoder Contest 317

The 2022 ICPC Asia Xian Regional Contest

链接 C.Clone Ranran 题意:一个人要准备一场比赛,需要出c道题,他现在可以选择两种操作:1.花费a分钟自我复制一次。(复制的自己也可以接着复制)2.花费b分钟出一道题。问最短要多少分钟可以准备c道题。 思路:枚举自我复制的次数,挨个判断就行。 #include<bits/stdc++. ......
Regional Contest 2022 ICPC Asia

The 2022 ICPC Asia Nanjing Regional Contest(A.Stop, Yesterday Please No More)

模拟边界(不是袋鼠)移动,通过二维差分维护左上角和右下角,同时注意排除重复的点 #include<bits/stdc++.h> using namespace std; #define endl "\n" typedef long long ll; const int N = 1e3 + 5; in ......
Yesterday Regional Contest Nanjing Please

The 2022 ICPC Asia Nanjing Regional Contest (G. Inscryption)

Problem - G - Codeforces 反悔贪心 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" const int N = 1e6 + 5; inline int g ......
Inscryption Regional Contest Nanjing 2022

AtCoder Beginner Contest 215

[ABC215F] Dist Max 2 二分出 min( | xi - xj | , | yi - yj | ),双指针维护是否存在满足条件的点对(i, j),假如二分当前值是x,那么 |xi - xj| >= x &&|yi - yj| >= x #include<bits/stdc++.h> ......
Beginner AtCoder Contest 215

解决:git SSL certificate problem: unable to get local issuer certificate

今天遇到了git update失败。 记录一下 错误: git SSL certificate problem: unable to get local issuer certificate > 这个问题是由于没有配置信任的服务器HTTPS验证。默认,cURL被设为不信任任何CAs,就是说,它不信任 ......
certificate problem issuer unable local

暑假集训D24 2023.8.22 contest I

### C.City Folding 题意:有一个由 $2^n$ 条等长线段组成的线,你可以进行 $n$ 次 **对折** ,可以从左向右对折或从右向左对折,给出初始时线段的编号 $P$ ,问如何对折 $n$ 次才能使对折后该线段恰好在从下往上数第 $H$ 层? $\operatorname{Sol ......
contest 2023 D24 24 22

2020-2021 ACM-ICPC, Asia Nanjing Regional Contest KLMEFA

# [2020-2021 ACM-ICPC, Asia Nanjing Regional Contest (XXI Open Cup, Grand Prix of Nanjing)](https://codeforces.com/gym/102992) ![image](https://img202 ......
ACM-ICPC Regional Contest Nanjing KLMEFA

题解 ABC309Ex【Simple Path Counting Problem】

好好玩的题。 设普通生成函数 $F_i$,其中 $[z^k]F_i$ 表示从所有起点走到 $(i,k)$ 的方案数。特别地,$[z^k]F_1=\sum\limits_{a\in A}[a=k]$。 注意到 $F_i=(z^{-1}+1+z)F_{i-1}$ **几乎**成立,但是在 $[z^1]F ......
题解 Counting Problem Simple Path

AtCoder Beginner Contest 314

# A - 3.14 ```cpp #include using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(0), cin.tie(0); string s = "14159265358979 ......
Beginner AtCoder Contest 314

AtCoder Beginner Contest 315

# A - tcdr ```cpp #include using namespace std; int32_t main() { string s; cin >> s; for( auto i : s){ if( i != 'a' and i != 'e' and i != 'i' and i != ......
Beginner AtCoder Contest 315

CF776D The Door Problem

## 思路 我们已经得知每盏灯的初始状态和哪两个开关控制它。 首先分类讨论: 如果最开始这盏灯是开着的,那么这两个开关应该做出同样的操作,即要么全按,要么全不按。 如果最开始这盏灯是关着的,那么这两个开关应该做出不同的操作,即一个按一个不按。 转化一个思路,就变成了有 $m$ 个数,其中有 $n$ ......
Problem 776D Door 776 The

SpringBoot整合Ip2region获取IP地址和定位

# **SpringBoot整合Ip2region获取IP地址和定位** ## **1.Ip2region的介绍** ### **1.1.Ip2region 是什么** ip2region v2.0 - 是一个离线IP地址定位库和IP定位数据管理框架,10微秒级别的查询效率,提供了众多主流编程语言的 ......
SpringBoot Ip2region 2region 地址 region