[codeforces 293]A. Weird Game 试题描述 Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn't show up, Yaroslav and Andrey play another game. Roman leaves a word for each of them. Each word consist…
[codeforces 293]B. Distinct Paths 试题描述 You have a rectangular n × m-cell board. Some cells are already painted some of k colors. You need to paint each uncolored cell one of the k colors so that any path from the upper left square to the lower right…
B. Weird Subtraction Process time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have two variables a and b. Consider the following sequence of actions performed with these variables: If …
计蒜客)翻硬币 //暴力匹配 #include<cstdio> #include<cstring> #define CLR(a, b) memset((a), (b), sizeof((a))) using namespace std; int n, m, t; int main() { int i, j, x; scanf("%d", &t); while(t--) { scanf("%d%d", &n, &m)…
D. Weird Chess Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/problem/D Description Igor has been into chess for a long time and now he is sick of the game by the ordinary rules. He is going to think of new rules of th…
F. Ehab and a weird weight formula 题目链接:https://codeforces.com/contest/1088/problem/F 题意: 给出一颗点有权值的树,满足只有一个点的权值最小,然后除开这个点,每个点都有一个权值比它更小的点与之相邻. 然后要求你重构这颗树,满足点权及边权和最小. 点权计算方法: au = au*num(num为与之相邻边的个数); 边权计算方法: e{u,v},we = dis(u,v)*min(au,av) (dis(u,v…
题目链接:http://codeforces.com/problemset/problem/788/B B. Weird journey time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little boy Igor wants to become a traveller. At first, he decided to vi…