题解-比赛CF1332】的更多相关文章

题解-比赛CF1332 比赛CF1332 [A] [B] [C] [D] [E] [F] [G] [A]Exercising Walk Exercising Walk \(T\) 组测试数据,每次给定 \(a,b,c,d,x,y,x_1,y_1,x_2,y_2\).起点是 \((x,y)\),要左走 \(a\) 步,右走 \(b\) 步,下走 \(c\) 步,上走 \(d\) 步(这题的 \(x\) 和 \(y\) 轴与平时相反).求是否有走法,使得走的过程中总是满足 \(x_1\le x\le…
比赛 match Description 有 N 支队伍打比赛.已知有如下条件: • 每支队伍恰好打了 4 场比赛 • 对于一场比赛,如果是平局,双方各得 1 分:否则胜者得 3 分,负者不得分 给定每支队伍的初始分数(这时候还没有发生任何比赛).问编号为 1 的队伍在最优情况下的名次是多 少. Input 输入的第一行有一个整数 N (5 ≤ N ≤ 50) . 接下来一行 N 个整数,依次描述编号为 1 ∼ N 的队伍的初始分数. Output 输出一行一个整数,描述最优情况下,编号为 1…
题面 传送门 题解 比赛的之后做完\(AB\)就开始发呆了--简直菜的一笔啊-- \(A - Colorful\ Subsequence\) 如果第\(i\)个字母选,那么它前面任意一个别的字母的选择方法为\(cnt_x+1\)种,其中\(cnt_x\)为出现次数,直接乱搞就行了 //minamoto #include<bits/stdc++.h> #define R register #define ll long long #define fp(i,a,b) for(R int i=(a)…
"Oh, There is a bipartite graph.""Make it Fantastic."X wants to check whether a bipartite graph is a fantastic graph. He has two fantastic numbers, and he wants to let all the degrees to between the two boundaries. You can pick up seve…
Jam's balance Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 370    Accepted Submission(s): 173 Problem Description Jim has a balance and N weights. (1≤N≤20) The balance can only tell whether t…
E.Easy Problem Description: Zghh likes number, but he doesn't like writing problem description. So he will just give you a problem instead of telling a long story for it. Now given a positive integer x and k digits a1,a2,...,ak, can you find a positi…
layout: post title: 2018 German Collegiate Programming Contest (GCPC 18) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces 传送门 付队博客 C.Coolest Ski Route (记忆化搜索) 题意 给出一个有向图,求出一个权值最长的链, 题解 暴力dfs会超时,所以直接储存每个起点能走到的最远距离 #include<…
本次是弱校题解-比赛链接 备用链接 题目还是比较基础,比较简单.认真补题,学会学习. A -人见人爱A^B 题解: 求 A的B次方,我们可以用循环进行累乘操作,进而计算出次方.因为题目要求只需要求出最后三位,所以每次对 1000 求余数,最后输出即可. #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> int main() { int n,m; while(sca…
传送门 题解 比赛的时候光顾着算某一个\(n\)的答案是多少忘了考虑不同的\(n\)之间的联系了--而且我也很想知道为什么推着推着会变成一个二项式反演-- 设\(f_n\)为\(n\)块积木时的总的层数,\(g_n\)为\(n\)块积木时总的方案数,则有\[g_n=\sum_{i=1}^n\binom{n}{i}g_{n-i}\] \[f_n=g_n+\sum_{i=1}^n\binom{n}{i}f_{n-i}\] \(g\)的话就是枚举第一层有哪几个,\(f\)的话也是枚举第一层有几个,前面…
TV Show Game 题目描述 Mr. Dajuda, who is famous for a TV show program, occasionally suggests an interesting game for the audience and gives them some gifts as a prize. The game he suggested this week can be explained as follows. The k(> 3) lamps on the s…