A - Diverse Strings CodeForces - 1144A

A string is called diverse if it contains consecutive (adjacent) letters of the Latin alphabet and each letter occurs exactly once. For example, the following strings are diverse: "fced", "xyz", "r" and "dabcef". The following string are notdiverse: "az", "aa", "bad" and "babc". Note that the letters 'a' and 'z' are not adjacent.

Formally, consider positions of all letters in the string in the alphabet. These positions should form contiguous segment, i.e. they should come one by one without any gaps. And all letters in the string should be distinct (duplicates are not allowed).

You are given a sequence of strings. For each string, if it is diverse, print "Yes". Otherwise, print "No".

Input

The first line contains integer nn (1≤n≤1001≤n≤100), denoting the number of strings to process. The following nn lines contains strings, one string per line. Each string contains only lowercase Latin letters, its length is between 11 and 100100, inclusive.

Output

Print nn lines, one line per a string in the input. The line should contain "Yes" if the corresponding string is diverse and "No" if the corresponding string is not diverse. You can print each letter in any case (upper or lower). For example, "YeS", "no" and "yES" are all acceptable.

Example

Input
8
fced
xyz
r
dabcef
az
aa
bad
babc
Output
Yes
Yes
Yes
Yes
No
No
No
No
题意:给你一个字符串,看这个字符串的字符排完序是否是连续的。
解法就题意我把这个字符串排个序,然后遍历看是否连续,是连续输出 YES 否则输出 NO。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=;
int n;
char s[maxn];
int a[maxn];
int main()
{
scanf("%d",&n);
while(n--)
{
scanf("%s",s);
int len=strlen(s);
for(int i=;i<len;i++)
{
a[i]=s[i]-'a';
}
sort(a,a+len);
bool flag=false;
// for(int i=0;i<len;i++)
// cout<<a[i]<<" ";
// cout<<endl;
for(int i=;i<len-;i++)
{
if(a[i]==a[i+]-)
continue;
else
{
flag=true;
break;
}
}
if(flag)
printf("No\n");
else
printf("Yes\n");
}
return ;
}

B - Parity Alternated Deletions CodeForces - 1144B

Polycarp has an array aa consisting of nn integers.

He wants to play a game with this array. The game consists of several moves. On the first move he chooses any element and deletes it (after the first move the array contains n−1n−1 elements). For each of the next moves he chooses any element with the only restriction: its parity should differ from the parity of the element deleted on the previous move. In other words, he alternates parities (even-odd-even-odd-... or odd-even-odd-even-...) of the removed elements. Polycarp stops if he can't make a move.

Formally:

  • If it is the first move, he chooses any element and deletes it;
  • If it is the second or any next move:If after some move Polycarp cannot make a move, the game ends.
    • if the last deleted element was odd, Polycarp chooses any even element and deletes it;
    • if the last deleted element was even, Polycarp chooses any odd element and deletes it.

Polycarp's goal is to minimize the sum of non-deleted elements of the array after end of the game. If Polycarp can delete the whole array, then the sum of non-deletedelements is zero.

Help Polycarp find this value.

Input

The first line of the input contains one integer nn (1≤n≤20001≤n≤2000) — the number of elements of aa.

The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤1060≤ai≤106), where aiai is the ii-th element of aa.

Output

Print one integer — the minimum possible sum of non-deleted elements of the array after end of the game.

Examples

Input
5
1 5 7 8 2
Output
0
Input
6
5 1 2 4 6 3
Output
0
Input
2
1000000 1000000
Output
1000000
题意:给你一组数,按奇数偶数交错拿,直接最后不能拿了,要保证剩下的数值和最小。
思路:开两个优先队列,记录奇数和偶数的数量,因为是交错的拿,所以pop 奇数偶数两者最小值次,那么剩下的就是不能拿的了。
注意为什么要加一个
if(!q1.empty())
q1.pop();
if(!q0.empty())
q0.pop();
因为按着交错的拿的话,肯定有一个会被拿空,但是是交错的拿的话我可以选择先拿那个多的,比方说我有三个奇数,两个偶数,我按数量最少的偶数个数2 pop,但是注意我可以先拿奇数的,最后就可以多拿一个奇数所以要多一个奇数。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long LL;
const int maxn=;
int n;
int cnt1,cnt0;
int a[maxn];
int main()
{
scanf("%d",&n);
cnt0=cnt1=;
priority_queue<int>q1,q0;
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
if(a[i]%)
{
cnt1++;
q1.push(a[i]);
}
else
{
cnt0++;
q0.push(a[i]);
}
}
int cnt=min(cnt1,cnt0);
while(cnt--)
{
if(!q1.empty())
q1.pop();
if(!q0.empty())
q0.pop();
}
if(!q1.empty())
q1.pop();
if(!q0.empty())
q0.pop();
int ans=;
while(!q1.empty())
{
ans+=q1.top();
q1.pop();
}
while(!q0.empty())
{
ans+=q0.top();
q0.pop();
}
printf("%d\n",ans);
return ;
}

C - Two Shuffled Sequences CodeForces - 1144C

Two integer sequences existed initially — one of them was strictly increasing, and the other one — strictly decreasing.

Strictly increasing sequence is a sequence of integers [x1<x2<⋯<xk][x1<x2<⋯<xk]. And strictly decreasing sequence is a sequence of integers [y1>y2>⋯>yl][y1>y2>⋯>yl]. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

They were merged into one sequence aa. After that sequence aa got shuffled. For example, some of the possible resulting sequences aa for an increasing sequence [1,3,4][1,3,4] and a decreasing sequence [10,4,2][10,4,2] are sequences [1,2,3,4,4,10][1,2,3,4,4,10] or [4,2,1,10,4,3][4,2,1,10,4,3].

This shuffled sequence aa is given in the input.

Your task is to find any two suitable initial sequences. One of them should be strictly increasing and the other one — strictly decreasing. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

If there is a contradiction in the input and it is impossible to split the given sequence aa to increasing and decreasing sequences, print "NO".

Input

The first line of the input contains one integer nn (1≤n≤2⋅1051≤n≤2⋅105) — the number of elements in aa.

The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤2⋅1050≤ai≤2⋅105), where aiai is the ii-th element of aa.

Output

If there is a contradiction in the input and it is impossible to split the given sequence aa to increasing and decreasing sequences, print "NO" in the first line.

Otherwise print "YES" in the first line and any two suitable sequences. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

In the second line print nini — the number of elements in the strictly increasingsequence. nini can be zero, in this case the increasing sequence is empty.

In the third line print nini integers inc1,inc2,…,incniinc1,inc2,…,incni in the increasing order of its values (inc1<inc2<⋯<incniinc1<inc2<⋯<incni) — the strictly increasing sequence itself. You can keep this line empty if ni=0ni=0 (or just print the empty line).

In the fourth line print ndnd — the number of elements in the strictly decreasingsequence. ndnd can be zero, in this case the decreasing sequence is empty.

In the fifth line print ndnd integers dec1,dec2,…,decnddec1,dec2,…,decnd in the decreasing order of its values (dec1>dec2>⋯>decnddec1>dec2>⋯>decnd) — the strictly decreasing sequence itself. You can keep this line empty if nd=0nd=0 (or just print the empty line).

ni+ndni+nd should be equal to nn and the union of printed sequences should be a permutation of the given sequence (in case of "YES" answer).

Examples

Input
7
7 2 7 3 3 1 4
Output
YES
2
3 7
5
7 4 3 2 1
Input
5
4 3 1 5 3
Output
YES
1
3
4
5 4 3 1
Input
5
1 1 2 1 2
Output
NO
Input
5
0 1 2 3 4
Output
YES
0 5
4 3 2 1 0
题意:给你一个数组,看能不能分为两个数组,一个递增,一个递减,位置可以变换。
解法:开两个vector 存数,然后拍个序即可,唯一不合条件的就是某个数出现了多余两次。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
const int maxn=;
int n;
vector<int>v1,v2;
int a[maxn],cnt[maxn];
bool flag=false;
bool cmp(int x,int y)
{
return x>y;
}
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
cnt[a[i]]++;
if(cnt[a[i]]==)
v1.push_back(a[i]);
else if(cnt[a[i]]==)
v2.push_back(a[i]);
else
flag=true;
}
if(flag)
printf("NO\n");
else
{
printf("YES\n");
sort(v1.begin(),v1.end());
sort(v2.begin(),v2.end(),cmp);
printf("%d\n",v1.size());
for(vector<int>::iterator it=v1.begin();it!=v1.end();it++)
printf("%d ",*it);
printf("\n");
printf("%d\n",v2.size());
for(vector<int>::iterator it=v2.begin();it!=v2.end();it++)
printf("%d ",*it);
printf("\n");
}
return ;
}

D - Equalize Them All CodeForces - 1144D

You are given an array aa consisting of nn integers. You can perform the following operations arbitrary number of times (possibly, zero):

  1. Choose a pair of indices (i,j)(i,j) such that |i−j|=1|i−j|=1 (indices ii and jj are adjacent) and set ai:=ai+|ai−aj|ai:=ai+|ai−aj|;
  2. Choose a pair of indices (i,j)(i,j) such that |i−j|=1|i−j|=1 (indices ii and jj are adjacent) and set ai:=ai−|ai−aj|ai:=ai−|ai−aj|.

The value |x||x| means the absolute value of xx. For example, |4|=4|4|=4, |−3|=3|−3|=3.

Your task is to find the minimum number of operations required to obtain the array of equal elements and print the order of operations to do it.

It is guaranteed that you always can obtain the array of equal elements using such operations.

Note that after each operation each element of the current array should not exceed 10181018 by absolute value.

Input

The first line of the input contains one integer nn (1≤n≤2⋅1051≤n≤2⋅105) — the number of elements in aa.

The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤2⋅1050≤ai≤2⋅105), where aiai is the ii-th element of aa.

Output

In the first line print one integer kk — the minimum number of operations required to obtain the array of equal elements.

In the next kk lines print operations itself. The pp-th operation should be printed as a triple of integers (tp,ip,jp)(tp,ip,jp), where tptp is either 11 or 22 (11 means that you perform the operation of the first type, and 22 means that you perform the operation of the second type), and ipip and jpjp are indices of adjacent elements of the array such that 1≤ip,jp≤n1≤ip,jp≤n, |ip−jp|=1|ip−jp|=1. See the examples for better understanding.

Note that after each operation each element of the current array should not exceed 10181018 by absolute value.

If there are many possible answers, you can print any.

Examples

Input
5
2 4 6 6 6
Output
2
1 2 3
1 1 2
Input
3
2 8 10
Output
2
2 2 1
2 3 2
Input
4
1 1 1 1
Output
0
题意:

给出N个数, 对任意相邻的两个数ai, aj有两种操作:set ai:=ai+|ai−aj|; set ai:=ai−|ai−aj|.

求最少进行多少次操作, 可以使得所有数全部相等。发现对于任意的两个数进行一次操作均可使其相等, 同时可以向左/向右传递.
这样一来使得所有数均为出现次数最多的数毫无疑问就是最优策略了。所以就是找众数,找到之后把其他的往这边转换。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
const int maxn=;
int n;
vector<int>v1,v2;
int a[maxn],vis[maxn];
int id,maxx;
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
vis[a[i]]++;
if(vis[a[i]]>maxx)
{
maxx=vis[a[i]];
id=i;
}
}
printf("%d\n",n-maxx);
for(int i=id-;i>=;i--)
{
if(a[i]>a[i+])
printf("2 %d %d\n",i,i+);
else if(a[i]<a[i+])
printf("1 %d %d\n",i,i+);
a[i]=a[i+];
}
for(int i=id+;i<=n;i++)
{
if(a[i]>a[i-])
printf("2 %d %d\n",i,i-);
else if(a[i]<a[i-])
printf("1 %d %d\n",i,i-);
a[i]=a[i-];
}
return ;
}

E - Median String CodeForces - 1144E

You are given two strings ss and tt, both consisting of exactly kk lowercase Latin letters, ss is lexicographically less than tt.

Let's consider list of all strings consisting of exactly kk lowercase Latin letters, lexicographically not less than ss and not greater than tt (including ss and tt) in lexicographical order. For example, for k=2k=2, s=s="az" and t=t="bf" the list will be ["az", "ba", "bb", "bc", "bd", "be", "bf"].

Your task is to print the median (the middle element) of this list. For the example above this will be "bc".

It is guaranteed that there is an odd number of strings lexicographically not less than ss and not greater than tt.

Input

The first line of the input contains one integer kk (1≤k≤2⋅1051≤k≤2⋅105) — the length of strings.

The second line of the input contains one string ss consisting of exactly kk lowercase Latin letters.

The third line of the input contains one string tt consisting of exactly kk lowercase Latin letters.

It is guaranteed that ss is lexicographically less than tt.

It is guaranteed that there is an odd number of strings lexicographically not less than ss and not greater than tt.

Output

Print one string consisting exactly of kk lowercase Latin letters — the median (the middle element) of list of strings of length kk lexicographically not less than ss and not greater than tt.

Examples

Input
2
az
bf
Output
bc
Input
5
afogk
asdji
Output
alvuw
Input
6
nijfvj
tvqhwp
Output
qoztvz
题意:给你两个只含有小写字母的字符串, s和t,保证s的字典序比t小。把s和t看成一个26进制的数,让你输出这两个数的中位数
解法:转换为十进制去做,首先把两个字符串的每一个位上的数值加起来,然后向前进位。然后从头开始遍历加起来的那个数值,如果数值为偶数,那么中位数的这一位就是数值/2,如果是奇数,那么中位数的这一位是/2且向下取整。
并把那个多余的一加到下一位中,(注意上一位的1到下一位是26),最后输出答案即可。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
const int maxn=;
int n;
char s1[maxn],s2[maxn];
int a[maxn],b[maxn];
int ans[maxn];
int id,maxx;
int main()
{
scanf("%d",&n);
scanf("%s",s1);
scanf("%s",s2);
for(int i=;i<n;i++)
{
a[i]=s1[i]-'a'+;
b[i]=s2[i]-'a'+;
}
for(int i=;i<n;i++)
ans[i]=a[i]+b[i];
for(int i=;i<n;i++)
{
if(ans[i]%!=)
ans[i+]+=;
ans[i]=ans[i]/;
}
for(int i=n-;i>=;i--)
{
if(ans[i]>)
{
ans[i]-=;
ans[i-]++;
}
}
for(int i=;i<n;i++)
printf("%c",ans[i]+'a'-);
return ;
}

F - Graph Without Long Directed Paths CodeForces - 1144F

You are given a connected undirected graph consisting of nn vertices and mm edges. There are no self-loops or multiple edges in the given graph.

You have to direct its edges in such a way that the obtained directed graph does not contain any paths of length two or greater (where the length of path is denoted as the number of traversed edges).

Input

The first line contains two integer numbers nn and mm (2≤n≤2⋅1052≤n≤2⋅105, n−1≤m≤2⋅105n−1≤m≤2⋅105) — the number of vertices and edges, respectively.

The following mm lines contain edges: edge ii is given as a pair of vertices uiui, vivi (1≤ui,vi≤n1≤ui,vi≤n, ui≠viui≠vi). There are no multiple edges in the given graph, i. e. for each pair (ui,viui,vi) there are no other pairs (ui,viui,vi) and (vi,uivi,ui) in the list of edges. It is also guaranteed that the given graph is connected (there is a path between any pair of vertex in the given graph).

Output

If it is impossible to direct edges of the given graph in such a way that the obtained directed graph does not contain paths of length at least two, print "NO" in the first line.

Otherwise print "YES" in the first line, and then print any suitable orientation of edges: a binary string (the string consisting only of '0' and '1') of length mm. The ii-th element of this string should be '0' if the ii-th edge of the graph should be directed from uiui to vivi, and '1' otherwise. Edges are numbered in the order they are given in the input.

Example

Input
6 5
1 5
2 1
1 4
3 1
6 1
Output
YES
10100
题意:给定一个无向图,让其把边变成一个有向边,边的方向可以你自己定,but要求最后的图中任何一个路径的长度不能大于等于2。

解法:通过分析我们可以发现,要满足图中的任意一个路径的长度不大于等于2的话,那么对于任意一个节点i,如果它在一个边中做起点,那么就不能在另一个边中做终点。显然一个节点在它连接的所有的边中,只能做起点或者终点。直接dfs 跑染色。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
const int maxn=;
int n,m;
vector<int>G[maxn];
int u[maxn],v[maxn];
int vis[maxn];
bool flag=false;
void dfs(int x,int pre)
{
vis[x]=pre;
int si=G[x].size();
for(int i=;i<si;i++)
{
int to=G[x][i];
if(vis[to])
{
if(pre==vis[to])
{
flag=;
return ;
}
continue;
}
dfs(to,-pre);
}
return ;
}
int main()
{
scanf("%d %d",&n,&m);
for(int i=;i<m;i++)
{
scanf("%d %d",&u[i],&v[i]);
G[u[i]].push_back(v[i]);
G[v[i]].push_back(u[i]);
}
dfs(,);
if(flag)
printf("NO\n");
else
{
printf("YES\n");
for(int i=;i<m;i++)
printf("%d",-vis[u[i]]);
printf("\n");
}
return ;
}

G - Two Merged Sequences CodeForces - 1144G

Two integer sequences existed initially, one of them was strictly increasing, and another one — strictly decreasing.

Strictly increasing sequence is a sequence of integers [x1<x2<⋯<xk][x1<x2<⋯<xk]. And strictly decreasing sequence is a sequence of integers [y1>y2>⋯>yl][y1>y2>⋯>yl]. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

Elements of increasing sequence were inserted between elements of the decreasing one (and, possibly, before its first element and after its last element) without changing the order. For example, sequences [1,3,4][1,3,4] and [10,4,2][10,4,2] can produce the following resulting sequences: [10,1,3,4,2,4][10,1,3,4,2,4], [1,3,4,10,4,2][1,3,4,10,4,2]. The following sequence cannot be the result of these insertions: [1,10,4,4,3,2][1,10,4,4,3,2] because the order of elements in the increasing sequence was changed.

Let the obtained sequence be aa. This sequence aa is given in the input. Your task is to find any two suitable initial sequences. One of them should be strictlyincreasing, and another one — strictly decreasing. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

If there is a contradiction in the input and it is impossible to split the given sequence aa into one increasing sequence and one decreasing sequence, print "NO".

Input

The first line of the input contains one integer nn (1≤n≤2⋅1051≤n≤2⋅105) — the number of elements in aa.

The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤2⋅1050≤ai≤2⋅105), where aiai is the ii-th element of aa.

Output

If there is a contradiction in the input and it is impossible to split the given sequence aa into one increasing sequence and one decreasing sequence, print "NO" in the first line.

Otherwise print "YES" in the first line. In the second line, print a sequence of nnintegers res1,res2,…,resnres1,res2,…,resn, where resiresi should be either 00 or 11 for each ii from 11 to nn. The ii-th element of this sequence should be 00 if the ii-th element of aa belongs to the increasing sequence, and 11 otherwise. Note that the empty sequence and the sequence consisting of one element can be considered as increasing or decreasing.

Examples

Input
9
5 1 3 6 8 2 9 0 10
Output
YES
1 0 0 0 0 1 0 1 0
Input
5
1 2 4 0 2
Output
NO
题意:将一个序列分成两个序列,两个序列中元素的相对顺序保持和原序列不变,使得分出的两个序列一个严格上升,一个严格下降。
解法:对于第 i 个数 , 我们应该分析什么情况可以放入升序什么情况放入降序 ; 最容易的情况就是第 i 个数只能放在特定的一个序列中 , 与都不能放在序列中也就是 NO 的情况 ; 
递增序列肯定希望最后一个数最小,递减序列肯定希望最后一个数最大,然而对于ai要么属于递增序列,要么属于递减序列。
因此比较ai和a(i+1)的大小,若ai>a(i+1),则把ai放到递减序列尾部,否则放到递增序列尾部。 注意一下不符合题意的判定以及相等元素的判定就好了。
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
const int INF=0x3f3f3f3f;
const int maxn=;
int n,m;
int a[maxn],ans[maxn];
int maxx,minn;
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
scanf("%d",&a[i]);
maxx=-INF,minn=INF;
for(int i=;i<=n;i++)
{
if(a[i]<=maxx && a[i]>=minn)
{
printf("NO\n");
return ;
}
else if(a[i]>maxx && a[i]<minn)
{
if(a[i]>=a[i+])
{
minn=a[i];
ans[i]=;
}
else
maxx=a[i];
}
else if(a[i]>maxx)
maxx=a[i];
else
{
minn=a[i];
ans[i]=;
}
}
printf("YES\n");
for(int i=;i<=n;i++)
printf("%d ",ans[i]);
printf("\n");
return ;
}

CF550 DIV3的更多相关文章

  1. Codeforces #550 (Div3) - G.Two Merged Sequences(dp / 贪心)

    Problem  Codeforces #550 (Div3) - G.Two Merged Sequences Time Limit: 2000 mSec Problem Description T ...

  2. codeforces-1144 (div3)

    赛后经验:div3过于简单,以后不做了 A.存在以下情况即为NO 1.存在相同字母 2.最大字母-最小字母 != 字符串长度 #include <map> #include <set ...

  3. 12.27 cf div3 解题报告

    12.27 cf div3 解题报告 wxy.wxy,带上分拉,全场做了个无脑小白 比赛场地 A: T1,跟着模拟就好了 B: sort一遍之后 去除的数一定是a[1]或者a[n] 比较去除谁小就输出 ...

  4. CodeForces 1029E div3

    题目链接 第一道场上自己做出来的E题...虽然是div3,而且是原题... 当时做完ABC,D题没有思路就去怼E了,然后发现貌似原题? 事实上就是原题... 给个原题链接... [HNOI2003]消 ...

  5. CodeForces Round #527 (Div3) B. Teams Forming

    http://codeforces.com/contest/1092/problem/B There are nn students in a university. The number of st ...

  6. 【赛时总结】◇赛时·V◇ Codeforces Round #486 Div3

    ◇赛时·V◇ Codeforces Round #486 Div3 又是一场历史悠久的比赛,老师拉着我回来考古了……为了不抢了后面一些同学的排名,我没有做A题 ◆ 题目&解析 [B题]Subs ...

  7. Codeforces Round #535 (Div. 3) [codeforces div3 难度测评]

    hhhh感觉我真的太久没有接触过OI了 大约是前天听到JK他们约着一起刷codeforces,假期里觉得有些颓废的我忽然也心血来潮来看看题目 今天看codeforces才知道居然有div3了,感觉应该 ...

  8. CodeForces Round#480 div3 第2场

    这次div3比上次多一道, 也加了半小时, 说区分不出1600以上的水平.(我也不清楚). A. Remove Duplicates 题意:给你一个数组,删除这个数组中相同的元素, 并且保留右边的元素 ...

  9. codeforces #579(div3)

    codeforces #579(div3) A. Circle of Students 题意: 给定一个n个学生的编号,学生编号1~n,如果他们能够在不改变顺序的情况下按编号(无论是正序还是逆序,但不 ...

随机推荐

  1. SCUT - 254 - 欧洲爆破 - 概率dp - 状压dp

    https://scut.online/p/254 思路很清晰,写起来很恶心. #include<bits/stdc++.h> using namespace std; #define l ...

  2. 收集一些Unity插件

    MCS Male 系列,人形角色插件,表情+体型 Mecanim Control Mecanim Control is a coding tool made that allow for a wide ...

  3. python int对象的方法

    1.求绝对值 >>> a = -10 >>> a.__abs__() 10 >>> abs(10) 10 2.加法 >>> a ...

  4. spoj NSUBSTR - Substrings【SAM】

    先求个SAM,然后再每个后缀的对应点上标记si[nw]=1,造好SAM之后用吧parent树建出来把si传上去,然后用si[u]更新f[max(u)],最后用j>i的[j]更新f[i] 因为每个 ...

  5. 洛谷 P1589 泥泞路

    题目描述 暴雨过后,FJ的农场到镇上的公路上有一些泥泞路,他有若干块长度为L的木板可以铺在这些泥泞路上,问他至少需要多少块木板,才能把所有的泥泞路覆盖住. 输入输出格式 输入格式: 第一行为正整数n( ...

  6. C. Coconut(2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛)

    额,只是一道签到题,emmm直接代码: #include <cstdio> #include <cstring> #include <algorithm> usin ...

  7. EasyUI 前台开发的好助手

    今天用了下EASY ui 确实经典,前端开发利器啊

  8. vs2010中的ADO控件及绑定控件

    要在项目中添加某一个ActiveX控件,则该ActiveX控件必须要注册.由于VS2010中,并没有自动注册ADO及ADO数据绑定控件(Microsoft ADO Data Control,Micro ...

  9. ui自动化测试的意义与理解

    分层测试的思想 分层测试(有的也叫测试金字塔)是最近几年慢慢流行.火热起来的,也逐渐得到了大家的认可,大家应该已经比较熟悉分层测试的思想了,不太了解的可以自行找一些相应的渠道去补充一下上下文的知识. ...

  10. and or类比c中的 bool?a :b

    a = "heaven" b = "hell" c = True and a or b     print c d = False and a or b     ...