ACM-ICPC 2017 Asia HongKong 解题报告】的更多相关文章

ACM-ICPC 2017 Asia HongKong 解题报告 任意门:https://nanti.jisuanke.com/?kw=ACM-ICPC%202017%20Asia%20HongKong 按AC次序: D - Card collection In an online game, a player can collect different types of power cards. Each power card can enable a player to have a uni…
第三题:HDU 4730 We Love MOE Girls 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4730 水题~~~ #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <cstdlib> #include <cmath> #include <vector&…
这次的答案是猜出来的,如果做得话应该是应该是一个几何概型的数学题: 答案就是:n/(m^(n-1)); 具体的证明过程: 1.首先枚举这M个点中的的两个端点,概率是:n*(n-1); 2.假设这个蛋糕是个圆盘状的,圆面面积为1,然后为了满足题目的要求,这两个端点+圆心所组成的扇形的的面积应该小于1/m: 3.然后对剩下的所有点都应该分布在这个扇形里面,加设扇形面积为x,则结果应该为:x^(n-2)在0-1/m中的积分,然后再乘以n*n-1; n,m<=20.这牵扯到大数运算,为了简单起见就用了J…
一个KMP的简单题 不过好久没用过这个东东了,今天写的时候花了很多时间: 只需要花点时间判断下所有的元素都相同的的情况就行了! #include<cstdio> #include<cstring> #include<algorithm> #define maxn 1000006 using namespace std; char s[maxn]; int next[maxn]; void getnext(char *t) { // t为模式串 ,j= -,l = str…
I. Older Brother Your older brother is an amateur mathematician with lots of experience. However, his memory is very bad. He recently got interested in linear algebra over finite fields, but he does not remember exactly which finite fields exist. For…
L. Sticky Situation While on summer camp, you are playing a game of hide-and-seek in the forest. You need to designate a “safe zone”, where, if the players manage to sneak there without being detected,they beat the seeker. It is therefore of utmost i…
新生初赛题目.解题思路.参考代码一览 A. 拒绝虐狗 Problem Description CZJ 去排队打饭的时候看到前面有几对情侣秀恩爱,作为单身狗的 CZJ 表示很难受. 现在给出一个字符串代表 CZJ 前面的队列.你可以帮他一把把那些情侣分开吗? Input 第一行是一个\(T\),代表数据的组数\(T\)(\(T\leq 100\)). 每组一个只包含大写字母的字符串\(p\)(\(1\leq len_{p}\leq 1000\)),表示 CZJ 前面的队列,保证不会有连续三个及以上…
新生初赛题目.解题思路.参考代码一览 1001. 无聊的日常 Problem Description 两位小朋友小A和小B无聊时玩了个游戏,在限定时间内说出一排数字,那边说出的数大就赢,你的工作是帮他们统计他们获胜的次数. Input 第一行是一个T,代表游戏的次数T(T≤1000).每组两个整数p,y(1≤p≤\(10^{100}\),1≤y≤\(10^{100}\)),分别表示两位小朋友说出的数字. Output 输出两个数,A和B获胜的次数.后面没有换行,仅此一题 Sample Input…
「雅礼集训 2017 Day2」水箱 我怎么知道这种题目都能构造树形结构. 根据高度构造一棵树,在树上倍增找到最大的小于约束条件高度的隔板,开一个 \(vector\) 记录一下,然后对于每个 \(vector\) 按照高度排序一下,树形 \(dp\) 即可 \(Code\ Below:\) #include <bits/stdc++.h> #define pii pair<int,int> #define mp make_pair #define F first #define…
「雅礼集训 2017 Day1」市场 挺神仙的一题.涉及区间加.区间除.区间最小值和区间和.虽然标算就是暴力,但是复杂度是有保证的. 我们知道如果线段树上的一个结点,\(max=min\) 或者 \(max=min+1\) 并且 \(d|max\),是可以直接剪掉的. 我们定义线段树上一个结点的势能为 \(\log(max-min)\),那么我们每执行一次区间除,都会引起势能的减小. 但是执行区间加时我们涉及 \(\log n\) 个结点,最差情况下会将它们的势能恢复为 \(\log(max-m…