竞赛题目
文章平均质量分 54
一些算法竞赛题目,牛客、codeforces、天梯赛、蓝桥等
默_silence
记得一定要努力,不然往后余生,做饭是你,洗衣是你,做家务是你……是你是你还是你
展开
-
acwing 第 31 场周赛
题目传送门链接:https://www.acwing.com/activity/content/competition/problem_list/86/4200. 简单问题#include <bits/stdc++.h>using namespace std;int main(void){ int t, p = 1001, a, b; for (int i = 0; i < 4; i++) { cin >> t; p原创 2021-12-25 21:10:10 · 421 阅读 · 0 评论 -
acwing 第30场周赛
题目传送门链接:https://www.acwing.com/activity/content/85/4197. 吃苹果#include <bits/stdc++.h>using namespace std;int main(void){ int n, h, t, res = 0; cin >> n >> h; for (int i = 0; i < n; i++) { cin >> t;原创 2021-12-19 15:22:25 · 400 阅读 · 0 评论 -
Codeforces Round #731 (Div. 3)
Damn English Questions!!It gives me a headache.A Shortest Path with Obstacle#include <bits/stdc++.h>using namespace std;const int N = 1e5 + 5, INF = 0x3f3f3f3f;typedef long long ll;typedef pair<int, int> PII;#define debug(a) cout <&l原创 2021-07-11 15:00:03 · 198 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Xuzhou 2019
文章目录A. Who is better?B. so easyC. Buy WatermelonD. CarneginonA. Who is better?硕哥的代码#include <bits/stdc++.h>using namespace std;typedef long long LL;map<LL,int> mp;LL exgcd(LL...原创 2019-09-08 10:44:43 · 244 阅读 · 0 评论 -
2019 ICPC国际大学生程序设计竞赛中国邀请赛(南昌)暨国际丝绸之路程序设计竞赛
链接:https://www.jisuanke.com/contest/2290?view=challenges原创 2019-04-20 16:25:22 · 2098 阅读 · 0 评论 -
2019ccpc网络赛(部分)
文章目录1001 \^&\^1006 Shuffle Card1007 Windows Of CCPC1001 ^&^学姐的代码#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){ ll a, b; int n; scanf(...原创 2019-08-24 13:07:18 · 1374 阅读 · 0 评论 -
ccpc热身赛
文章目录A - SpreadsheetsInputOutputExamplesInputOutputC - Longest Regular Bracket SequenceInputOutputExamplesInputOutputInputOutputA - SpreadsheetsCodeForces - 1BIn the popular spreadsheets systems (fo...原创 2019-08-24 11:32:42 · 433 阅读 · 0 评论 -
2018CCPC网络赛(部分)
文章目录A - Buy and ResellInputOutputSample InputSample OutputHintD - Find IntegerInputOutputSample InputSample OutputA - Buy and ResellThe Power Cube is used as a stash of Exotic Power. There are n cit...原创 2019-08-20 22:31:29 · 454 阅读 · 0 评论 -
ccpc训练营练习题(1)
FOJ有奖月赛-2014年11月文章目录C - ytaaaInputOutputSample InputSample OutputG - 快来买肉松饼InputOutputSample InputSample OutputH - 水题InputOutputSample InputSample OutputC - ytaaaYtaaa作为一名特工执行了无数困难的任务,这一次ytaaa收到命令,...原创 2019-08-18 20:19:57 · 1553 阅读 · 0 评论 -
2020年天梯赛题目
文章目录L1-1 嫑废话上代码 (5分)L1-2 猫是液体 (5分)L1-3 洛希极限 (10分)L1-4 调和平均 (10分)L1-5 胎压监测 (15分)L1-6 吃火锅 (15分)L1-7 前世档案 (20分)L1-8 刮刮彩票 (20分)L2-1 简单计算器 (25分)L1-1 嫑废话上代码 (5分)#include <bits/stdc++.h>using namespace std;int main(void){ puts("Talk is cheap. Show me原创 2021-01-11 10:45:13 · 1904 阅读 · 0 评论 -
2020天梯赛模拟赛
文章目录L1-1 新世界 (5分)L1-2 打折 (5分)L1-3 奇偶分家 (10分)L1-4 冠军魔术 (10分)L1-5 L1-6 检查密码 (15分)L1-7 谷歌的招聘 (20分)L1-8 阅览室 (20分)L2-1 出栈序列的合法性 (25分)L2-2 抢红包 (25分)L2-3 二叉搜索树的2层结点统计 (25分)L1-6 检查密码 (15分)密码可能会有空字符,所以需要读入一行#include <bits/stdc++.h>using namespace std;原创 2020-11-18 11:02:09 · 1660 阅读 · 4 评论 -
2019年天梯赛全国总决赛题集
文章目录L1-1 PTA使我精神焕发 (5分)L1-2 6翻了 (15分)L1-3 敲笨钟 (20分)L1-4 心理阴影面积 (5分)L1-5 新胖子公式 (10分)L1-6 幸运彩票 (15分)L1-7 吃鱼还是吃肉 (10分)L1-1 PTA使我精神焕发 (5分)#include <iostream>int main(void){ cout << "PTA...原创 2020-01-27 21:57:54 · 3727 阅读 · 5 评论 -
Codeforces Round #674 (Div. 3)
文章目录A - Floor NumberB - Symmetric MatrixC - Increase and CopyD - Non-zero SegmentsA - Floor Number输入房间号,问在第几层#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e5 + 5; int main(void){ int t, n, x; cin >>原创 2020-10-06 20:51:45 · 209 阅读 · 0 评论 -
Codeforces Beta Round #13
A - NumbersLittle Petya likes numbers a lot. He found that number 123 in base 16 consists of two digits: the first is 7 and the second is 11. So the sum of digits of 123 in base 16 is equal to 18.No...原创 2019-11-07 15:45:01 · 252 阅读 · 0 评论 -
Codeforces Beta Round #15
A - Cottage VillageA new cottage village called «Flatville» is being built in Flatland. By now they have already built in «Flatville» n square houses with the centres on the Оx-axis. The houses’ side...原创 2019-11-03 15:15:29 · 171 阅读 · 0 评论 -
Codeforces Beta Round #12
文章目录A - Super AgentInputOutputExamplesInputOutputInputOutputNoteB - Correct Solution?InputOutputExamplesInputOutputInputOutputA - Super AgentThere is a very secret base in Potatoland where potato ma...原创 2019-09-30 20:17:57 · 386 阅读 · 0 评论 -
Codeforces Beta Round #11
文章目录A - Increasing SequenceInputOutputSample InputSample OutputB - Jumping JackInputOutputExamplesInputOutputInputOutputInputOutputA - Increasing Sequence递增序列指的是,在序列中,对于任何两个相邻的数b[i]和bi+1,总有b[i]<b...原创 2019-09-22 15:54:15 · 245 阅读 · 0 评论 -
Codeforces Beta Round #10
文章目录A - Power Consumption CalculationInputOutputExamplesInputOutputInputOutputD - LCISInputOutputExamplesInputOutputInputOutputA - Power Consumption CalculationTom is interested in power consumption...原创 2019-09-19 16:36:19 · 143 阅读 · 0 评论 -
Codeforces Beta Round #8
A - Train and PeterPeter likes to travel by train. He likes it so much that on the train he falls asleep.Once in summer Peter was going by train from city A to city B, and as usual, was sleeping. Th...原创 2019-09-18 22:47:40 · 106 阅读 · 0 评论 -
Codeforces Beta Round #9
文章目录A - Die RollInputOutputExamplesInputOutputNoteC - Hexadecimal's NumbersInputOutputExamplesInputOutputNoteA - Die RollYakko, Wakko and Dot, world-famous animaniacs, decided to rest from acting in...原创 2019-09-18 21:25:22 · 131 阅读 · 0 评论 -
Codeforces Beta Round #7
A - Kalevitch and ChessA famous Berland’s painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more than a thousand years people have been playing this old game on un...原创 2019-09-09 22:59:47 · 238 阅读 · 0 评论 -
Codeforces Beta Round #6
文章目录A - TriangleInputOutputExamplesInputOutputInputOutputInputOutputB - President's OfficeInputOutputExamplesInputOutputInputOutputC - Alice, Bob and ChocolateInputOutputExamplesInputOutputA - Triang...原创 2019-09-05 16:44:40 · 139 阅读 · 0 评论 -
Codeforces Beta Round #5
B - Center AlignmentAlmost every text editor has a built-in function of center text alignment. The developers of the popular in Berland text editor «Textpad» decided to introduce this functionality i...原创 2019-09-02 19:59:47 · 244 阅读 · 0 评论 -
Codeforces Beta Round #4
文章目录A - WatermelonInputOutputExamplesInputOutputNoteB - Before an ExamInputOutputExamplesInputOutputInputOutputC - Registration systemInputOutputExamplesInputOutputInputOutputA - WatermelonCodeForce...原创 2019-08-30 18:58:56 · 274 阅读 · 0 评论 -
Codeforces Beta Round #3
文章目录A - Shortest path of the kingInputOutputExamplesInputOutputA - Shortest path of the kingThe king is left alone on the chessboard. In spite of this loneliness, he doesn’t lose heart, because he h...原创 2019-08-29 18:26:32 · 268 阅读 · 0 评论 -
Codeforces Beta Round #2
A - WinnerCodeForces-2AThe winner of the card game popular in Berland “Berlogging” is determined according to the following rules. If at the end of the game there is only one player with the maximum...原创 2019-08-28 15:44:12 · 360 阅读 · 0 评论 -
Codeforces Beta Round #1
A - Theatre SquareCodeForces - 1ATheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to ...原创 2019-08-28 13:10:38 · 202 阅读 · 0 评论 -
2019hbcpc(第三届河北省大学生程序设计竞赛)
热身赛 5112164 B.Icebound and Sequence2165 C.分治2166 D.榜单2169 G.点我2170 H.天神的密码2173 K.河北美食# 热身赛 511Description给定n,m,请你计算[1,n!]范围内有多少数字能被m整除。由于答案很大,请输出答案对10e9+7取模的结果。原创 2019-07-23 19:44:54 · 3159 阅读 · 0 评论 -
2017hbcpc(第一届河北省大学生程序设计竞赛)
题目链接:http://newoj.acmclub.cn/contests/1484还是太菜,好多题目还是不会。1844 自动签到机题目描述今天是报到日,在排了一下午的队之后,终于轮到了查尔明签到。这里使用了一种叫做“自动签到机”的高科技,在签到时,选手需要输入验证码来进行确认。这个系统每次会给出T张10*10的黑白图片,每张的黑色部分形成了“0”、“1”、“8”三个数字中的一种,而且出...原创 2019-07-14 21:49:43 · 1986 阅读 · 0 评论 -
2019hbcpc D.榜单 (C语言-大作业)
题目描述:给定一场ACM比赛的题目数量和提交列表,请你打印输出最终榜单。榜单的格式见输出和样例。根据比赛规则,榜单有以下要求:每道题的通过罚时按照分钟计算。每次未通过提交增加20分钟罚时,输入数据保证每个队伍罚时均小于10000分钟。到比赛结束都没有通过的题目不计入该队伍的罚时。每队通过后的题目在榜单的题目栏中用“+”号显示。如果仅提交一次就通过了,则显示“+”。否则显示“+k”,k 为...原创 2019-06-22 22:31:39 · 810 阅读 · 2 评论 -
2018hbcpc(第二届河北省大学生程序设计竞赛)
2013: Nim Game样例输入32 11 11 22 11 21 23 21 2 21 22 3样例输出012这道题因为数据量很大,如果直接暴力会超时,所以用到异或前缀和,把异或结果都保存下来。还需要写一个次方求模的函数。#include<bits/stdc++.h>using namespace std;long long t,...原创 2019-04-27 15:29:27 · 1152 阅读 · 0 评论 -
2020年第11届蓝桥杯C++B组 第一次省赛真题
试题 A: 跑步训练答案:65#include <bits/stdc++.h>using namespace std;int main(void){ int n = 10000, i; for (i = 0; n > 0; i++) { if (i % 2 == 0) { n -= 600; } else { n += 300; } } cout << i << endl; return原创 2020-09-22 14:40:06 · 14564 阅读 · 25 评论 -
2020蓝桥杯模拟赛
问题描述 小明有一块空地,他将这块空地划分为 n 行 m 列的小块,每行和每列的长度都为 1。 小明选了其中的一些小块空地,种上了草,其他小块仍然保持是空地。 这些草长得很快,每个月,草都会向外长出一些,如果一个小块种了草,则它将向自己的上、下、左、右四小块空地扩展,这四小块空地都将变为有草的小块。 请告诉小明,k 个月后空地上哪些地方有草。输入格式 输入的第一行包含两个整数...原创 2020-03-19 15:05:28 · 5479 阅读 · 0 评论 -
2018第九届蓝桥杯大赛总决赛(软件类)试题 A组
标题:三角形面积已知三角形三个顶点在直角坐标系下的坐标分别为:(2.3, 2.5)(6.4, 3.1)(5.1, 7.2)求该三角形的面积。注意,要提交的是一个小数形式表示的浮点数。要求精确到小数后3位,如不足3位,需要补零。给出了三角形三点的坐标,可以有几种方法求面积。感觉最好的方法是第二种1.叉积公式,向量a=(x1-x2,y1-y2),向量b=(x1-x3,y1-y3)...原创 2019-05-23 21:14:39 · 1935 阅读 · 0 评论 -
2019第十届蓝桥杯大赛软件类省赛 C/C++ 大学 B 组
2019第十届蓝桥杯大赛软件类省赛 C/C++ B组试题 A: 组队本题总分:5 分【问题描述】 作为篮球队教练,你需要从以下名单中选出 1 号位至 5 号位各一名球员, 组成球队的首发阵容。 每位球员担任 1 号位至 5 号位时的评分如下表所示。请你计算首发阵容 1 号位至 5 号位的评分之和最大可能是多少?这道题描述的有点不清楚,一开始没有看懂。编号1-20代表20名球员,选出让首发阵容评分最高的方案。列出每个位置分数最高的几个球...原创 2019-03-24 21:40:21 · 2771 阅读 · 0 评论 -
2018第九届蓝桥杯大赛总决赛(软件类)试题 B组
标题:换零钞x星球的钞票的面额只有:100元,5元,2元,1元,共4种。小明去x星旅游,他手里只有2张100元的x星币,太不方便,恰好路过x星银行就去换零钱。小明有点强迫症,他坚持要求200元换出的零钞中2元的张数刚好是1元的张数的10倍,剩下的当然都是5元面额的。银行的工作人员有点为难,你能帮助算出:在满足小明要求的前提下,最少要换给他多少张钞票吗?(5元,2元,1元面额的必须都有,...原创 2019-05-24 19:23:30 · 835 阅读 · 0 评论 -
NEFU大三秋季训练赛第七场
文章目录A - Game with PearlsInputOutputSample InputSample OutputF - Linearization of the kernel functions in SVMInputOutputSample InputSample OutputJ - Comparison of Android versionsInputOutputSample Inpu...原创 2019-10-24 17:06:15 · 214 阅读 · 0 评论 -
紫书习题1
A - Repeating DecimalsThe decimal expansion of the fraction 1/33 is 0.03, where the 03 is used to indicate that the cycle 03repeats indefinitely with no intervening digits. In fact, the decimal expa...原创 2019-10-09 19:01:24 · 458 阅读 · 0 评论 -
2020 年百度之星·程序设计大赛 - 初赛一
题目链接:http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=8891001 Drink#include <bits/stdc++.h>using namespace std;int main(void){ int t, n, m, x, y; int res, num, k; scanf("%d", &t); while (t--) { res = 0x3f3f3f3f; scanf("%d%d原创 2020-08-09 20:28:10 · 455 阅读 · 0 评论 -
牛客编程巅峰赛S1第10场 - 黄金&钻石
题目链接:https://ac.nowcoder.com/acm/contest/6909#question第一次AK纪念A 牛牛排队class Solution {public: /** * 返回牛牛最终是从第几个门进入食堂吃饭的 * @param n int整型 代表门的数量 * @param a int整型vector 代表每个门外等待的人数 * @return int整型 */ int solve(int n, vector原创 2020-08-08 22:15:14 · 237 阅读 · 0 评论