AtCoder Grand Contest 021】的更多相关文章

A - Digit Sum 2 Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement Find the maximum possible sum of the digits (in base 10) of a positive integer not greater than N. Constraints 1≤N≤1016 N is an integer. Input Input is give…
提示:如果公式挂了请多刷新几次,MathJex的公式渲染速度并不是那么理想. 总的来说,还是自己太弱了啊.只做了T1,还WA了两发.今天还有一场CodeForces,晚上0点qwq... 题解还是要好好写的. A - Digit Sum 2 Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement Find the maximum possible sum of the digits (in bas…
Atcoder 题面传送门 & 洛谷题面传送门 首先我们考虑设 \(dp_{i,j}\) 表示对于一个 \(i\times j\) 的网格,其每行都至少有一个黑格的合法的三元组 \((A,B,C)\) 的个数,那么对于原来的 \(n\times m\) 的网格,如果其存在黑格的行的集合不同,那么三元组 \((A,B,C)\) 肯定不同,因此我们可以直接枚举有多少行存在黑格来计算答案,即 \(ans=\sum\limits_{i=0}^n\dbinom{n}{i}dp_{i,m}\),因此我们只需…
Description Takahashi has decided to give a string to his mother. The value of a string T is the length of the longest common subsequence of T and T', where T' is the string obtained by reversing T. That is, the value is the longest length of the fol…
传送门 \(A\) 咕咕 ll n,res;bool fl; int main(){ scanf("%lld",&n),fl=1; while(n>9)res+=9,fl&=(n%10==9),n/=10; printf("%lld\n",res+n-1+fl); return 0; } \(B\) 只有凸包上的点有贡献,且把以这个点为端点的两条凸包上的线的中垂线画出来,它的概率就是两条中垂线的夹角除以\(2\pi\) //quming #in…
AtCoder Grand Contest 012 A - AtCoder Group Contest 翻译 有\(3n\)个人,每一个人有一个强大值(看我的假翻译),每三个人可以分成一组,一组的强大值定义为三个人中第二强的人的强大值.求\(n\)组最大的强大值之和. 题解 这...不是倒着选两个人,正着选一个人构成一组就好了嘛.. #include<iostream> #include<cstdio> #include<algorithm> using namespa…
AtCoder Grand Contest 011 upd:这篇咕了好久,前面几题是三周以前写的... AtCoder Grand Contest 011 A - Airport Bus 翻译 有\(n\)个乘客到达了飞机场,现在他们都要坐车离开机场.第\(i\)个乘客到达的时间是\(T_i\),一个乘客必须在\([T_i,T_i+k]\)时刻做到车,否则他会生气.一辆车最多可以坐\(C\)个人.问最少安排几辆车可以让所有人都不生气. 题解 从前往后贪心即可. #include<iostream…
AtCoder Grand Contest 031 Atcoder A - Colorful Subsequence description 求\(s\)中本质不同子序列的个数模\(10^9+7\).两个子序列不同当且仅当存在一种字符在两者中的出现次数不同. \(|s|\le10^5\) solution \(\prod_{i='a'}^{'z'}(\mbox{字符}i\mbox{出现的次数}+1)-1\) #include<cstdio> #include<algorithm>…
AtCoder Grand Contest 010 A - Addition 翻译 黑板上写了\(n\)个正整数,每次会擦去两个奇偶性相同的数,然后把他们的和写会到黑板上,问最终能否只剩下一个数. 题解 洛谷认为此题过水,已被隐藏. #include<iostream> #include<cstdio> using namespace std; inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch…
AtCoder Grand Contest 009 A - Multiple Array 翻译 见洛谷 题解 从后往前考虑. #include<iostream> #include<cstdio> using namespace std; #define ll long long #define MAX 100100 inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch<'0'||ch>…