浏览器标题切换
浏览器标题切换end

随笔分类 -  数论

摘要:Problem Description This is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. Input Each sequence is descr 阅读全文
posted @ 2019-09-12 16:49 抓水母的派大星 阅读(164) 评论(0) 推荐(0) 编辑
摘要:Solution1 #include<stdio.h> #include<iostream> #include<string.h> #define inf 0x3f3f3f3f typedef long long ll; using namespace std; int book[25][25][2 阅读全文
posted @ 2019-09-10 23:23 抓水母的派大星 阅读(316) 评论(0) 推荐(0) 编辑
摘要:##思路 周赛的一开始直接用book进行标记,后来TLE,然后改成map,继续TLE 后来想到用线段树写,但是没写对;想用树状数组写,结果发现不会写 ##AC代码(前缀和) //前缀和的做法 #include<stdio.h> #include<string.h> #include<iostream 阅读全文
posted @ 2019-09-09 22:01 抓水母的派大星 阅读(215) 评论(0) 推荐(0) 编辑
摘要:今天的周赛题,没有写的原因一是因为英文没看懂,而是因为以为是博弈题,博弈我不太会,所以这题也就没做。 题意 给出t组样例,每一组给出n、i、j,i和j表示其中两座塔的高度,要求Iaka和Yuwgna两人轮流造塔,Yuwgna先造,要求塔的高度只能是从已造的塔中进行i+j和i-j进行选择,不能和之前已 阅读全文
posted @ 2019-09-07 20:33 抓水母的派大星 阅读(161) 评论(0) 推荐(0) 编辑
摘要:题意 给出a、b区间,判断区间内素数所占百分比 思路 注意提前打表和控制精度1e-8的范围足够用了 细节处理 精度的处理 判断素数的方法(且返回值为bool) 数据类型的强制转换 保存素数个数 提前进行打表和保存区间素数个数,每次给出a、b直接输出答案就行。 AC代码 #include<stdio. 阅读全文
posted @ 2019-09-05 21:11 抓水母的派大星 阅读(237) 评论(0) 推荐(0) 编辑
摘要:题意: 求n^k的前三位leading和后三位treiling。 一开始英文是没看懂的, 第二次做是知道用什么方法,但也是个大概,因为很多小细节需要注意,强制转换和控制格式。 fmod函数的具体用法: https://www.runoob.com/cprogramming/c-function-fm 阅读全文
posted @ 2019-09-05 20:24 抓水母的派大星 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息: 密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0<=N<=5000)的正整数倍(如果存在多个满足条件的数,那么最小的 阅读全文
posted @ 2019-09-05 14:05 抓水母的派大星 阅读(174) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/weixin_41676881/article/details/80745177 如何判断一个十进制数转化成二进制度后二进制数一共有几位?一个十进制数a转化成二进制度后,要判断二进制数一共有几位,要看a的大小与2的几次方比较 输出为八进制数可以用%o,输出 阅读全文
posted @ 2019-09-03 15:44 抓水母的派大星 阅读(123) 评论(0) 推荐(0) 编辑
摘要:感觉这样看的比较清楚。 题意: 给出n和a,判断能否求出a^n+b^n=c^n中b和c的值,若可以输出b和c,否则则输出-1 -1。 思路: 数据给的比较大,但是题目很简单,套两个公式:费马打定理和奇偶数列法则分类讨论即可。 以下是对这两个法则的介绍: 费马大定理: 当整数n >2时,关于x, y, 阅读全文
posted @ 2019-08-22 19:33 抓水母的派大星 阅读(222) 评论(0) 推荐(0) 编辑
摘要:测试数据 Sample Input 3 BAPC BAPC AZA AZAZAZA VERDI AVERDXIVYERDIAN Sample Output 1 3 0 题意 计算模式串在原串中出现的次数 KMP 对于next数组的理解是理解kmp的关键。 next[i]:记录的是前后缀最长公共长度。 阅读全文
posted @ 2019-08-21 20:14 抓水母的派大星 阅读(163) 评论(0) 推荐(0) 编辑
摘要:As we all know, the next Olympic Games will be held in Beijing in 2008. So the year 2008 seems a little special somehow. You are looking forward to it 阅读全文
posted @ 2019-08-20 23:27 抓水母的派大星 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-08-19 22:02 抓水母的派大星 阅读(133) 评论(0) 推荐(0) 编辑
摘要:Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the d 阅读全文
posted @ 2019-08-19 15:49 抓水母的派大星 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Given the value of N, you will have to find the value of G. The definition of G is given below: 阅读全文
posted @ 2019-08-14 23:52 抓水母的派大星 阅读(98) 评论(0) 推荐(0) 编辑
摘要:As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B. T 阅读全文
posted @ 2019-08-14 23:51 抓水母的派大星 阅读(122) 评论(0) 推荐(0) 编辑
摘要:欧拉定理: 若正整数 a , n 互质,则 aφ(n)≡1(mod n) 其中 φ(n) 是欧拉函数(1~n) 与 n 互质的数。 费马小定理: 对于质数p,任意整数a,均满足:ap≡a(mod p) 欧拉定理的推论: 若正整数a,n互质,那么对于任意正整数b,有ab≡ab mod φ(n)(mod 阅读全文
posted @ 2019-08-13 21:39 抓水母的派大星 阅读(410) 评论(0) 推荐(0) 编辑
摘要:Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable. In this problem, you will be given tw 阅读全文
posted @ 2019-08-13 15:58 抓水母的派大星 阅读(189) 评论(0) 推荐(0) 编辑
摘要:1 int degree_in_fact(int n, int x)//求n!中素数x的次数 2 {3 if(m) 4 return degree_in_fact(n/x,x)+n/x; 5 return 0; 6 } 阅读全文
posted @ 2019-08-13 11:17 抓水母的派大星 阅读(142) 评论(0) 推荐(0) 编辑
摘要:A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24 阅读全文
posted @ 2019-08-12 21:21 抓水母的派大星 阅读(196) 评论(0) 推荐(0) 编辑
摘要:输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。 输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。 输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。 输入 第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 100 阅读全文
posted @ 2019-08-12 17:18 抓水母的派大星 阅读(157) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示