
比赛题解
文章平均质量分 88
nike0good
这个作者很懒,什么都没留下…
展开
-
April Fools Day Contest 2025
直接输出一行B Plinko给一个弹珠游戏找起始点,要求掉到底。输出-1,直接从场外掉C Would It Be Unrated?猜有多少testcase,只能靠穷举,但是只要有人过了。提交页面可以查看过了至少k的点的提交。D Where Am I?给一个位置求坐标需要使用google街景定位,右键可以确定坐标。虽然图片看起来在纽约,但实际是在拉斯维加斯E Pair Count给你一个质数 ppp , nnn 个整数 a1,a2,…,ana_1, a_2, \ldots, a_na1原创 2025-04-02 11:58:03 · 870 阅读 · 0 评论 -
Japan Registry Services (JPRS) Programming Contest 2025#1 (AtCoder Beginner Contest 392) 题解
B - Who is Missing?C - BibD - DoublesE - Cables and ServersF - InsertG - Fine Triplets给NNN个两两不同的数SiS_iSi,问能凑出多少三元组,正好可以组成等差序列。1≤N,Si≤1061\le N,S_i \le 10^61≤N,Si≤106枚举中间那个数,另外两个数的和是确定的,上FFT。原创 2025-02-09 07:45:30 · 817 阅读 · 0 评论 -
Good Bye 2024: 2025 is NEAR 题解
A Tender Carpenter给一个数列分是否存在至少2种划分方式使得划分后每个子段中的数任取(可重复取)3个都能作为三角形的3条边长。#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i-原创 2024-12-30 05:06:11 · 947 阅读 · 0 评论 -
AtCoder Beginner Contest 369 题解
A - 369#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i,n) for(原创 2024-09-01 21:53:26 · 1253 阅读 · 0 评论 -
AtCoder Beginner Contest 367 题解
B - Cut .0C - Enumerate SequencesD - PedometerE - Permute K timesF - Rearrange QueryYou are given sequences of positive integers of length NNN: A=(A1,A2,…,AN)A=(A_1,A_2,\ldots,A_N)A=(A1,A2,…,AN) and B=(B1,B2,…,BN)B=(B_1,B_2,\ldots,B_N)B=(B1,B2原创 2024-08-25 11:31:44 · 824 阅读 · 0 评论 -
UNIQUE VISION Programming Contest 2024 Spring(AtCoder Beginner Contest 346)
文章目录A - Adjacent ProductB - PianoC - ΣD - Gomamayo SequenceE PaintF SSttrriinngg in StringStringA - Adjacent Product#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++原创 2024-04-16 22:28:54 · 749 阅读 · 0 评论 -
百度之星 2024 决赛 题解
intforint1;原创 2024-03-18 10:00:12 · 2217 阅读 · 0 评论 -
Hello 2024 题解
B. Plus-Minus SplitC. Grouping Increases给一个数列,不改变相对顺序前提拆成2个数列。问这2个数列中,相邻且前一个数小于后一个数的数对的最小值贪心,维护2个数列队尾的值,如果都会增加数对或都不会,则放到队尾数小的那个。不然放不会增加数对的那个。D. 01 Tree给一个树,所有非叶子节点均有左右2个子节点,边权分别0和1(可以对调)。已知所有叶子节点的按dfs序排列后的到根的最短路径长。问是否合法?dfs_order = []function dfs(原创 2024-01-13 19:32:58 · 1157 阅读 · 1 评论 -
Meta Hacker Cup 2023 Round 1 题解
给一个数列,要求分成若干组,要求每组至少2个数,使得所有组中位数的最大值与最小值之差尽量大,求这个值。Problem B1: Sum 41 (Chapter 1)Given a positive integer P, please find an array of at most 100 positive integers which have a sum of 41 and a product of P, or output −1 if no such array exists.If multipl原创 2023-10-19 22:33:25 · 421 阅读 · 0 评论 -
April Fools Day Contest 2023 题解
A Are You a Robot?print("security")B Was it Rated?#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n)原创 2023-04-12 20:41:31 · 499 阅读 · 0 评论 -
Codeforces Round 860 (Div. 2) 题解
A Showstopper#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i,n原创 2023-03-29 16:39:07 · 1142 阅读 · 0 评论 -
The 1st Universal Cup Stage 5: Osijek, February 25-26, 2023 题解
Problem G. GridlandiaInput file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 256 megabytes给一个n∗nn*nn∗n的矩阵,每个格子可以选取上下左右一条边(可以不选),所有选取的边不能共点。现在要求构造一个方案,选尽量多的边。The continent of Gridlandia is a squares of side length n, div原创 2023-02-28 13:44:21 · 624 阅读 · 0 评论 -
The 22nd Japanese Olympiad in Informatics (JOI 2022/2023) Final Round 题解
交题:https://cms.ioi-jp.org/documentation给一个序列 a1,⋯ ,ana_1,\cdots,a_na1,⋯,an。执行nnn个操作,第iii个操作为找出第iii个数前离其最近且与它相同的数的位置,把这两个数之间的数全部赋值aia_iai。求最后的序列。考虑第iii个操作执行完后,iii之前每个数一定是连续出现正好一段或不出现。B给nnn个点对,每个点对(x,y)(x,y)(x,y)可以覆盖S=(a,b)∣b原创 2023-02-18 11:32:22 · 1223 阅读 · 0 评论 -
Good Bye 2022: 2023 is NEAR 题解
Koxia and PermutationKoxia and Number TheoryKoxia and GameKoxia 和 Mahiru 正在用三个长度为 nnn的数组 a,b,ca,b,ca,b,c 玩一个游戏。其中 a,b,ca,b,ca,b,c中的每个元素都是 111到 nnn 之间的整数。游戏持续 nnn 轮。在第iii 轮中,她们进行以下操作:令 SSS是{ai,bi,ci}\{ a_i,b_i,c_i \}{ai,bi,ci} 的可重集。Koxia 从可重集 SSS原创 2023-01-01 00:00:53 · 558 阅读 · 0 评论 -
CodeJam Qualification Round 2022
Punched Cards (11pts)Attempts1Penalties0Penalty Time25:02:57PointsdonePractice SubmissionsYou have not attempted this problem.Last updated: Apr 3 2022, 12:13PROBLEMANALYSISProblemA secret team of programmers is plotting to disrupt the progra原创 2022-04-03 12:21:44 · 661 阅读 · 0 评论 -
CodeTON Round 1 (Div. 1 + Div. 2, Rated, Prizes)
A Good PairsYou are given an array a1,a2,…,ana_1,a_2,…,a_na1,a2,…,an of positive integers. A good pair is a pair of indices (i,j)(i,j)(i,j) with 1≤i,j≤n1≤i,j≤n1≤i,j≤n such that, for all 1≤k≤n1≤k≤n1≤k≤n, the following equality holds:原创 2022-03-27 03:59:11 · 407 阅读 · 0 评论 -
AtCoder Beginner Contest 242
A#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i,n) for(int i=原创 2022-03-08 06:32:17 · 658 阅读 · 0 评论 -
AtCoder Beginner Contest 240
A Edge Checker#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i,原创 2022-02-23 15:41:32 · 562 阅读 · 0 评论 -
百度之星2021 决赛
A解方程得出系数#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>#include<functional>#include<iostream>#include<cmath>#include<cctype>#include<ctime>using namespace std;#define F原创 2022-02-03 23:25:26 · 368 阅读 · 0 评论 -
Codeforces LATOKEN Round 1 (Div. 1 + Div. 2)
A Colour the Flag#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD原创 2021-06-22 07:30:52 · 219 阅读 · 0 评论 -
Tokio Marine & Nichido Fire Insurance Programming Contest 2021(AtCoder Regular Contest 122) 题解
A Many Formulae#include<bits/stdc++.h> using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForkD(i,k,n) for(int i=n;i>=k;i--)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i原创 2021-06-12 23:14:57 · 359 阅读 · 0 评论 -
2016 计蒜之道 热身赛 题解(待续)
硬币翻转在一个 n 行 m 列的网格中,每个网格中有一枚硬币,在翻转某一个网格中的硬币时,与该网格共边的四个网格中的硬币也将被翻转。求至少需要进行多少次翻转操作,可以将所有的硬币变为正面朝上。 1≤n≤100;1≤m≤15#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#def原创 2016-05-29 13:58:21 · 1469 阅读 · 0 评论 -
2016"百度之星" - 资格赛(Astar Round1) 题解
Problem BProblem DProblem B度熊面前有一个全是由1构成的字符串,被称为全1序列。你可以合并任意相邻的两个1,从而形成一个新的序列。对于给定的一个全1序列,请计算根据以上方法,可以构成多少种不同的序列。 1≤N≤200#include <iostream>#include <cmath>#include <vector>#include <cstdio>#incl原创 2016-05-18 13:06:47 · 685 阅读 · 0 评论 -
GCJ Round 1C 2016 题解
ASenate EvacuationB SlidesC Fashion PoliceA.Senate Evacuation#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(原创 2016-05-08 22:02:08 · 833 阅读 · 0 评论 -
WF 2016题解(待填坑)
C Ceiling Function让你以某个方式建树,求树形态个数#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(i,n) for(int i=0;i<n;i++)#de原创 2016-05-19 20:34:37 · 987 阅读 · 0 评论 -
Codeforces Round #355 (Div. 2) 题解(待补)
Vanya and FenceVanya and Food ProcessorVanya and LabelVanya and Fenceint n=read(),h=read(),ans=0; For(i,n){ ans+=1+(read()>h); } cout<<ans<<endl;Vanya and Food Processor ll n,h原创 2016-06-03 02:20:49 · 601 阅读 · 0 评论 -
2016"百度之星" - 初赛(Astar Round2A)题解
All XSitting in LineBD StringGym ClassAll XF(x,m) 代表一个全是由数字x组成的m位数字。请计算,以下式子是否成立: F(x,m) mod k ≡ cF(x,m)\ mod\ k\ \equiv \ c1≤x≤9,1≤m≤10101≤x≤9 ,1\leq m\leq 10^{10} 0≤c<k≤10,0000\leq c< k\leq 10,0原创 2016-05-21 21:48:10 · 1031 阅读 · 0 评论 -
Yandex.Algorithm 2016 Qualification Round 题解(待补)
OrthographyVoice AlertsOne of the most important features in YandexNavigator is the voice alert of the next manoeuvre the application kindly warns the driver about a turn they must make some time in a原创 2016-05-23 00:29:08 · 602 阅读 · 0 评论 -
Yandex.Algorithm 2016 Online Round 2 题解(待补)
Role DistributionBinary Representation GameMilk ProductsRole Distribution#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)原创 2016-06-11 14:28:37 · 558 阅读 · 0 评论 -
Codeforces Round #356 (Div. 1) 题解(待补)
Bear and Prime 100Bear and Tower of CubesBear and Square GridBear and Prime 100This is an interactive problem. In the output section below you will see the information about flushing the output.Bear原创 2016-06-09 23:12:34 · 733 阅读 · 0 评论 -
2016 计蒜之道 初赛 第一场 题解(待补)
A 青云的服务器密钥B 青云的机房组网方案简单A. 青云的服务器密钥对于密钥 S1..Sn,我们需要首先计算其对应的π 数组。对于任意的 i(2≤i≤n),πi=max{L|S1...SL=Si−L+1...Si,(0≤L<i)}i(2≤i≤n),\pi_i=max\{L|S_1...S_L=S_{i-L+1}...S_i, (0 \leq L < i)\} 也就是最长的前缀等于后缀的长度。原创 2016-06-07 00:34:57 · 793 阅读 · 0 评论 -
2016 计蒜之道 初赛 第二场(待补)
A 联想公司的 logo 设计B联想的显示屏校准A. 联想公司的 logo 设计#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(i,n) for(int i=0;i<n;i原创 2016-06-07 02:01:53 · 3468 阅读 · 0 评论 -
2016 计蒜之道 复赛 题解 部分
百度地图的实时路况联想专卖店大促销微信钱包付款菜鸟物流的运输网络百度地图的实时路况点数100的无向图,d(u,v,w)d(u,v,w)表示从 u 号点出发,严格不经过 v 号点,最终到达 w 号点的最短路径长度 求∑1≤x,y,z≤n,x≠y,y≠zd(x,y,z)∑_{1≤x,y,z≤n,x≠y,y≠z} d(x,y,z) cdq#include<bits/stdc++.h>usi原创 2016-07-10 11:01:13 · 559 阅读 · 0 评论 -
xjtu暑期集训2016-7-9 题解
A 郭铮鹏与国际象棋B 郭铮鹏与食堂买饭C 郭铮鹏与烧情侣D 郭铮鹏与线性代数E 郭铮鹏与老司机F GZP and Public Display of AffectionG GZP Bureaucracy and GirlfriendH GZP and DatingA. 郭铮鹏与国际象棋Description 郭铮鹏正在学习国际象棋。他已经学会了王、车和象的移动方式。国际象棋规则如下原创 2016-07-12 11:14:44 · 803 阅读 · 0 评论 -
PAT 团体程序设计天梯赛 部分题目题解
L1-002 打印沙漏L1-006 连续因子L1-010 比较大小L1-014 简单题L1-018 大笨钟L2-002 链表去重L2-010 排座位L3-002 堆栈L3-006 迎风一刀斩L1-002. 打印沙漏本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印***** *** * ********所谓“沙漏形状”,是指每行输出奇原创 2016-07-12 11:18:17 · 4789 阅读 · 0 评论 -
Codeforces Round #358 (Div. 2)
Alyona and NumbersAlyona and MexAlyona and the TreeAlyona and StringsAlyona and TrianglesAlyona and Numbers#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#defin原创 2016-06-18 13:06:45 · 364 阅读 · 0 评论 -
BestCoder Round #84 题解
AaronsonBellovinColmerauerDertouzosAaronson注意m的范围、、#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>#include<functional>#include<iostream>#include<cmath>#include<cctype>#原创 2016-07-23 23:25:59 · 326 阅读 · 0 评论 -
Codeforces Round #364 (Div. 1) 题解(待续)
As Fast As PossibleConnecting UniversitiesAs Fast As Possible小学奥数题 double n,k; double l,v1,v2; cin>>n>>l>>v1>>v2>>k; double S=ceil((double)n/k); double T=(2*S-1)*v2+v1; T/=(2*S-原创 2016-07-23 23:34:58 · 343 阅读 · 0 评论 -
2016 Multi-University Training Contest 2 题解(待续)
AcperienceBorn SlippyCall It What You WantDifferenciaEurekaIts All In The MindKeep On MovinLa Vie en roseAcperience公式题 考场贪心乱搞版本:#include<bits/stdc++.h>using namespace std;#define For(i,n) for原创 2016-07-25 22:54:48 · 483 阅读 · 0 评论 -
Codeforces Round #362 (Div. 1) 题解(待续)
Lorenzo Von MatterhornPuzzlesPLEASELorenzo Von Matterhorn#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(i,n)原创 2016-07-15 08:12:19 · 500 阅读 · 0 评论