Codeforces Round #436 (Div. 2) 题解864A 864B 864C 864D 864E 864F
1 second
256 megabytes
standard input
standard output
Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card.
Before the game Petya will choose an integer and after that Vasya will choose another integer (different from the number that Petya chose). During the game each player takes all the cards with number he chose. For example, if Petya chose number 5 before the game he will take all cards on which 5 is written and if Vasya chose number 10 before the game he will take all cards on which 10 is written.
The game is considered fair if Petya and Vasya can take all n cards, and the number of cards each player gets is the same.
Determine whether Petya and Vasya can choose integer numbers before the game so that the game is fair.
The first line contains a single integer n (2 ≤ n ≤ 100) — number of cards. It is guaranteed that n is an even number.
The following n lines contain a sequence of integers a1, a2, ..., an (one integer per line, 1 ≤ ai ≤ 100) — numbers written on the n cards.
If it is impossible for Petya and Vasya to choose numbers in such a way that the game will be fair, print "NO" (without quotes) in the first line. In this case you should not print anything more.
In the other case print "YES" (without quotes) in the first line. In the second line print two distinct integers — number that Petya should choose and the number that Vasya should choose to make the game fair. If there are several solutions, print any of them.
4
11
27
27
11
YES
11 27
2
6
6
NO
6
10
20
30
20
10
20
NO
6
1
1
2
2
3
3
NO
In the first example the game will be fair if, for example, Petya chooses number 11, and Vasya chooses number 27. Then the will take all cards — Petya will take cards 1 and 4, and Vasya will take cards 2 and 3. Thus, each of them will take exactly two cards.
In the second example fair game is impossible because the numbers written on the cards are equal, but the numbers that Petya and Vasya should choose should be distinct.
In the third example it is impossible to take all cards. Petya and Vasya can take at most five cards — for example, Petya can choose number 10 and Vasya can choose number 20. But for the game to be fair it is necessary to take 6 cards.
【题目大意】
给你n个数,保证n为偶数,问是否只有两种数且两种数数量相等
【简单题解】
记录每个数出现的次数且最多出现两个数以及两个数的数量即可
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const int INF = 0x3f3f3f3f;
const int MAXN = + ; inline void swap(int &a, int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
} int n,num[MAXN],cnt[MAXN]; int tmp1, tmp2; int main()
{
read(n);
for(register int i = ;i <= n;++ i)
{
read(num[i]);
cnt[num[i]] ++;
}
for(register int i = ;i <= ;++ i)
{
if(cnt[i] > && !tmp1)
{
tmp1 = i;
}
else if(cnt[i] > && !tmp2)
{
tmp2 = i;
}
else if(cnt[i] > && tmp1 && tmp2)
{
printf("NO");
return ;
}
}
if(tmp1 && tmp2 && cnt[tmp1] == cnt[tmp2])
printf("YES\n%d %d", tmp1, tmp2);
else
printf("NO");
return ;
}
A
考场上慌了,没判两个数是否相等,被hack了,最后1min改完交上。。但是200分没了T.不然就能进rank70了(唔)
2 seconds
256 megabytes
standard input
standard output
Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters.
Let A be a set of positions in the string. Let's call it pretty if following conditions are met:
- letters on positions from A in the string are all distinct and lowercase;
- there are no uppercase letters in the string which are situated between positions from A (i.e. there is no such j that s[j] is an uppercase letter, and a1 < j < a2 for some a1 and a2 from A).
Write a program that will determine the maximum number of elements in a pretty set of positions.
The first line contains a single integer n (1 ≤ n ≤ 200) — length of string s.
The second line contains a string s consisting of lowercase and uppercase Latin letters.
Print maximum number of elements in pretty set of positions for string s.
11
aaaaBaabAbA
2
12
zACaAbbaazzC
3
3
ABC
0
In the first example the desired positions might be 6 and 8 or 7 and 8. Positions 6 and 7 contain letters 'a', position 8 contains letter 'b'. The pair of positions 1 and 8 is not suitable because there is an uppercase letter 'B' between these position.
In the second example desired positions can be 7, 8 and 11. There are other ways to choose pretty set consisting of three elements.
In the third example the given string s does not contain any lowercase letters, so the answer is 0.
【题目大意】
给你一个字符串,从中选择一些连续或不连续均可的字符,使得这些字符全是小写字符,且不连续的字符之间包含的字符不能有大写字幕
【简单题解】
枚举左端点,向右扫,记录一下出现过哪些字符和不重复字符的数量,所有左区间答案取max
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const int INF = 0x3f3f3f3f;
const int MAXN = + ; inline void swap(int &a, int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
} int n, b[], ans;
char s[MAXN]; int main()
{
read(n);
scanf("%s", s + );
int tmp = ;
for(register int i = ;i <= n;++ i)
{
if(s[i] >= 'A' && s[i] <= 'Z')continue;
memset(b, , sizeof(b));
tmp = ;
for(register int j = i;j <= n;++ j)
{
if(s[j] >= 'A' && s[j] <= 'Z')break;
if(!b[s[j] - 'a'])
b[s[j] - 'a'] = , ++ tmp;
}
ans = max(ans, tmp);
}
printf("%d", ans);
return ;
}
B
2 seconds
256 megabytes
standard input
standard output
A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0, it reaches the point x = a, immediately turns back and then moves to the point x = 0. After returning to the point x = 0 it immediately goes back to the point x = a and so on. Thus, the bus moves from x = 0 to x = a and back. Moving from the point x = 0 to x = a or from the point x = a to x = 0 is called a bus journey. In total, the bus must make k journeys.
The petrol tank of the bus can hold b liters of gasoline. To pass a single unit of distance the bus needs to spend exactly one liter of gasoline. The bus starts its first journey with a full petrol tank.
There is a gas station in point x = f. This point is between points x = 0 and x = a. There are no other gas stations on the bus route. While passing by a gas station in either direction the bus can stop and completely refuel its tank. Thus, after stopping to refuel the tank will contain b liters of gasoline.
What is the minimum number of times the bus needs to refuel at the point x = f to make k journeys? The first journey starts in the point x = 0.
The first line contains four integers a, b, f, k (0 < f < a ≤ 106, 1 ≤ b ≤ 109, 1 ≤ k ≤ 104) — the endpoint of the first bus journey, the capacity of the fuel tank of the bus, the point where the gas station is located, and the required number of journeys.
Print the minimum number of times the bus needs to refuel to make k journeys. If it is impossible for the bus to make k journeys, print -1.
6 9 2 4
4
6 10 2 4
2
6 5 4 3
-1
In the first example the bus needs to refuel during each journey.
In the second example the bus can pass 10 units of distance without refueling. So the bus makes the whole first journey, passes 4 units of the distance of the second journey and arrives at the point with the gas station. Then it can refuel its tank, finish the second journey and pass 2 units of distance from the third journey. In this case, it will again arrive at the point with the gas station. Further, he can refill the tank up to 10 liters to finish the third journey and ride all the way of the fourth journey. At the end of the journey the tank will be empty.
In the third example the bus can not make all 3 journeys because if it refuels during the second journey, the tanks will contain only 5 liters of gasoline, but the bus needs to pass 8 units of distance until next refueling.
【题目大意】
一个数轴,从0开始,a是终点。汽车从0走到a或者从a走到0叫做一个旅程。每走一个单位长度消耗一个汽油,初始有b点汽油。在f处有一个
加油站,每次可以把油量变成b。问走k次旅程,最少需要加油多少次
【简单题解】
一半一半的模拟,具体细节参见代码
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const int INF = 0x3f3f3f3f; inline void swap(int &a, int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
} int a,b,f,k,ans; int main()
{
read(a), read(b), read(f), read(k);
int tmp = b;
while(k)
{
tmp -= f;
if(tmp < )
{
printf("-1");
return ;
}
if(tmp < * (a - f) && k > )
{
tmp = b;
++ ans;
}
else if(tmp < (a - f))
{
++ ans;
tmp = b;
}
tmp -= (a - f);
if(tmp < )
{
printf("-1");
return ;
}
-- k;
if(!k)
{
printf("%d", ans);
return ;
} tmp -= (a - f);
if(tmp < )
{
printf("-1");
return ;
}
if(tmp < * f && k > )
{
tmp = b;
++ ans;
}
else if(tmp < f)
{
tmp = b;
++ ans;
} tmp -= f;
if(tmp < )
{
printf("-1");
return ;
}
-- k;
}
printf("%d", ans);
return ;
}
C
2 seconds
256 megabytes
standard input
standard output
Ivan has an array consisting of n elements. Each of the elements is an integer from 1 to n.
Recently Ivan learned about permutations and their lexicographical order. Now he wants to change (replace) minimum number of elements in his array in such a way that his array becomes a permutation (i.e. each of the integers from 1 to n was encountered in his array exactly once). If there are multiple ways to do it he wants to find the lexicographically minimal permutation among them.
Thus minimizing the number of changes has the first priority, lexicographical minimizing has the second priority.
In order to determine which of the two permutations is lexicographically smaller, we compare their first elements. If they are equal — compare the second, and so on. If we have two permutations x and y, then x is lexicographically smaller if xi < yi, where i is the first index in which the permutations x and y differ.
Determine the array Ivan will obtain after performing all the changes.
The first line contains an single integer n (2 ≤ n ≤ 200 000) — the number of elements in Ivan's array.
The second line contains a sequence of integers a1, a2, ..., an (1 ≤ ai ≤ n) — the description of Ivan's array.
In the first line print q — the minimum number of elements that need to be changed in Ivan's array in order to make his array a permutation. In the second line, print the lexicographically minimal permutation which can be obtained from array with q changes.
4
3 2 2 3
2
1 2 4 3
6
4 5 6 3 2 1
0
4 5 6 3 2 1
10
6 8 4 6 7 1 6 3 4 5
3
2 8 4 6 7 1 9 3 10 5
In the first example Ivan needs to replace number three in position 1 with number one, and number two in position 3 with number four. Then he will get a permutation [1, 2, 4, 3] with only two changed numbers — this permutation is lexicographically minimal among all suitable.
In the second example Ivan does not need to change anything because his array already is a permutation
【题目大意】
给你n个数组成的数列,让你替换其中t个数,使得这个数列是一个关于n的排列(即n个数是1,2,3...n,顺序任意)
【简单题解】
首先记录哪一些数还没有出现过,并记录每个数出现了多少次,从前往后扫
扫到某个数字出现次数>1 ,如果他的字典序比最小的未出,那么
就不替换,且下一次扫到这个数字一定要替换他;否则就用p
替换掉他,并继续增大p使其变为第一个未出现的数字。
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const int INF = 0x3f3f3f3f;
const int MAXN = + ; inline void swap(int &a, int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
} int n, num[MAXN], b[MAXN], bb[MAXN], flag[MAXN], ans; int main()
{
read(n);
for(register int i = ;i <= n;++ i)
{
read(num[i]);
if(num[i] <= n)
b[num[i]] = , ++bb[num[i]];
}
register int p = ;
while(b[p]) ++ p;
for(register int i = ;i <= n;++ i)
{
if(flag[num[i]])
{
-- bb[num[i]];
num[i] = p;
++ ans;
b[p] = ;
while(b[p]) ++ p;
}
else if(bb[num[i]] > )
{
-- bb[num[i]];
if(num[i] < p)
{
flag[num[i]] = ;
continue;
}
num[i] = p;
++ ans;
b[p] = ;
while(b[p]) ++ p;
}
}
printf("%d\n", ans);
for(register int i = ;i <= n;++ i)
printf("%d ", num[i]);
return ;
}
D
2 seconds
256 megabytes
standard input
standard output
Polycarp is in really serious trouble — his house is on fire! It's time to save the most valuable items. Polycarp estimated that it would take ti seconds to save i-th item. In addition, for each item, he estimated the value of di — the moment after which the item i will be completely burned and will no longer be valuable for him at all. In particular, if ti ≥ di, then i-th item cannot be saved.
Given the values pi for each of the items, find a set of items that Polycarp can save such that the total value of this items is maximum possible. Polycarp saves the items one after another. For example, if he takes item a first, and then item b, then the item a will be saved in ta seconds, and the item b — in ta + tb seconds after fire started.
The first line contains a single integer n (1 ≤ n ≤ 100) — the number of items in Polycarp's house.
Each of the following n lines contains three integers ti, di, pi (1 ≤ ti ≤ 20, 1 ≤ di ≤ 2 000, 1 ≤ pi ≤ 20) — the time needed to save the item i, the time after which the item i will burn completely and the value of item i.
In the first line print the maximum possible total value of the set of saved items. In the second line print one integer m — the number of items in the desired set. In the third line print m distinct integers — numbers of the saved items in the order Polycarp saves them. Items are 1-indexed in the same order in which they appear in the input. If there are several answers, print any of them.
3
3 7 4
2 6 5
3 7 6
11
2
2 3
2
5 6 1
3 3 5
1
1
1
In the first example Polycarp will have time to save any two items, but in order to maximize the total value of the saved items, he must save the second and the third item. For example, he can firstly save the third item in 3 seconds, and then save the second item in another 2 seconds. Thus, the total value of the saved items will be 6 + 5 = 11.
In the second example Polycarp can save only the first item, since even if he immediately starts saving the second item, he can save it in 3 seconds, but this item will already be completely burned by this time.
【题目大意】
有一些东西在火场里。拯救他需要时间t,他在时间d会被焚烧完(拯救过程也计时)。如果能救出来,会获得
【简单题解】
一开始想的裸Dp:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const int INF = 0x3f3f3f3f;
const int MAXN = + ;
const int MAXD = + ; inline void swap(int &a, int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
} int n,cnt[MAXN],dp[MAXN][MAXD],t[MAXN],p[MAXN],d[MAXN],ma, fangan1[MAXN][MAXD], fangan2[MAXN][MAXD], flag[MAXN][MAXD], ans[MAXN], tot; void dfs(int num1, int num2)
{
if(num1 == - || num2 == - || num1 == || num2 == )return;
if(flag[num1][num2])
ans[++tot] = num1;
dfs(fangan1[num1][num2], fangan2[num1][num2]);
} bool cmp(int a, int b)
{
return d[a] < d[b];
} int main()
{
read(n);
for(register int i = ;i <= n;++ i)
read(t[i]), read(d[i]), read(p[i]), ma = max(ma, d[i]), cnt[i] = i;
memset(fangan1, -, sizeof(fangan1));
memset(fangan2, -, sizeof(fangan2));
memset(flag, -, sizeof(flag));
std::sort(cnt + , cnt + + n, cmp);
for(register int ii = ;ii <= n;++ ii)
for(register int j = ;j <= ma;++ j)
{
dp[cnt[ii]][j] = dp[cnt[ii - ]][j];
fangan1[cnt[ii]][j] = cnt[ii - ];
fangan2[cnt[ii]][j] = j;
flag[cnt[ii]][j] = ;
for(register int k = ;k <= ma;++ k)
{
if(k + t[cnt[ii]] > j || k + t[cnt[ii]] >= d[cnt[ii]])continue;
if(dp[cnt[ii]][j] < dp[cnt[ii - ]][k] + p[cnt[ii]])
{
dp[cnt[ii]][j] = dp[cnt[ii - ]][k] + p[cnt[ii]];
fangan1[cnt[ii]][j] = cnt[ii - ];
fangan2[cnt[ii]][j] = k;
flag[cnt[ii]][j] = ;
}
}
}
printf("%d\n", dp[cnt[n]][ma]);
dfs(cnt[n], ma);
printf("%d\n", tot);
for(register int i = tot;i >= ;-- i)
printf("%d ", ans[i]);
return ;
}
E
“
F题读了十分钟读完题:woc这题意什么鬼。。
hack(害)人去了
没hack到反被人hackA题
最后一分钟改完
废了200分
T.T
最终rank80+
上次还是rank800+。。
人的一生啊,不但要有个人的奋斗,还要考虑到历史的进程。。。
”
2 seconds
256 megabytes
standard input
standard output
There are n cities in Berland. Some pairs of them are connected with m directed roads. One can use only these roads to move from one city to another. There are no roads that connect a city to itself. For each pair of cities (x, y) there is at most one road from x to y.
A path from city s to city t is a sequence of cities p1, p2, ... , pk, where p1 = s, pk = t, and there is a road from city pi to city pi + 1 for each i from 1 to k - 1. The path can pass multiple times through each city except t. It can't pass through t more than once.
A path p from s to t is ideal if it is the lexicographically minimal such path. In other words, p is ideal path from s to t if for any other path q from s to t pi < qi, where i is the minimum integer such that pi ≠ qi.
There is a tourist agency in the country that offers q unusual excursions: the j-th excursion starts at city sj and ends in city tj.
For each pair sj, tj help the agency to study the ideal path from sj to tj. Note that it is possible that there is no ideal path from sj to tj. This is possible due to two reasons:
- there is no path from sj to tj;
- there are paths from sj to tj, but for every such path p there is another path q from sj to tj, such that pi > qi, where i is the minimum integer for which pi ≠ qi.
The agency would like to know for the ideal path from sj to tj the kj-th city in that path (on the way from sj to tj).
For each triple sj, tj, kj (1 ≤ j ≤ q) find if there is an ideal path from sj to tj and print the kj-th city in that path, if there is any.
The first line contains three integers n, m and q (2 ≤ n ≤ 3000,0 ≤ m ≤ 3000, 1 ≤ q ≤ 4·105) — the number of cities, the number of roads and the number of excursions.
Each of the next m lines contains two integers xi and yi (1 ≤ xi, yi ≤ n, xi ≠ yi), denoting that the i-th road goes from city xi to city yi. All roads are one-directional. There can't be more than one road in each direction between two cities.
Each of the next q lines contains three integers sj, tj and kj (1 ≤ sj, tj ≤ n, sj ≠ tj, 1 ≤ kj ≤ 3000).
In the j-th line print the city that is the kj-th in the ideal path from sj to tj. If there is no ideal path from sj to tj, or the integer kj is greater than the length of this path, print the string '-1' (without quotes) in the j-th line.
7 7 5
1 2
2 3
1 3
3 4
4 5
5 3
4 6
1 4 2
2 6 1
1 7 3
1 3 2
1 3 5
2
-1
-1
2
-1
【题目大意】
有一张n个点m条边的有向图和q次询问每次询问包含s,t,k,要你输出字典序最小且只能经过一次t(其他点可
经过若干次)的路径p1,p2,p3...pa,p1 = s, pa = t中pk是多少
【简单题解】
考虑倍增。
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) const short int MAXN = + ;
const short int MAXLOG = ;
const short int INF = 0x3f3f; inline void swap(short int &a, short int &b)
{
int tmp = a;a = b;b = tmp;
} inline void read(short int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
}
inline void read(int &x)
{
x = ;char ch = getchar(), c = ch;
while(ch < '' || ch > '')c = ch, ch = getchar();
while(ch <= '' && ch >= '')x = x * + ch - '', ch = getchar();
if(c == '-')x = -x;
}
struct Edge
{
short int v,nxt;
Edge(short int _v, short int _nxt){v = _v;nxt = _nxt;}
Edge(){}
}edge[MAXN];
short int head[MAXN], cnt;
inline void insert(short int a, short int b)
{
edge[++cnt] = Edge(b,head[a]);
head[a] = cnt;
} short int n,m,p[MAXLOG][MAXN][MAXN],tmp1,tmp2;
int q;
bool reach[MAXN][MAXN]; void dfs(short int u, short int v)
{
reach[u][v] = ;
for(register short int pos = head[v];pos;pos = edge[pos].nxt)
{
short int vv =edge[pos].v;
if(!reach[u][vv])dfs(u, vv);
}
} int main()
{
read(n), read(m), read(q);
for(register short int i = ;i <= m; ++ i)
{
read(tmp1), read(tmp2);
insert(tmp1, tmp2);
}
for(register short int i = ;i <= n;++ i)
dfs(i,i);
for(register short int i = ;i <= n;++ i)
for(short int j = ;j <= n;++ j)
{
p[][i][j] = INF;
if(i == j)p[][i][j] = ;
else
{
for(short int pos = head[i];pos;pos = edge[pos].nxt)
{
short int v = edge[pos].v;
if(reach[v][j] && v < p[][i][j])p[][i][j] = v;
}
}
if(p[][i][j] == INF)p[][i][j] = ;
}
for(short int i = ;i < MAXLOG;++ i)
for(register short int j = ;j <= n;++ j)
for(register short int k = ;k <= n;++ k)
p[i][j][k] = p[i - ][p[i - ][j][k]][k];
short int s,t,k;
for(;q;--q)
{
read(s), read(t), read(k);
-- k;
short int ans;
if(p[MAXLOG - ][s][t])ans = -;
else if(!p[][s][t])ans = -;
else
{
ans = s;
for(register short int i = MAXLOG - ;i >= ;-- i)
if(k & ( << i))
ans = p[i][ans][t];
}
if(!ans) ans = -;
printf("%d\n", ans);
}
return ;
}
F
Codeforces Round #436 (Div. 2) 题解864A 864B 864C 864D 864E 864F的更多相关文章
- Codeforces Round #436 (Div. 2)【A、B、C、D、E】
Codeforces Round #436 (Div. 2) 敲出一身冷汗...感觉自己宛如智障:( codeforces 864 A. Fair Game[水] 题意:已知n为偶数,有n张卡片,每张 ...
- Codeforces Round #182 (Div. 1)题解【ABCD】
Codeforces Round #182 (Div. 1)题解 A题:Yaroslav and Sequence1 题意: 给你\(2*n+1\)个元素,你每次可以进行无数种操作,每次操作必须选择其 ...
- Codeforces Round #608 (Div. 2) 题解
目录 Codeforces Round #608 (Div. 2) 题解 前言 A. Suits 题意 做法 程序 B. Blocks 题意 做法 程序 C. Shawarma Tent 题意 做法 ...
- Codeforces Round #525 (Div. 2)题解
Codeforces Round #525 (Div. 2)题解 题解 CF1088A [Ehab and another construction problem] 依据题意枚举即可 # inclu ...
- Codeforces Round #528 (Div. 2)题解
Codeforces Round #528 (Div. 2)题解 A. Right-Left Cipher 很明显这道题按题意逆序解码即可 Code: # include <bits/stdc+ ...
- Codeforces Round #466 (Div. 2) 题解940A 940B 940C 940D 940E 940F
Codeforces Round #466 (Div. 2) 题解 A.Points on the line 题目大意: 给你一个数列,定义数列的权值为最大值减去最小值,问最少删除几个数,使得数列的权 ...
- Codeforces Round #677 (Div. 3) 题解
Codeforces Round #677 (Div. 3) 题解 A. Boring Apartments 题目 题解 简单签到题,直接数,小于这个数的\(+10\). 代码 #include &l ...
- Codeforces Round #665 (Div. 2) 题解
Codeforces Round #665 (Div. 2) 题解 写得有点晚了,估计都官方题解看完切掉了,没人看我的了qaq. 目录 Codeforces Round #665 (Div. 2) 题 ...
- Codeforces Round #160 (Div. 1) 题解【ABCD】
Codeforces Round #160 (Div. 1) A - Maxim and Discounts 题意 给你n个折扣,m个物品,每个折扣都可以使用无限次,每次你使用第i个折扣的时候,你必须 ...
随机推荐
- Cordova 常用命令及插件
安装 cordova: npm install -g cordova 创建应用程序 cordova create hello com.example.hello HelloWorld 添加平台 co ...
- input 的 placeholder 样式修改
input::-webkit-input-placeholder{ color:#999999; } input::-moz-placeholder{ /* Mozilla Firefox 19+ * ...
- 使用async读取异步数据
使用传统方式读取异步数据 const fs = require('fs') fs.readFile('readme.txt', function (err, data) { console.log(d ...
- Netty TCP粘包/拆包问题《一》
1.使用LineBasedFrameDecoder,StringDecoder解析器进行解决TCP粘包/拆包问题 2.代码搞起: TimeClient:客户端 /* * Copyright 2013- ...
- 跟我一起学koa之在koa中使用mongoose(四)
第一步安装mongoose,创建数据库文件夹 第二步引入mongoose,连接数据库 第三步运行项目 这个报错 只需要将es6写法变成es5写法即可 我们连接数据库,并且以post请求的方式插入数据 ...
- idea永久使用本地的maven设置
1.要想是永久的,就选择other settings
- linux php5.4安装phalcon
PHP版本5.6以上,安装可参考.https://blog.csdn.net/happysdh/article/details/51450654 在phalcon3.0以后就不支持php5.4了. 要 ...
- Linux下IP修改后重启服务器 oralce 出错(监听无法启动)
针对linux下修改IP导致的Oracle不能启动问题的解决 主要修改/etc/hosts配置文件.修改前配置: # Do not remove the following line, or vari ...
- 线段树区间更新+区间求和模板(数组实现)洛谷p3372,p3373
模板题目1:https://www.luogu.org/problemnew/show/P3372 懒惰标记讲解:https://www.cnblogs.com/wushengyang/p/11194 ...
- javascript date utc
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/huangbin10025/article/details/37503465 近期在使用highsto ...