
codeforces
文章平均质量分 71
会划水才能到达彼岸
ACM-ICPC 现役(铜牌) 目前:Codeforces Rating: 2172
展开
-
Codeforces Round #739 (Div. 3) (7/7)
Codeforces Round #739 [Div. 3]A. Dislike of ThreesB. Who's Opposite?C. Infinity TableD. Make a Power of TwoE. Polycarp and String TransformationF1、F2. Nearest Beautiful Number感觉这场的难度区分度挺高的,前面三道题手速题,后面还是有点难度(对我这种小白来说),第一次排进前1000,有点意思~~。A. Dislike of Three原创 2021-08-22 00:20:39 · 291 阅读 · 0 评论 -
常用的C++ STL
常用的C++ STL顺序式容器vector(动态数组)stack(栈)queue(队列)list(双链表)deque(双向队列)priority_queue(优先队列)关联式容器set(集合)multiset(快速查找)map(一对一映射)multimap(一对多映射)顺序式容器vector(动态数组)功能:定义整型数组① vector a; 定义一个动态数组a,自动默认初始化为空② vector a(100); 定义一个动态数组a,有100个为0原创 2021-01-30 23:31:55 · 295 阅读 · 0 评论 -
Codeforces Round #696 (Div. 2) 解题报告
老菜鸡了,还是只过了两道… 5555555555555555还是来水水博客好了,还能加点积分。(其他题待补)菜鸡总结报告A题B题A题题解:B题题解:题目要求有2个① 答案至少有4个因子② 答案的所有因数都要满足,每个因子之间的差值至少为d刚开始自己的思路是对的,素数筛打表。就在自己准备敲代码的时候,翻车,不是应该这样子吗?举一个反例:(刚开始自己就陷入了误区,纠结了半天)如果因子的差值至少是d,那么找到最小正整数a,那么第二个例子就不是[1,3,6,12],这将输出12。这也是4个原创 2021-01-20 04:06:20 · 1459 阅读 · 0 评论 -
Codeforces #690 (Div. 3) 解题报告
Codeforces #690 Div. 3 ABCD 解题报告A. Favorite SequenceB.Last Year's SubstringA. Favorite Sequence题解:给出一串数字,按要求重新排序【左边第一个】 【右边第一个】 【左边第二个】 【右边第二个】 … 以此类推。解法:双指针,判断条件是i < j但是如果总长度是奇数的话,那么最后还要输出 a[n / 2 + 1] 这个数字。详情请看代码: ????????????????#include<原创 2020-12-17 10:39:29 · 234 阅读 · 0 评论 -
Edu Codeforces 98 Div. 2
Educational Codeforces Round 98 Rated for Div. 2A. Robot Program (水题)B. Toy BlocksC. Two Brackets(水题)A. Robot Program (水题)题意:从 (0,0)(0, 0)(0,0) 点走到 (x,y)(x,y)(x,y) 点,通过执行五个命令,希望用尽可能少的命令到达单元格 (x,y)(x,y)(x,y)。命令:向上走一步向左走一步向右走一步向下走一步原地不动这些命令,不能连续执行原创 2020-11-20 01:47:15 · 268 阅读 · 4 评论 -
codeforcs #563 div2
codeforcs #563 div2A. Ehab Fails to Be Thanos(思维)B. Ehab Is an Odd Person(思维)C. Ehab and a Special Coloring Problem(素数表)D. Ehab and the Expected XOR Problem(构造+异或前缀和)A. Ehab Fails to Be Thanos(思维)题意:给定一个长度为2n的数组,问有没有可能通过重新排序,使得前n个元素的和不等于后n个元素的和?输入:第一行包原创 2020-11-08 00:11:52 · 156 阅读 · 0 评论 -
Codeforces #676 (Div. 2) A~D (图文详解)
Codeforces #676 (Div. 2) A~D (图文详解)Codeforces #676 (Div. 2) A. XORwice (思维)Codeforces #676 (Div.2)B.Putting Bricks in the Wall (待更新)Codeforces #676 (Div. 2) C. Palindromifier (思维)Codeforces #676 (Div. 2) D. Hexagons原创 2020-10-24 10:39:45 · 182 阅读 · 0 评论 -
Codeforces #676 (Div. 2) A. XORwice (思维)
Codeforces #676 (Div. 2) A. XORwice (思维)题目链接:https://codeforces.ml/contest/1421/problem/A其实直接就 a ^ b 就可以了至于为什么?请看下图:????????????#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<cmath>#incl原创 2020-10-23 23:28:17 · 156 阅读 · 0 评论 -
Codeforces #676 (Div. 2) D. Hexagons
Codeforces #676 (Div. 2) D. Hexagons题目链接:https://codeforces.ml/contest/1421/problem/D题意:走到目的地,要求消耗最小。第一行输入要输入的例子的个数,第二行输入目的地的坐标(y,x)(个人习惯,横着增加的是x,竖着增加的是y)第三行输入六个方向的消耗求走过的路消耗最少。下面以 (-3, 1) 为例子讲一下过程。从(0, 0) 走到 (-3, 1) 可以通过走 C3C_3C3 + C5C_5C5 或者 C原创 2020-10-23 23:03:55 · 165 阅读 · 0 评论 -
Codeforces #676 (Div. 2) C. Palindromifier (思维)
@[TOC](Codeforces #676 (Div. 2) C. Palindromifier (思维))题目链接:https://codeforces.ml/contest/1421/problem/C题意:给定一个字符串,可以通过L或者R操作,将该字符串变成一个回文字符串。乍一看,好复杂,再细看这句话。It is guaranteed that under these constraints there always is a solution. Also note you do not原创 2020-10-23 21:52:00 · 176 阅读 · 0 评论 -
Codeforces #565 D - Recover it!(数论)
Codeforces #565 D - Recover it! 数论 题意:给出b[n],按照一定的规则变成a[n];题解:原理是:倒推,原本题意是,由a[n]变成b[n];遍历:如果a[n]是质数,那么在b[n]中,保留a[n]并且加上质数表中的第a[n]个质数;如果a[n]是合数,那么在b[n]中,保留a[n]并且加上b[n]的最大除数。然后就倒推 —— 详情请看代码!!!#include<cstdio>#include<iostream>#include&原创 2020-09-29 01:56:47 · 164 阅读 · 0 评论 -
Codeforces #565 Div3 C. Lose it!
Codeforces #565 Div3 C. Lose it!#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<cmath>#include<algorithm> #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)#define ll l原创 2020-09-29 01:56:59 · 457 阅读 · 1 评论 -
Codeforces Div. 3 #565 B. Merge it!
Codeforces Round #565 Div. 3 B. Merge it!题意: 对于一个数列,任意个数自由合并(求和),问最多可以有多少个数(数必须是3倍数,否则不算。)题解: 分别统计 %3 结果为 0 , 1, 2的个数。结束!(上代码,详情请看代码!!!)#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<cmath&g原创 2020-09-28 10:23:02 · 141 阅读 · 0 评论 -
Codeforces Div3 #565 A - Divide it!
Codeforces Div3 #565 A - Divide it!(水题一看就懂)#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<cmath>#include<algorithm> #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)#原创 2020-09-28 10:15:38 · 182 阅读 · 0 评论 -
Codeforces #668 (Div. 2) A. Permutation Forgery(思维水题)
Rating 800 总目录题目链接入口C++代码:#include<iostream>#include<cstdio>using namespace std; int main(){ int t; cin >> t; while(t--) { int n; cin >> n; int a[100010]; for(int i = 0;i <原创 2020-09-18 15:00:55 · 178 阅读 · 0 评论 -
Codeforces #667 (Div. 3) A. Yet Another Two Integers Problem
A. Yet Another Two Integers Problem(水题)题目链接入口 Click here~~题目描述输入a,b两个数,通过a+k或者a-k操作k∈[1,10],将a变成b。输入第一行输入案例个数第二行一次输入 a,ba,ba,b输出输出在n次 a-- 或者 b-- 的操作后,a×b 最小的结果。案例输入案例65 513 4218 41337 420123456789 1000000000100500 9000输出案例032928765原创 2020-09-05 14:10:08 · 942 阅读 · 0 评论 -
Codeforces #667 (Div. 3) B. Minimum Product
Rating 800 总目录题目链接入口题目描述给定5个数,a,b,x,y,na,b,x,y,na,b,x,y,n,要求满足:a≥x,b≥ya≥x,b≥ya≥x,b≥y,做nnn次 a−1a-1a−1 或者 b−1b-1b−1 的操作,使得 a×ba×ba×b 的结果最小。输入第一行输入案例个数第二行一次输入 a,b,x,y,na,b,x,y,na,b,x,y,n输出输出在n次 a−1a-1a−1 或者 b−1b-1b−1 的操作后,a×b 最小的结果。案例输入案例710 10 8原创 2020-09-05 12:11:54 · 313 阅读 · 0 评论 -
Codeforces 9A A. Die Roll(数学+概率 → 水题)
题目链接入口题目描述有三个人 Yakko(♂), Wakko(♂),和 Dot(♀),他们分别想去一个地方。但是他们假期时间不够,三个人只能去同一个地方。通过掷骰子,决定哪个地方。方案是:谁掷的点数大,去谁想去的地方。出于绅士风度,如果Dot掷的点数与他们俩相同,则去Dot想去的地方。现在给出Yakko和Wakko掷骰子的点数 Y,W,求能去Dot想去的地方的概率。输入注意:题目要求只输出一行数据,Yakko和Wakko掷骰子的点数 Y,W输出以不可约分数的形式输出所需的概率,格式为«A/B»,原创 2020-08-23 03:50:48 · 508 阅读 · 0 评论 -
Codeforces 4A A. Watermelon (水)
题目链接入口题目描述一个体积为w(w为整数)的西瓜,要求判断该西瓜的体积能否分为两半,满足这两半体积均为偶数。输入输入整数w表示西瓜体积 (1≤w≤100)(1≤w≤100)(1≤w≤100)输出如果该西瓜的体积能分为两半,且满足这两半体积均为偶数,则输出YES,反之则输出NOExamplesinputCopy8outputCopyYES题解:www 不能 ≤2≤2≤2www 一定为偶数,只有偶数才能拆成两个偶数#include<cstdio>#include原创 2020-08-23 03:24:23 · 1313 阅读 · 0 评论 -
Codeforces #664 (Div. 2) C. Boboniu and Bit Operations(暴力)
C. Boboniu and Bit Operations (暴力)time limit per test: 1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputBoboniu likes bit operations. He wants to play a game with you.Boboniu gives you two sequences of non-negative原创 2020-08-14 02:17:40 · 267 阅读 · 0 评论 -
Codeforces #664 (Div. 2) B. Boboniu Plays Chess(构造)
B. Boboniu Plays Chesstime limit per test:1 secondmemory limit per test:512 megabytesinput:standard inputoutput:standard outputBoboniu likes playing chess with his employees. As we know, no employee can beat the boss in the chess game, so Boboniu has原创 2020-08-14 02:07:04 · 311 阅读 · 0 评论 -
Codeforces #664 (Div. 2) A. Boboniu Likes to Color Balls (思维)
A. Boboniu Likes to Color Ballstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBoboniu gives yourrr red balls,ggg green balls,bbb blue balls,www white balls.He allows you to do the following原创 2020-08-14 01:37:43 · 168 阅读 · 0 评论 -
Codeforces #660 (Div. 2) B. Captain Flint and a Long Voyage
B. Captain Flint and a Long Voyagetime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputCaptain Flint and his crew keep heading to a savage shore of Byteland for several months already, drinking rum原创 2020-08-11 13:57:11 · 173 阅读 · 0 评论 -
Codeforces #663 (Div. 2) C. Cyclic Permutations
C. Cyclic Permutations原题链接:https://codeforces.com/contest/1391/problem/Ctime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputA permutation of length nnn is an array consisting of n distinct integers原创 2020-08-10 00:51:01 · 489 阅读 · 0 评论 -
Codeforces #663 (Div. 2) B. Fix You(思维水题)
B. Fix You原题链接:https://codeforces.com/contest/1391/problem/Btime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputConsider a conveyor belt represented using a grid consisting of n rows and m columns.原创 2020-08-10 00:50:41 · 346 阅读 · 0 评论 -
Codeforces #663 (Div. 2) A. Suborrays
A. Suborrays原题链接:https://codeforces.com/contest/1391/problem/Atime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputA permutation of length nnn is an array consisting of nnn distinct integers from 11原创 2020-08-10 00:50:21 · 489 阅读 · 0 评论 -
Codeforces #662 (Div. 2) C. Pinkie Pie Eats Patty-cakes(二分)
C. Pinkie Pie Eats Patty-cakes (二分)原题链接:https://codeforces.com/contest/1393/problem/Ctime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputPinkie Pie has bought a bag of patty-cakes with different f原创 2020-08-08 15:41:00 · 880 阅读 · 0 评论 -
Codeforces #662 (Div. 2) B. Applejack and Storages
B. Applejack and Storages原题链接:https://codeforces.com/contest/1393/problem/Btime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputThis year in Equestria was a year of plenty, so Applejack has decided原创 2020-08-08 15:37:37 · 271 阅读 · 0 评论 -
Codeforces #662 (Div. 2) A. Rainbow Dash, Fluttershy and Chess Coloring(思维水题)
A. Rainbow Dash, Fluttershy and Chess Coloring(思维水题)原题链接:https://codeforces.com/contest/1393/problem/Atime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputOne evening Rainbow Dash and Fluttershy hav原创 2020-08-08 04:32:35 · 1811 阅读 · 3 评论 -
Codeforces #660 (Div. 2) A
A. Captain Flint and Crew Recruitmenttime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputDespite his bad reputation, Captain Flint is a friendly person (at least, friendly to animals). Now Captain F原创 2020-07-31 18:43:34 · 1065 阅读 · 7 评论