C. Anadi and Domino 题目链接:https://codeforces.com/contest/1230/problem/C Anadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every aa and bb such that 1≤a≤b≤61≤a≤b≤6, there is exactly one domino with aa dots o…
题目链接:http://codeforces.com/contest/1230/problem/C C. Anadi and Domino time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output 题目大意: 两个骰子可以进行组合,第一个大于等于第二个骰子,每个骰子6种情况所以一共有21中图形.给一个无向图,向边上放置上述图…
C - Anadi and Domino 参考:Anadi and Domino 思路:分为两种情况: ①n<=6,这个时候肯定可以保证降所有的边都放上一张多米诺牌,那么答案就是m ②n==7,在这种情况下肯定会出现某两个点a和b是靠一张两端同点数的多米诺牌连接起来的,而这个时候如果又有一个点同时与这两个点a和b都有一条边,那么,只能够在其中一条边上放多米诺牌,而另外一边不可以.那么我们就可以将它分成两部分,一个是连接a的边,一个是连接b的边,那么为了连接更多的边,那么我们只需要得出我们最少的不…
链接: https://codeforces.com/contest/1230/problem/C 题意: Anadi has a set of dominoes. Every domino has two parts, and each part contains some dots. For every a and b such that 1≤a≤b≤6, there is exactly one domino with a dots on one half and b dots on th…
C. New Year and Rating time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Every Codeforces user has rating, described with one integer, possibly negative or zero. Users are divided into two d…
传送门 A. Dawid and Bags of Candies 乱搞. Code #include <bits/stdc++.h> #define MP make_pair #define fi first #define se second #define sz(x) (int)(x).size() //#define Local using namespace std; typedef long long ll; typedef pair<int, int> pii; con…
New Year and Domino CodeForces - 611C 他们说:“每一年都像多米诺骨牌,一个接一个地倒下去”.但是,一年能够像多米诺骨牌那样放在网格中吗?我不这么认为. Zydsg最近得到了一个有h行和w列的矩形网格.每个单元格是一个正方形,可以是空的(用'.'表示)或非空的(用“#”表示).行从上到下编号为1到h.列从左到右编号为1到w. 另外,Zydsg有一个多米诺骨牌.他想把它放在一个网格的某个地方.多米诺骨牌将占据两个相邻的单元格,位于一行或一列中.两个相邻的单元必须…
向别人学习一波,记点流水帐.17.5.29开坑. 5.29 早晨看了道据说是树状数组优化DP的题(hdu5542),然后脑补了一个复杂度500^3的meet in the middle.然后死T...弃疗. 上午考试有一道sb线段树和一道简单数位DP.还有一道是毕姥爷在WC讲的"超立方体".对着数据范围的表格写了半天部分分然后你告诉我测试数据和这个数据范围根本不一样? 并不会FWT,又因为不太想学新算法,就决定不改题了. 下午先把某个课件的坑填完了.然后在bzoj上乱逛. 决定写写SD…
This is the first time I took part in Codeforces Competition.The only felt is that my IQ was contempted.The problem in Div2 was so...em,how to say,anyway I even daren't to believe.Yesterday I solved two fifths of problems.You see? I'm just a guy full…
C. New Year and Domino 题目连接: http://www.codeforces.com/contest/611/problem/C Description They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't think so. Limak is a little polar bear who loves…
Problem Codeforces #541 (Div2) - E. String Multiplication Time Limit: 2000 mSec Problem Description Input Output Print exactly one integer — the beauty of the product of the strings. Sample Input 3aba Sample Output 3 题解:这个题的思维难度其实不大,需要维护什么东西很容易想到,或…
Problem Codeforces #541 (Div2) - F. Asya And Kittens Time Limit: 2000 mSec Problem Description Input The first line contains a single integer nn (2≤n≤150000) — the number of kittens. Each of the following n−1lines contains integers xi and yi (1≤xi,…
Problem Codeforces #541 (Div2) - D. Gourmet choice Time Limit: 2000 mSec Problem Description Input Output The first line of output should contain "Yes", if it's possible to do a correct evaluation for all the dishes, or "No" otherwis…
Problem Codeforces #548 (Div2) - D.Steps to One Time Limit: 2000 mSec Problem Description Input The first and only line contains a single integer mm (1≤m≤100000,1≤m≤100000). Output Print a single integer — the expected length of the array aa writte…