题意 给定一个长度为 $n$ 的序列 $a_1,a_2,...,a_n$。 有 $m$ 个询问,每个询问给出两个正整数 $k,pos$。你需要找到一个长度为 $k$ 的子序列,且满足如下要求: 该子序列的元素和是所有子序列中最大的; 该子序列是所有满足上一条件的子序列中字典序最小的一个。 对于每个询 ...
分类:
其他好文 时间:
2021-04-06 15:16:46
阅读次数:
0
第一次遇到有9题的div2。。。 A题 排序后,伸展两边 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=2e5+10; const i ...
分类:
其他好文 时间:
2021-04-06 15:06:31
阅读次数:
0
A. Déjà Vu 本题的思路是找一个位置使得新添加的a所对应的字符不是a即可。 AC代码如下(可能写复杂了): #include<bits/stdc++.h> #define MAXN 300005 using namespace std; typedef long long ll; int t ...
分类:
其他好文 时间:
2021-04-06 14:48:59
阅读次数:
0
本场链接:Codeforces Round #712 (Div. 2) A. Déjà Vu 签到题,尝试一下插入首位元素或者插入第一个不是a的位置.两者都不行必然是NO. #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using ...
分类:
其他好文 时间:
2021-04-06 14:34:27
阅读次数:
0
将服务寄宿与控制台: using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.ServiceModel.Description; using ...
分类:
其他好文 时间:
2021-04-06 14:33:05
阅读次数:
0
先创建后台实体类 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System. ...
归并排序模板 code: #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; typedef long long ...
分类:
编程语言 时间:
2021-04-05 12:52:30
阅读次数:
0
#include<bits/stdc++.h> using namespace std; int main(){ char s[105]; int x; scanf("%s%d",&s,&x); int ans=0; int len =strlen(s); for(int i=0;i<len;i++ ...
分类:
其他好文 时间:
2021-04-05 12:35:59
阅读次数:
0
#include<bits/stdc++.h> using namespace std; int main(){ char s[105]; int x,y; while(scanf("%d %d",&x,&y)!=EOF){ scanf("%s",s); int ans=0; int len=str ...
分类:
其他好文 时间:
2021-04-05 12:35:26
阅读次数:
0
链接:http://118.190.20.162/view.page?gpid=T42 代码: #include<bits/stdc++.h> using namespace std; vector<int> ve; int main (){ int n,num; cin>>n; for(int i ...
分类:
其他好文 时间:
2021-04-05 12:29:58
阅读次数:
0