Is Derek lying? Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 612    Accepted Submission(s): 353 Problem Description Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.Thi…
题目链接 Problem Description zk has n numbers a1,a2,...,an. For each (i,j) satisfying 1≤i<j≤n, zk generates a new number (ai+aj). These new numbers could make up a new sequence b1,b2,...,bn(n−1)/2. LsF wants to make some trouble. While zk is sleeping, Ls…
题目链接 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta has n positive A1−An and their sum is m. Then for each subset S of A, Yuta ca…
题目链接 Problem Description In the mathematical discipline of graph theory, a bipartite graph is a graph whose vertices can be divided into two disjoint sets U and V (that is, U and V are each independent sets) such that every edge connects a vertex in…
题目链接 Problem Description Have you ever seen the wave? It's a wonderful view of nature. Little Q is attracted to such wonderful thing, he even likes everything that looks like wave. Formally, he defines a sequence a1,a2,...,an as ''wavel'' if and only…
题目链接 Problem Description RXD is a good mathematician. One day he wants to calculate: ∑i=1nkμ2(i)×⌊nki−−−√⌋ output the answer module 109+7. 1≤n,k≤1018 μ(n)=1(n=1) μ(n)=(−1)k(n=p1p2-pk) μ(n)=0(otherwise) p1,p2,p3-pk are different prime numbers Input Th…
题面传送门 一道非常不错的 FWT+插值的题 %%%%%%%%%%%% 还是那句话,反正非六校的看不到题对吧((( 方便起见在下文中设 \(n=2^d\). 首先很明显的一点是这题涉及两个维度:异或和与选出的元素的个数.因此考虑像子集卷积那样建立一个二元生成函数表示这个东西,具体来说我们定义一个幂级数 \(F\)​​ 形如 \(\sum\limits_{n\ge 0}\sum\limits_{m\ge 0}f_{n,m}x^ny^m\)​​,并定义两个幂级数 \(F,G\)​​ 的乘法得到的幂级…
由于 NFLSOJ 题面上啥也没有就把题意贴这儿了( 没事儿,反正是上赛季的题,你们非六校学生看了就看了,况且看了你们也没地方交就是了 题意: 给你一张 \(n\) 个点 \(m\) 条边的图 \(G=(V,E)\). 要求有多少张子图 \(G'=(V',E')\)​ 满足 \(G'\) 是连通二分图. \(n\le 20,m\le\dfrac{n(n-1)}{2}\) 答案对 \(998244353\) 取模. 输入样例 #1: 3 3 1 2 1 3 2 3 输出样例 #1: 9 众所周知,…
Description ?? is practicing his program skill, and now he is given a string, he has to calculate the total number of its distinct substrings. But ?? thinks that is too easy, he wants to make this problem more interesting. ?? likes a character X very…
本场比赛的三个水题之一,题意是两个玩家每人都持有一手牌,问第一个玩家是否有一种出牌方法使得在第一回和对方无牌可出.直接模拟即可,注意一次出完的情况,一开始没主意,wa了一发. #include<cstdio> #include<string> #include<cstring> #include<iostream> #include<algorithm> using namespace std; char s[3][30]; int player…
Bubble Sort Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 224    Accepted Submission(s): 147 Problem Description P is a permutation of the integers from 1 to N(index starting from 1). Here is…
这题起初没读懂题意,悲剧啊,然后看了题解写完就AC了 题意是给一个N,然后给N+1个整数 接着给N个操作符(只有三种操作  即  或 ,与 ,和异或 |   &  ^ )这样依次把操作符插入整数之间就可以得到一个表达式 接着给出 N 给浮点数(在0~1之间表示概率 )表示的是 操作符和他右边的整数丢失的概率. 例如下面这组数据 1 1 2 & 0.5 整数与操作符间可以组成一个表达式即 1&2 但是由于某些原因表达式的操作符和他操作的右边的 那个数有一定的概率会丢失这组数据就是 &…
题目连接:Click here 题意:在一个[L,R]内找到最大的gcd(f[i],f[j])其中L<=i<j<=R,f[x]表示i分解质因数后因子的种类数.eg:f[10]=2(10=2*5),f[12]=2(12=2*2*3). 分析:很容易想到先将f[x]求出来,这里x最大1e6,要在常数时间内求出f[x].并且稍加分析就知道1<=f[x]<=7,可以用一个dp[i][j]表示从f[1]到f[i]有多少个j.这样就可以在常数时间内预处理出来,后面在O(1)的时间内就可以…
题目连接:戳ME #include <iostream> #include <cstdio> #include <cstring> using namespace std; ; int n, k; int par[M]; int sum[M]; void find(int x) { if( par[x]!=x ) { sum[par[x]]++; find(par[x]); } else return; } int main() { while( ~scanf(&quo…
点击打开链接 我就不说官方题解有多坑了 V图那么高端的玩意儿 被精度坑粗翔了 AC前 AC后 简直不敢相信 只能怪自己没注意题目For the distance d1 and d2, if fabs(d1-d2)<1e-7, we think d1 == d2 有空再补充V图的做法吧..本人也是第一次接触V图 //大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <se…
描述 LT最近一直在无限循环薛之谦的歌,简直都中毒了!可是呢…他的歌LT还是不会唱(其实不止他的歌LT不会唱,所有人的歌LT都不会唱…因为LT是标准的音痴)可是LT又很喜欢唱歌(所以LT不仅是音痴还是音痴)…没错,这对于LT的室友来说简直是噩梦… 现在呢,LT有N次操作,每次操作只会有两种可能: I a: 表示着LT使用唱歌软件唱歌得到的分数. Q k: 表示着LT想知道自己得到的第k小的分数是多少.(如果没有第k小,输出-1)   输入 有多组输入(不超过20组),每组输入的第一行是一个N,表…
描述  有N个人,N个活动, 每个人只会对2个或者3个活动感兴趣,  每个活动也只有两个人或者两个活动对它兴趣,每个人参加一个  感兴趣的活动需要一天 ,且当天该活动被参加时,其他的人不能参加  如果每个人都参加完自己有兴趣的活动,应当怎样安排使得所用总天数时间最短 2<= N <=1000, 1<=m<=1000;   输入 一个数T 表示T 组数据每组一个N表示人数,编号1 -- N , 一个数 m ,接下来m 行每个两个数x,y, 表示第 x 个人对第y个活动感兴趣 输出 每…
题目链接 Problem Description At Valentine's eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of them, and locked them into two separate cells of the jail randomly. But as the saying goes:…
题目链接 Problem Description Giving two strings and you should judge if they are matched. The first string contains lowercase letters and uppercase letters. The second string contains lowercase letters, uppercase letters, and special symbols: "." an…
题目链接 Problem Description The Eternal Fleet was built many centuries ago before the time of Valkorion by an unknown race on the planet of Iokath. The fate of the Fleet's builders is unknown but their legacy would live on. Its first known action was in…
题目链接 Problem Description The Death Star, known officially as the DS-1 Orbital Battle Station, also known as the Death Star I, the First Death Star, Project Stardust internally, and simply the Ultimate Weapon in early development stages, was a moon-si…
题目链接 Problem Description Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek originated from the Wookiee home planet of Kashyyyk as…
题目链接 Problem Description Kyber crystals, also called the living crystal or simply the kyber, and known as kaiburr crystals in ancient times, were rare, Force-attuned crystals that grew in nature and were found on scattered planets across the galaxy.…
题目链接 Problem Description There are n nonnegative integers a1-n which are less than p. HazelFan wants to know how many pairs i,j(1≤i<j≤n) are there, satisfying 1ai+aj≡1ai+1aj when we calculate module p, which means the inverse element of their sum equ…
题目链接 Problem Description HazelFan wants to build a rooted tree. The tree has n nodes labeled 0 to n−1, and the father of the node labeled i is the node labeled ⌊i−1k⌋. HazelFan wonders the size of every subtree, and you just need to tell him the XOR…
题目链接 Problem Description There is a nonnegative integer sequence a1...n of length n. HazelFan wants to do a type of transformation called prefix-XOR, which means a1...n changes into b1...n, where bi equals to the XOR value of a1,...,ai. He will repea…
题目链接 Problem Description There are n points on the plane, and the ith points has a value vali, and its coordinate is (xi,yi). It is guaranteed that no two points have the same coordinate, and no two points makes the line which passes them also passes…
题目链接 Problem Description Bob has a dictionary with N words in it. Now there is a list of words in which the middle part of the word has continuous letters disappeared. The middle part does not include the first and last character. We only know the pr…
题目链接 Problem Description The center coordinate of the circle C is O, the coordinate of O is (0,0) , and the radius is r. P and Q are two points not outside the circle, and PO = QO. You need to find a point D on the circle, which makes PD+QD minimum.…
题目链接 Problem Description Alice and Bob are playing a game called 'Gameia ? Gameia !'. The game goes like this : There is a tree with all node unpainted initial. Because Bob is the VIP player, so Bob has K chances to make a small change on the tree an…