Codeforces Round #589 (Div. 2)】的更多相关文章

Codeforces Round #589 (Div. 2)-E. Another Filling the Grid-容斥定理 [Problem Description] 在\(n\times n\)的格子中填入\([1,k]\)之间的数字,并且保证每一行至少有一个\(1\),每一列至少有一个\(1\),问有多少种满足条件的填充方案. [Solution] 令\(R[i]\)表示为第\(i\)行至少有一个\(1\)的方案数,\(C[i]\)表示第\(i\)列至少有一个\(1\)的方案数.则题目要…
Is that a kind of fetishism? No, he is objectively a god. 见识了一把 Mcdic 究竟出题有多神. (虽然感觉还是吹过头了) 开了场 Virtual 玩. 开场先秒了 AB.C 居然差点没做出来,有点耻辱. 开 D.怎么不会--Div. 2 的 D 都能卡住我,我心态崩了. 调到 E. woc 这不是 sb 题吗-- 回来肝 D.想了想口胡出来了,然而心态已经崩了,用了很长很长时间才打出来. 最后只剩 20min 时开 F.这--辣鸡三合…
目录 Contest Info Solutions A. Distinct Digits B. Filling the Grid C. Primes and Multiplication D. Complete Tripartite E. Another Filling the Grid Contest Info Practice Link Solved A B C D E F 5/6 O O O O Ø - O 在比赛中通过 Ø 赛后通过 ! 尝试了但是失败了 - 没有尝试 Solutions…
链接: https://codeforces.com/contest/1228/problem/E 题意: You have n×n square grid and an integer k. Put an integer in each cell while satisfying the conditions below. All numbers in the grid should be between 1 and k inclusive. Minimum number of the i-t…
链接: https://codeforces.com/contest/1228/problem/D 题意: You have a simple undirected graph consisting of n vertices and m edges. The graph doesn't contain self-loops, there is at most one edge between a pair of vertices. The given graph can be disconne…
链接: https://codeforces.com/contest/1228/problem/C 题意: Let's introduce some definitions that will be needed later. Let prime(x) be the set of prime divisors of x. For example, prime(140)={2,5,7}, prime(169)={13}. Let g(x,p) be the maximum possible int…
链接: https://codeforces.com/contest/1228/problem/B 题意: Suppose there is a h×w grid consisting of empty or full cells. Let's make some definitions: ri is the number of consecutive full cells connected to the left side in the i-th row (1≤i≤h). In partic…
链接: https://codeforces.com/contest/1228/problem/A 题意: You have two integers l and r. Find an integer x which satisfies the conditions below: l≤x≤r. All digits of x are different. If there are multiple answers, print any of them. 思路: 水题. 代码: #include…
https://codeforces.com/contest/1228/problem/A A. Distinct Digits 超级简单嘻嘻,给你一个l和r然后寻找一个数,这个数要满足的条件是它的每一位的数字不相同,找出满足要求的最小的那个数输出,没有找到就输出-1: #include<bits/stdc++.h> using namespace std; bool check(int n){ ]={}; while(n){ ]) vis[n%]=; else return false; n…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 其实这道题感觉有点狗. 思路大概是这样 先让所有的点都在1集合中. 然后随便选一个点x,访问它的出度y 显然tag[y]=2 因为和他相连了嘛 然后其他没有和x相连的点显然只能和x在同一个集合中 所以其他1集合的点你会发现你想改也没法改,就算他们有可能连在一起也没用,因为你不可能再把其他的1改成2了,因为会和你之前选的A冲突(和这个你想 改的2没有边相连) 这就是这题的主要ideal,就是抓住这一点做文章. 然后接着,我们仍然是随便找一个…