Description All submissions for this problem are available. Read problems statements in Mandarin Chinese, Russian and Vietnamese as well. Chef is a big fan of soccer! He loves soccer so much, that he even invented soccer for his pet dogs! Here are th…
All submissions for this problem are available. Read problems statements in Mandarin Chinese, Russian and Vietnamese as well. You might have heard about our new goodie distribution program aka the "Laddu Accrual System". This problem is designed…
Description All submissions for this problem are available. Read problems statements in Mandarin Chinese, Russian and Vietnamese as well. Chef is the head of commercial logging industry that recently bought a farm containing N trees. You are given in…
Codechef April Challenge 2019 游记 Subtree Removal 题目大意: 一棵\(n(n\le10^5)\)个结点的有根树,每个结点有一个权值\(w_i(|w_i\le10^9|)\).你可以进行若干次(包括\(0\)次)操作,每次你可以选择一个连通块,将其删去.若你的操作次数为\(k\),则总收益为剩下结点权值之和\(-X\cdot k\).求最大总收益. 思路: 树形DP,\(f_x\)表示以\(x\)为根的子树的最大总收益.转移时\(f_x=w_x+\s…
Codechef October Challenge 2018 游记 CHSERVE - Chef and Serves 题目大意: 乒乓球比赛中,双方每累计得两分就会交换一次发球权. 不过,大厨和小厨用了另外一种规则:双方每累计得 K 分才会交换发球权.比赛开始时,由大厨发球. 给定大厨和小厨的当前得分(分别记为 P1 和 P2),请求出接下来由谁发球. 思路: \((P1+P2)\%K\)判断奇偶性即可. 代码链接 BITOBYT - Byte to Bit 题目大意: 在字节国里有三类居民…
Codechef September Challenge 2018 游记 Magician versus Chef 题目大意: 有一排\(n(n\le10^5)\)个格子,一开始硬币在第\(x\)个格子里.\(m(m\le10^4)\)次操作,每次交换指定的两个格子.问最后硬币在第几个格子里. 思路: 按题意模拟即可. 源代码: #include<cstdio> #include<cctype> inline int getint() { register char ch; whi…
比赛链接:https://www.codechef.com/FEB18,题面和提交记录是公开的,这里就不再贴了 Chef And His Characters 模拟题 Chef And The Patents 模拟题 Permutation and Palindrome 模拟题 Car-pal Tunnel 结论比较简单 Broken Clock 求余弦的n倍角,可以用复数的快速幂解决 $cos(a)=x \\ sin(a)=\sqrt{1-x^2} \\ cos(na) = Re((x+\sq…
Preface 这场CC好难的说,后面的都不会做QAQ 还因为不会三进制位运算卷积被曲明姐姐欺负了,我真是太菜了QAQ PS:最后还是狗上了六星的说,期待两(三)场之内可以上七星 Physical Exercise 本来T1放的是一个思维题,然后被Ban了现在变成一个SB题了 爆枚前两个点集的点,然后预处理前两个点集的每个点与第三个点集所有点之间距离的最小值即可通过此题 #include<cstdio> #include<cmath> #include<iostream>…
题目链接:http://www.codechef.com/JAN14/problems/SEAGRP [题意] 给n个点,m条边的无向图,判断是否有一种删边方案使得每个点的度恰好为1. [分析] 从结论入手,每个点的度恰好为1,那么就意味着每个点只能连接一个点,这样问题就转化为图中的点能否刚好两两配对. 对于奇数个点肯定是不行的,因为一定存在一个点不存在与之配对的点.    如果点是偶数,那么就要求这个图的最大匹配,看匹配树是否为点数的一半. 求匹配的方法和二分图类似,不断找增广路更新匹配数就好…
The Street Problem Code: STREETTA https://www.codechef.com/problems/STREETTA Submit Tweet All submissions for this problem are available. Read problems statements in Mandarin Chineseand Russian. The String street is known as the busiest street in Cod…