2017南宁现场赛E The Champion】的更多相关文章

Bob is attending a chess competition. Now the competition is in the knockout phase. There are 2^r2r players now, and they will play over rr rounds. In each knockout round, the remaining players would be divided into pairs, and the winner of each pair…
题意: 给定一个2 * n的矩阵, 和 2 * n 个数, 问能不能通过重排列, 使得任意相邻两数不能被3整除 分析: 这题一直卡到最后, 赛后经对面大佬提醒后, 发现统计所有数模三的结果(0,1,2三种), 然后考虑怎么去“构造”符合这样的矩阵就行. 本地只过了用例和一些小数据, 等一个重现赛. #include <bits/stdc++.h> using namespace std; + ; int n; ]; int _0,_1,_2; bool judge() { if(_0 >…
Consider n given non-empty strings denoted by s1 , s2 , · · · , sn . Now for each of them, you need to select a corresponding suffix, denoted by suf1, suf2, · · · , sufn. For each string si, the suffix sufi is a non-empty substring whose right endpoi…
Lusrica designs a mosquito coil in a board with n × n grids. The mosquito coil is a series of consecutive grids, each two neighboring grids of which share a common border. If two grids in the mosquito coil are not consecutive, they do not share any b…
题意 : 乱七八糟说了一大堆,实际上就是问你从一个序列到另个序列最少经过多少步的变化,每一次变化只能取序列的任意一个元素去和首元素互换 分析 : 由于只能和第一个元素去互换这种操作,所以没啥最优的特别方法,只要乖乖模拟即可,如果第一个元素不在正确位置则将它和正确位置的元素交换使其回到正确位置,如果第一个元素的位置就是正确的,那么就往后找不在正确位置的元素将它互换到第一个去,然后再对第一个元素进行判断即可,直到序列变成最终满足条件的序列........ #include<bits/stdc++.h…
题目链接:西安:https://nanti.jisuanke.com/t/20759   (计蒜客的数据应该有误,题目和 LOJ 的大同小异,题解以 LOJ 为准)     LOJ:https://loj.ac/problem/6062 题意:给出一个长度为n的数列a_i和一个长度为m的数列b_i求a_i有多少个长度为m的连续子数列能与b_i匹配. 两个数列可以匹配,当且仅当存在一种方案,使两个数列中的数可以两两配对,两个数可以配对当且仅当它们的和不小于h. 题解:先对 b 数组进行排序,建一颗…
题目链接 problem description 5 friends play LOL together . Every one should BAN one character and PICK one character . The enemy should BAN 55 characters and PICK 55 characters . All these 2020 heroes must be different . Every one can BAN any heroes by h…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4803 Problem Description Jenny is a warehouse keeper. He writes down the entry records everyday. The record is shown on a screen, as follow:There are only two buttons on the screen. Pressing the button i…
题目链接 题意:给定一个很大的数,把他们分为数个回文数的和,分的个数不超过50个,输出个数并输出每个数,special judge. 题解:现场赛的时候很快想出来了思路,把这个数从中间分为两部分,当位数为偶数的时候3456就分为34和56,34-1=33,回文数3333,3456-3333=123然后继续算:当位数为奇数的时候34567就分为34和67,5-1=4,回文数34443,34567-34443=124然后继续算.但是一年都没有写过高精度减法的题了,这个大模拟写了很久最后判断奇偶性都判…
杭州现场赛的题.BFS+DFS #include <iostream> #include<cstdio> #include<cstring> #define inf 9999999 using namespace std; char mp[105][105]; int sq[5][5]; int step[4][2]={{0,1},{1,0},{0,-1},{-1,0}}; struct pos { int x,y; }; int n,m,prn,x,y,tmp,ans…