[链接]:CF988C [题意]:在n个序列中任选两个序列,两个序列都除去他们中的一个数,使的总和相同 [分析]:map<int,pair<int,int> > mp,从0~m遍历删除第i个数,mp[sum-a[i]]={j+1,i+1}; 其中key是记录删掉某个数的剩下的数,value是一对以行列号用来确定位置以方便输出.若删掉某个数剩下的数与之前的某个数相等,则马上输出并退出.时间复杂度O(n*m) [代码]: #include <bits/stdc++.h> u…
C. Equal Sums time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given kk sequences of integers. The length of the ii-th sequence equals to nini. You have to choose exactly two sequen…
传送门 •题意 给k个数列,从中k个数列中找出任意2个数列 i ,j 使得数列i删除第x个数,和数列j删除第y个数的和相等 若存在,输出 i ,x 和 j,y •思路 每个数列之间的联系为数列的和之间的差det 如果开二维数组记录每个数列之间的det的话,显然是不可行的_(:з」∠)_ 这里用map<x ,pair<i ,j > >mp表示序列 i 删除第 j 个数后的总和为 x: 如果某两个序列各删除一个数,得到的总和相等, 也就是后一个序列得到的总和已存在(被前一个所记录)的话…
Equal Sums time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given kk sequences of integers. The length of the ii-th sequence equals to nini. You have to choose exactly two sequences…
C. Equal Sums time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given kk sequences of integers. The length of the ii-th sequence equals to nini. You have to choose exactly two sequen…
D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a frien…
5109: [CodePlus 2017]大吉大利,晚上吃鸡! Time Limit: 30 Sec  Memory Limit: 1024 MBSubmit: 107  Solved: 57[Submit][Status][Discuss] Description 最近<绝地求生:大逃杀>风靡全球,皮皮和毛毛也迷上了这款游戏,他们经常组队玩这款游戏.在游戏中,皮皮 和毛毛最喜欢做的事情就是堵桥,每每有一个好时机都能收到不少的快递.当然,有些时候并不能堵桥,皮皮和毛 毛会选择在其他的必经之路上…
Fibonacci-ish Yash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fibonacci-ish if the sequence consists of at least two elements f0 and f1 are arbitrary fn + 2 = fn + 1 + fn for all n ≥ 0. You are…
[传送门]https://nanti.jisuanke.com/t/31458 [题目大意]有N个帧,每帧有K个动作特征,每个特征用一个向量表示(x,y).两个特征相同当且仅当他们在不同的帧中出现且向量的两个分量分别相等.求最多连续相同特征的个数? [题解]用一个map来维护帧中特征的信息,map中的键即读入的向量,因此用一个pair<int , int>表示,键的值也是一个pair,需要记录它当前已经连续了多少次,还需要记录它上一次出现的帧的位置.如果它上一帧没有出现过,那么它的连续次数就要…
一.Stack(栈) 这个没啥好说的,就是后进先出的一个容器. 基本操作有: stack<int>q; q.push(); //入栈 q.pop(); //出栈 q.top(); //返回栈顶成员 q.size(); //返回栈成员个数 q.empty(); //判断是否为空栈 二.Queue(队列) 同上,先进先出的容器 基本操作有: queue<int>q; q.push(); //入队列 q.pop(); //出队列 q.front(); //返回最上面(最后进入)的成员 q…