题面 给一个长度为 n \tt n n 的字符串,你可以进行无限次以下两种操作之一: 删去末尾的字符(此时要保证删去后字符串非空). 把当前整个字符串复制一份,接到自己的后面. 输出最终通过操作能达到的长度为 k \tt k k 的字符串中字典序最小的那个字符串. Easy Version: 1 ≤ n , k ≤ 5 000 \tt1\leq n,k\leq5\,000 1≤n,k≤5000. Hard Version: 1 ≤ n , k ≤ 500 000 \tt1\leq n,k…
A. Arithmetic Array 题目大意:一串数,求添加多少个非负整数后平均值为1 代码: //CF726A #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) typedef long long ll; #define INF 0x3f3f3f3f const double EPS = 1e-18; const int MOD =…