![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
新周赛
文章平均质量分 79
Z~柳
这个作者很懒,什么都没留下…
展开
-
Dijkstra堆优化
Problem DescriptionSemon刚买了一辆宝马。他想把这个好消息告诉给他的好朋友GirlGod。Semon的家在编号为start的点上,而GirlGod的家在编号为end的点上。他的宝马可以稳定以1米每秒的速度从start到达end。而广州的路比较诡异,可以离散化为n个点(编号为1到n)和m条路。这m条路的两个端点一定是编号不同的两个的点。他的宝马没有导航,他很想知道从start...原创 2019-03-17 20:21:36 · 259 阅读 · 0 评论 -
hdu3033(分组背包)
分组背包其实是01背包的思想,因为虽然有多组,但实际上每次也是考虑单个是选择还是不选择的问题,只是多了个组别而已,各组看成是独立的,根据题意建立状态转化方程。http://acm.hdu.edu.cn/showproblem.php?pid=3033设置一个动态数组dp【i】【j】表示此时j元买前i种鞋最大价值(给鞋编种类从1到K);//#include<bits/stdc++.h&g...原创 2019-05-22 21:35:34 · 179 阅读 · 0 评论 -
fft模板(例题:hdu4609)
求A(x)*B(x)// fft模板.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//#include"pch.h"#include <iostream>#include<algorithm>#include<iostream>#include<string>#include<cstdio>...原创 2019-05-25 20:49:37 · 259 阅读 · 0 评论 -
hdu5605(莫比乌斯反演)
莫比乌斯反演公式若对于数论函数f(n)f(n)和F(n)F(n),有以下关系式:F(n)=∑d|n f(d)F(n)=∑d|n f(d)则其莫比乌斯反演公式定义为:f(n)=∑d|nμ(d)F(n/d)f(n)=∑d|nμ(d)F(n/d)它还有第二种形式:F(n)=∑n∣d f(d)⇒f(n)=∑n∣dμ(d/n)F(d)其中μ(x)函数是莫比乌斯函数x有平方数因子时,μ=0...原创 2019-05-08 15:14:01 · 301 阅读 · 0 评论 -
SPOJ GSS1(线段树)
You are given a sequence A[1], A[2], …, A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows:Query(x,y) = Max { a[i]+a[i+1]+…+a[j] ; x ≤ i ≤ j ≤ y }.Given M queries, your program...原创 2019-04-21 00:51:38 · 190 阅读 · 0 评论 -
HDU 6287 口算训练
小Q非常喜欢数学,但是他的口算能力非常弱。因此他找到了小T,给了小T一个长度为nn的正整数序列a1,a2,…,ana1,a2,…,an,要求小T抛出mm个问题以训练他的口算能力。每个问题给出三个正整数l,r,dl,r,d,小Q需要通过口算快速判断al×al+1×…×ar−1×aral×al+1×…×ar−1×ar是不是dd的倍数。小Q迅速地回答了出来,但是小T并不知道正确答案是什么,请写一个程...原创 2019-04-21 00:42:49 · 167 阅读 · 0 评论 -
lightoj 1341(求大数有多少个因子)
It’s said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery.Aladdin was about to enter to a magic...原创 2019-04-01 20:18:03 · 227 阅读 · 0 评论 -
hdu1042(大数压位)
给定整数 N (0 ≤ N ≤ 10000),你的任务是计算 N! 。输入每行一个整数 N,处理到文件结束为止。输出对于每个 N,输出一行,包含 N! 的计算结果。示例输入0123示例输出1126显然10000的阶乘是一个超大的数这里记录一种储存大数的办法,压位法其实就是把十进制改成所要的进制,比如压4位,就变成了1e4次方进制了,其他按正常的乘法计算就行了,如1...原创 2019-04-01 21:24:56 · 267 阅读 · 0 评论 -
poj2891(线性同余方程 中国剩余定理)
Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choose k different positive integers a1, a2, …, ak. Fo...原创 2019-04-03 09:23:03 · 211 阅读 · 0 评论 -
Gym - 101911D(转化为求因子)
Quite often the jury of Saratov SU use the problem “Masquerade” in different practice sessions before the contest. This problem is quite easy — all you need is to print the product of two integers whi...原创 2019-04-07 21:46:26 · 285 阅读 · 0 评论 -
HYSBZ - 2456(头文件也是要占内存的啊)
给你一个n个数的数列,其中某个数出现了超过n div 2次即众数,请你找出那个数。Input第1行一个正整数n。第2行n个正整数用空格隔开。Output一行一个正整数表示那个众数。Sample Input53 2 3 1 3Sample Output3Hint100%的数据,n≤500000,数列中每个数≤maxlongint。写多一个代码会死系列因为众数出现的次数超过...原创 2019-04-01 22:42:57 · 184 阅读 · 0 评论 -
hdu1525(简单博弈)
Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of the two numbers, prov...原创 2019-05-22 23:12:07 · 183 阅读 · 0 评论