UVa 1262  Password 题目: Password   Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description  Shoulder-surfing is the behavior of intentionally and stealthily watching the screen of another person's electronic…
UVA.12716 GCD XOR (暴力枚举 数论GCD) 题意分析 题意比较简单,求[1,n]范围内的整数队a,b(a<=b)的个数,使得 gcd(a,b) = a XOR b. 前置技能 XOR的性质 GCD 由于题目只给出一个n,我们要求对数,能做的也始终暴力枚举a,b,这样就有n^2的复杂度,由于n很大,根本过不了. 于是我们就想用到其中一些性质,如XOR 与GCD,不妨假设 a xor b = c,并且根据题意还知道, gcd(a,b) = c,也就说明c一定是a的因子,所以在枚举的…
题意:给两个6行5列的字母矩阵,找出满足如下条件的“密码”:密码中的每个字母在两个矩阵的对应列中均出现.给定k(1<=k<=7777),你的任务是找出字典序第k小的密码.如果不存在,输出NO. 分析:因为k<=7777,直接按字典序从小到大的顺序递归一个一个的枚举. 注意:定义在dfs里的vis不能放在全局,否则会导致值的混用. #pragma comment(linker, "/STACK:102400000, 102400000") #include<cst…
Password Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVA. Original ID: 1262 64-bit integer IO format: %lld      Java class name: Main pid=18400" class="btn" style="">Prev Submit showpid=18401"…
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3703 题意: 给两个6行5列的字母矩阵,找出满足如下条件的“密码”:密码中的每个字母在两个矩阵的对应列中均出现.例如,左数第2个字母必须在两个矩阵中的左数第2列中均出现.给定k(1≤k≤7777),你的任务是找出字典序第k小的密码.如果不存在,输出NO. 分析: 经典的解码问题.首…
  Problem G. Birthday Cake Background Lucy and Lily are twins. Today is their birthday. Mother buys a birthday cake for them.Now we put the cake onto a Descartes coordinate. Its center is at (0,0), and the cake's length of radius is 100. There are 2N…
[题意]:输入正整数n,用0~9这10个数字不重复组成两个五位数abcde和fghij,使得abcde/fghij的商为n,按顺序输出所有结果.如果没有找到则输出“There are no solutions for N.”.这里2<=n<=79. [分析]: 1.因为n>=2,且abcde=fghij×n,满足abcde>fghij.若a=0,则fghij的最小值为12345,abcde<fghij,矛盾.所以a≠0. 2.因为a≠0,所以12345<=abcde&l…
10603 Fill There are three jugs with a volume of a, b and c liters. (a, b, and c are positive integers not greater than 200). The rst and the second jug are initially empty, while the third is completely lled with water. It is allowed to pour water f…
https://vjudge.net/problem/UVA-1262 字典序第k小 注意两点: 1. k-- 2.去重 #include<cstring> #include<cstdio> #include<set> #include<algorithm> using namespace std; ][][]; ][],ans[],suc[]; ]; int main() { int T,n; scanf("%d",&T); w…
  How Big Is It?  Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in which they fit. All circles must touch the bottom of the b…