codeforces
Star77777
信息学
展开
-
Educational Codeforces Round 44 (Rated for Div. 2) A. Chess Placing
A. Chess Placingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a chessboard of size 1 × n. It is guaranteed that n is even. The ches...原创 2018-05-28 17:21:43 · 235 阅读 · 0 评论 -
Codeforces Round #514 (Div. 2) C - Sequence Transformation
推规律#include <bits/stdc++.h>using namespace std;#define ll long longconst int maxn = 1e3+5;int n, m, k; int main(){ scanf("%d", &n); int cnt = 0, ans = n, d = 1, sum = 0; while ...原创 2018-10-08 23:05:55 · 232 阅读 · 0 评论 -
Codeforces Round #500 (Div. 2) [based on EJOI] C - Photo of The Sky
http://codeforces.com/contest/1013/problem/C题意:给你2*n个数,让你把其分为两组,一组为x坐标集合,一组为y坐标,将其进行组合为(x,y)坐标,使得所有坐标被一矩形包含,并是该矩形面积最小,输出面积思路:先排序,面积分两种情况,一种是(a[2 * n - 1] - a[n]) * (a[n - 1] - a[0]),另一种(a[2 * n - ...原创 2018-11-16 14:50:44 · 261 阅读 · 0 评论 -
Codeforces Round #501 (Div. 3) A - Points in Segments
http://codeforces.com/contest/1015/problem/A题意:n个区间,m表示1-m个数给你n个区间,删除l-r之间的数,最后输出没有被删掉的个数及所有的数思路:暴力去删,特判0#include <cstdio>#include <cstring>#include <iostream>#include &l...原创 2018-11-16 15:52:02 · 181 阅读 · 0 评论 -
Codeforces Round #501 (Div. 3) B. Obtaining the String
http://codeforces.com/contest/1015/problem/B题意:两个字符串a和b,a变成b的字母变换规则为只能交换ai和ai+1,最少交换字数变成b,输出每次交换的坐标位置思路:类似冒泡排序,在找到一个ab不相同的字符时从当前位置开始交换,直到此处字符相同 #include <iostream>#include <algorith...原创 2018-11-16 16:52:56 · 198 阅读 · 0 评论 -
Codeforces Round #501 (Div. 3) C. Songs Compression
http://codeforces.com/contest/1015/problem/C题意:输入n和m,m为存储空间,接下来n行a和b, a大于b每一行的a可以压缩为b的大小,求最少只需要压缩几个,使得m可以存下所有数据如果全部压缩都不满足,就输出-1思路:存下a和b的差值算出最大的和和最小的和,如果最小和大于m,就输出-1,再用sort根据差值从大到小排序让最大和依...原创 2018-11-16 16:59:12 · 217 阅读 · 0 评论 -
Codeforces Round #501 (Div. 3) D. Walking Between Houses
http://codeforces.com/contest/1015/problem/D题意:有n个房子排成一列,编号为1~n,起初你在第1个房子里,现在你要进行k次移动,每次移动一都可以从一个房子i移动到另外一个其他的房子j里(i != j),移动的距离为|j - i|。问你进过k次移动后,移动的总和可以刚好是s吗?若可以则输出YES并依次输出每次到达的房子的编号,否则输出NO。思路:每...原创 2018-11-16 17:03:25 · 318 阅读 · 0 评论 -
Codeforces Round #500 (Div. 2) [based on EJOI] B - And
http://codeforces.com/contest/1013/problem/B题意:给出一个数x和n个数,问这n个数能否通过与x进行&操作出现两个相同的数若能输出最短的变化次数有这几种情况:0次:n个数中原本就有相同的数1次:一个数通过一次变化变成了另一个数2次:有两个原本不同的数通过各一次变换变成了同一个数无解:不论如何变换不会出现相同的数#i...原创 2018-11-16 17:09:18 · 237 阅读 · 0 评论 -
Educational Codeforces Round 48 (Rated for Div. 2) A. Death Note
http://codeforces.com/contest/1016/problem/AA. Death Notetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou received a notebo...原创 2018-11-16 17:19:38 · 343 阅读 · 0 评论 -
Educational Codeforces Round 48 (Rated for Div. 2) B. Segment Occurrences
http://codeforces.com/contest/1016/problem/B题意:给定两个字符串,若干次询问,问在询问区间内,a中有多少个b(也可用kmp写)打表#include <bits/stdc++.h> using namespace std; int a[1100];int main(){ int n,m,k,q,l,r,ans...原创 2018-11-16 17:24:37 · 282 阅读 · 0 评论 -
Codeforces Round #502 Div. 1 + Div. 2 A. The Rank
http://codeforces.com/contest/1017/problem/A题意:每个人有4门学科,给出n个人的分数,小明的分数是第一个给出的,问小明的总分排名第几思路:水题,求和排序即可。#include<cstdio>#include<iostream>#include<string>#include<cstring&g...原创 2018-11-16 17:32:54 · 176 阅读 · 0 评论 -
Codeforces Round #514 (Div. 2) B - Forgery
遍历所有左上角##include <bits/stdc++.h>using namespace std;#define ll long longconst int maxn = 1e3+5;int n, m, k; char mapp[maxn][maxn];int vis[maxn][maxn];bool f(int i, int j) { if (mapp...原创 2018-10-08 23:04:04 · 190 阅读 · 0 评论 -
Codeforces Round #514 (Div. 2) A. Cashier
所有空闲时间除以休息时间累加#include <bits/stdc++.h>using namespace std;#define ll long longconst int maxn = 1e5+5;int n, m, k;int st, ti;int main(){ int ans = 0, ttime = 0; scanf("%d%d%d", &...原创 2018-10-08 23:00:58 · 190 阅读 · 0 评论 -
Educational Codeforces Round 44 (Rated for Div. 2) B. Switches and Lamps
B. Switches and Lampstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n switches and m lamps. The i-th switch turns on some subset of...原创 2018-05-28 17:29:07 · 238 阅读 · 0 评论 -
Codeforces Round #442 (Div. 2) C - Slava and tanks
C. Slava and tankstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSlava plays his favorite game "Peace Lig原创 2017-10-25 07:13:29 · 540 阅读 · 0 评论 -
Codeforces Round #442 (Div. 2) B - Nikita and string
B. Nikita and stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Nikita found the string contai原创 2017-10-25 06:58:41 · 421 阅读 · 0 评论 -
Codeforces Round #442 (Div. 2) A Alex and broken contest
A. Alex and broken contesttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex was creating a cont原创 2017-10-25 06:53:30 · 651 阅读 · 0 评论 -
Codeforces Round #441 div2 C. Classroom Watch
C. Classroom Watchtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputEighth-grader Vova is on duty today in th原创 2017-10-17 14:07:30 · 358 阅读 · 0 评论 -
Codeforces Round #441 div2 B. Divisiblity of Differences
B. Divisiblity of Differencestime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a multiset of n原创 2017-10-17 14:06:17 · 392 阅读 · 0 评论 -
Codeforces Round #441 div2 A. Trip For Meal
A. Trip For Mealtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputWinnie-the-Pooh likes honey very much! That is why he decided to visit his friends....原创 2017-10-17 13:34:26 · 450 阅读 · 0 评论 -
Codeforces Round #440 div2 C. Maximum splitting
C. Maximum splittingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given several queries. In the原创 2017-10-16 07:53:52 · 395 阅读 · 0 评论 -
Codeforces Round #440 div2 A. Search for Pretty Integers
A. Search for Pretty Integerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two lists of non原创 2017-10-16 07:47:04 · 477 阅读 · 0 评论 -
Codeforces Round #440 div2 B Maximum of Maximums of Minimums
B. Maximum of Maximums of Minimumstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1原创 2017-10-16 07:32:54 · 384 阅读 · 1 评论 -
Codeforces Round #502 Div. 1 + Div. 2 B. The Bits
http://codeforces.com/contest/1017/problem/B题目大意:给出2个二进制的串(数),可以交换第一个串的2个位置,求有多少种交换可以让交换后的第一个串与第二个串异或结果与之前的不同(相同就不算)思路:数据范围为10^5,这个二进制数位数最大10^5位,最大值化为十进制2^10^5,不可能枚举第一个样例:1->4 3->2/4/5...原创 2018-11-17 20:16:36 · 260 阅读 · 0 评论