Atcoder ABC162 D - RGB Triplets】的更多相关文章

传送门:D - RGB Triplets  题意:给你一个只含'R','G','B'的字符串,求有多少个长度为3且每个字符都不相等,并且第一第二和第二第三的区间长度不同的子序列. 题解:统计每个字符各有多少,算出所有两两不同的子序列个数然后减去区间长度相等的个数即可 代码: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include…
比赛链接:https://atcoder.jp/contests/abc162/tasks A - Lucky 7 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (to_string(n).find("7") != -1 ? "Yes" : "No"); } B - FizzBuzz Sum…
The PASCAL Object Recognition Database Collection News 04-Apr-07: The VOC2007 challenge development kit is now available. Objectives To compile a standardised collection of object recognition databases To provide standardised ground truth object anno…
This table lists the built-in colormaps functions. Colormap Name Color Scale parula…
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…
Problem Statement There are N squares arranged in a row. The squares are numbered 1, 2, …, N, from left to right. Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied.…
题目传送门:https://arc074.contest.atcoder.jp/tasks/arc074_c 题目翻译 给你一行\(n\)个格子,你需要给每个格子填红绿蓝三色之一,并且同时满足\(m\)个约束.每个约束由\(l,r,x\)来形容,表示\(l\)到\(r\)之间的所有格子颜色种数必须为\(x\),求方案数.\(n,m\leqslant 300\) 题解 设\(f[i][j][k]\)表示当前已经涂到了\(x=max\){\(i,j,k\)},最后一个红色格子在\(i\),最后一个绿…
题目链接:http://arc074.contest.atcoder.jp/tasks/arc074_c 题意:一共有3种颜色,红色,绿色,蓝色.给出m个要求l,r,x表示在区间[l,r]内要有x种不同的颜色. 问满足所有要求的染色方式一共有几种. 题解:一般问一共有几种组合方式要么推数学公式,要么就是dp. 不妨设dp[r][g][b]表示是k=max(r,g,b)前k个染色后r色结尾的位置为r,g色结尾的位置为g,b色结尾的位置为b. 显然转移为dp[k+1][g][b]+=dp[r][g]…
C - Chocolate Bar 题面 There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle…
[arc074e]RGB Sequence(动态规划) 题面 atcoder 洛谷 翻译见洛谷 题解 直接考虑暴力\(dp\),设\(f[i][j][k][l]\)表示当前考虑到第\(i\)位,最后一个红绿蓝色出现的位置是哪里,发现显然\(i=max(j,k,l)\),所以只有三维了,直接\(dp\)即可.至于限制每次在右端点考虑一下就好了. #include<iostream> #include<cstdio> #include<vector> using names…