链接: 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…
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\)的方案数.则题目要…
目录 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/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…
D. Roman Digits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers…
链接: https://codeforces.com/contest/1234/problem/D 题意: You are given a string s consisting of lowercase Latin letters and q queries for this string. Recall that the substring s[l;r] of the string s is the string slsl+1-sr. For example, the substrings…
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.这--辣鸡三合…
链接: 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…