B - Sum Problem In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line. Output For each case, output SUM(n) in one line, followed by a blank line. You may a
一些奖项: CCPC省赛: Gold Medal ICPC省赛:Silver Medal CCPC秦皇岛:Honorable Mention ICPC亚洲区域赛宁夏:Gold Medal ICPC EC-Final:Bronze Medal 一些经历 担任了一年的算法协会会长 组织策划了2019暑期集训 组织策划了积分赛 组织策划了第10届ACM校赛并放到了牛客网上重现 ICPC区
A.The beautiful values of the palace 首先对于每个\((x,y)\),我们可以\(O(1)\)的查询出这个坐标的值。接下来就将问题转化为了一个\(10^6 \cdot 10^6\)的矩阵,每次查询子矩阵内的点的和。 考虑将所有的\(y\)离散化,计\(mp_{i,j}\)表示\((1,1)-(i,j)\)的和,那么对于\((x_1,y_1)->(x_2
B.so easy 并查集,可能会卡掉map,建议使用unordered_map。 #include<bits/stdc++.h> using namespace std; const int N = 1e6+100; const int mod = 1e9+7; typedef long long ll; const int INF = 0x3f3f3f3f; const ll llINF = 0x3f3f3f3f3f3f3f3f; #define rep(i,a,b) for(int
简单单淘汰赛制,即一些队伍两两比赛,一次直接淘汰败者,最终剩下一个队伍的赛制 在acm中我们有时候会遇见要解决此类问题的题目,对此有些心得想写下来 简单分析: 首先分析这种赛制需要计算的答案 可能是最终的胜者是谁,每个人获胜的概率是多少 再来分析这个问题的本质,实际上因为每个人只
\(2018\)年\(5\)月\(19\)日,是我作为ACMer的启程,在王老师的带领下,第一次去西安参加全国性质的比赛,虽然只是一个邀请赛,虽然不是在体育场举办,虽然并没有获奖,但是对于当时大一的我来说,这是一次难忘的经历,我知道了人与人之间的差距可以这么大,也真正地体验到了过题的快感,竞赛的残酷。从
L. Who is the Champion 题目:给出一个N阶矩阵,(i,j)(i, j)(i,j)处的数字表示这场比赛球队iii踢进球队jjj多少球。两支球队平局则各加一分,一方获胜则获胜方加三分,负方不加分也不扣分。输出冠军队编号。优先比较分数,分数一样的话比较胜场数,胜场数一样的话输出play-offs。 结构体记
题意: 给定一个二进制表示的n,让你找满足如下要求的数对(i,j)的个数 $0 \leqslant j \leqslant i \leqslant n$ $ i & n = i $ $ i & j = 0 $ 其中&代表按位与 题解: 打表发现对于单个i满足上述规律的j的数量为$2^{(num \ of \ 0 \ in(i)_2)}$ 因此对着n的二进制可以从后往前dp计算每一
A. Apprentice Learning Trajectory B. Balls of Buma C. Cactus Revenge D. DevOps Best Practices E. Elections F. Foolpr¨uf Security G. Game Relics H. Help BerLine I. Intriguing Selection 265min, solved by rdc 做法: 先比较出长度为 \(x,y\) 的两条链,满足 \(
Problem Description Pony is the boss of a courier company. The company needs to deliver packages to n offices numbered from 1 to n. Especially, the s-th office is the transfer station of the courier company. There are x ordinary two-way roads and y one-w
Problem Description As we already know, base64 is a common binary-to-text encoding scheme. Here we define a special series of positional systems that represent numbers using a base (a.k.a. radix) of 2 to 62. The symbols ‘0’ – ‘9’ represent zero to nine,
A. BerstagramPolycarp recently signed up to a new social network Berstagram. He immediately published n posts there. He assigned numbers from 1 to n to all posts and published them one by one. So, just after publishing Polycarp's news feed contained
Day1:周末早起昏昏欲睡,在候车室买了剑盾(剁手1st),差不多中午12:00办了入住(?记不清了),差不多12:30去报了道,有一说一卫衣还蛮好看的wwww,之后就赶紧去食堂恰了饭,六个人拼了一桌菜,其实我感觉味道一般(可能是因为来得晚菜凉了)QAQ ,午饭图: 之后进体育馆开幕式都已经开始了,热身赛倒是自己
题目: There are a number of people who will be attending ACM-ICPC World Finals. Each of them may be well versed in a number of topics. Given a list of topics known by each attendee, you must determine the maximum number of topics a 2-person team can know. A
目录 一、前言 二、10月19日热身赛 三、10月20日正式赛 四、结果 一、前言 比赛前我们队有ccpc厦门和icpc银川的名额,然而这两个地区的时间正好撞了,考虑到银川更容易拿奖,加上我们ACM协会参加了几年的icpc/ccpc,学校倒是挺支持的,次次报销,但始终没拿到成绩,我们也挺尴尬的,对学校
Yukino With Subinterval Yukino has an array a_1, a_2 \cdots a_na1,a2⋯*a**n*. As a tsundere girl, Yukino is fond of studying subinterval. Today, she gives you four integers l, r, x, yl,r,x,y, and she is looking for how many different subintervals [L, R][L
https://nanti.jisuanke.com/t/39277 求$\sum{异或和为0的路径,被其他路径包含的次数}$ 如果只是求异或和为0的路径数量,其实是裸点分治,但是加上要求之后,就会复杂一些 进行分类讨论,再特殊处理根节点就行 由于信息可以合并,我使用子树合并,跑的很快 #include<bits/stdc++.h>#in
描述Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000). His C (2 <= C <= N) cows don't like this barn layout and be
描述在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。输入输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空
时间限制:1000ms 内存:8192K There are NN light bulbs indexed from 00 to N-1N−1. Initially, all of them are off. A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L, R)FLIP(L,R) means to flip all bulbs xx such that L \leq
题目链接:点击这里 给你n种水和背包容量,下面n行是水的价值和重量,要求找到超过重量使价值最小,水可以i无限选取。 DP一直是我不擅长的,昨天他们做了四个小时没过,我只能试试了,第一次选取就是完全背包的模板,然后因为数据量小,所以直接暴力枚举答案就行。 AC代码: #include<cstdio> #i
传送门 A. Who is better? 扩展中国剩余定理+斐波那契博弈,没啥好说的,关于斐波那契博弈,详见:传送门 Code ```cpp #include using namespace std; typedef long long ll; const int N = 15; const ll MAX = 1e15; int k; ll a[N], b[N]; void exgcd(ll a, ll b, ll &x, ll &y) {
The Preliminary Contest for ICPC Asia Xuzhou 2019 题意:给你两个串a,b,让你找出字典序严格大于b的a的子序列的最大长度。思路:这道题一看就是模拟嘛,枚举子序列从哪一位后开始字典序严格大于b,找到那一位在a中满足的最左的坐标,然后把后面的也全算上加上前面枚举到的长度就是当前解,对