Just Skip The Problem】的更多相关文章

2019 Multi-University Training Contest 2: 1010 Just Skip The Problem 自闭记 题意 多测.每次给你一个数\(n\),你可以同时问无数次,每次问的是一个数\(y_i\),你会得到的回答是\(x\&y_i\)是否为\(y_i\),问你问的最少的次数的种数\(\%1e6+3\),可以调换顺序 10min 得出数学方法 求\(n!\%1e6+3\). 50min 自闭 5min 写出裸暴力,优化10min,交一发TLE 30min 网上…
-----------------心怀虔诚,奋勇前进,fighting!!!!!! Problem Description: inclusively:          包括一切地;包含地 simultaneously:   同时 index number   : 指数; 索引编号 if and only if:       当且仅当 -----Rough Translation: Input: Output: For each test case, output one line contai…
http://acm.hdu.edu.cn/showproblem.php?pid=6600 题意:给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能求出xi是几,求出这样询问次数最少的询问方案数. 最优方案就是对每位进行询问,每次只让yi的一位是1,一共n个二进制位.方案数为n! #include<bits/stdc++.h> using namespace std; #define ll long long ; ; ll a[maxn];…
题意:询问n!模1e6+7的结果 n<=1e9 思路: #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int,int> PII; typedef pair<ll,ll> Pll; typedef vector<int> VI…
题意: 给你一个数x,允许你多次询问yi,然后回答你x xor yi 是否等于yi,询问尽量少的次数以保证能求出xi是几,求出这样询问次数最少的询问方案数. 结果mod1e6+3 题解: 队友赛时很快想(cai)出最优方案是每次只让yi的一位是1,因此最优方案数是n! 然后很快wa/t到哭 粘了个几百行的二分求阶乘的板子,预处理出一堆0,一脸懵逼地除虫 最后终于发现,TMD,n!mod 1e6+3 在n>=1e6+3的情况下,都等于0 #include<iostream> #define…
1.直接令x=0,为了判断这一信息,对于所有含有多个1的yi,必然是无用的,答案至少为n且不能含有多位1的y2.令yi=2^(i-1),由此发现一定可以得到x每一位的答案,即答案最多为n.因此,发现方案数即n!,当$n\ge p$时答案一定为0,时间复杂度为o(p) 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define mod 1000003 4 int n,fac[mod]; 5 int main(){ 6 fac[0]=1;…
Polycarp is practicing his problem solving skill. He has a list of n problems with difficulties a1,a2,-,an, respectively. His plan is to practice for exactly k days. Each day he has to solve at least one problem from his list. Polycarp solves the pro…
2019 Multi-University Training Contest 2 A. Another Chess Problem B. Beauty Of Unimodal Sequence 题意 给一个序列,求下标字典序最小和字典序最大的,先增后减的序列. 解体过程 比赛时首先不知道字典序最小LIS怎么求. 试图枚举分界点.[解体的开始] 公无渡河,公竟渡河? 活鱼在摸鱼,rdc在划水,sdcgvhgj在水深火热. 做法 考虑字典序最小的LIS怎么求? 这是个经典问题,预处理前缀LIS后缀L…
B. Polycarp's Practice time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is practicing his problem solving skill. He has a list of nn problems with difficulties a1,a2,-,ana1,a2,-,an…
2019 Multi-University Training Contest 2 http://acm.hdu.edu.cn/contests/contest_show.php?cid=849 1005. Everything Is Generated In Equal Probability 考虑一个随机的排列的逆序对个数,显然对于两个数\(a,b\),他们位置是均匀排布的,也就是说有\(\frac{1}{2}\)的概率成为逆序对,并且是独立的. 所以一个长度为\(n\)的随机排列期望逆序对个…