Time Limit: 3 sec / Memory Limit: 1024 MB Score : 600600 points Problem Statement You are given a string SS of length 2N2N consisting of lowercase English letters. There are 22N22N ways to color each character in SS red or blue. Among these ways, how…
B - RGB Coloring 求ax + by = k (0<=x<=n && 0<=y<=n)的方案数,最后乘上C(n, x)*C(n,y) 代码: #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define pi acos(-1.0) #define LL long long #define mp make_pair #define…
Time Limit: 2 sec / Memory Limit: 1024 MB Score : 600600 points Problem Statement Ringo Mart, a convenience store, sells apple juice. On the opening day of Ringo Mart, there were AA cans of juice in stock in the morning. Snuke buys BB cans of juice h…
Time Limit: 2 sec / Memory Limit: 1024 MB Score : 200200 points Problem Statement Takahashi lives in another world. There are slimes (creatures) of 1000010000 colors in this world. Let us call these colors Color 1,2,...,100001,2,...,10000. Takahashi…
原文链接https://www.cnblogs.com/zhouzhendong/p/AGC030C.html 题解 才发现当时是被题意杀了. 当时理解的题意是“对于任意的 (i,j) ,颜色 i 和 颜色 j 的相邻格子对数相同”.好像当时看了样例都没有发现被题意杀…… 回归正题. 如果要构造 n = k 的,那么直接 构造一个第 i 行为 i 的就好了. 那么 n<k<=2n 呢? 我们考虑斜着的列. 如果第 i 个斜列放 i ,那么也可以达到 n = k 的目的. 如果第 i 个斜列间隔…
AtCoder Grand Contest 005 A - STring 翻译 给定一个只包含\(ST\)的字符串,如果出现了连续的\(ST\),就把他删去,然后所有位置前移.问最后剩下的串长. 题解 模拟栈,和维护括号一样的. #include<iostream> #include<cstring> using namespace std; #define MAX 200200 char ch[MAX]; int ans,tot; int main() { cin>>…
AtCoder Grand Contest 007 A - Shik and Stone 翻译 见洛谷 题解 傻逼玩意 #include<cstdio> int n,m,tot;char ch[10]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;++i) { scanf("%s",ch+1); for(int j=1;j<=m;++j) tot+=ch[j]=='#'…