【题目描述】给出A,B,考虑所有满足l<=a<=A,l<=b<=B,且不存在n>1使得n^2同时整除a和b的有序数,对(a,b),求其lcm(a,b)之和。答案模2^30。 【输入】第一行一个整数T表示数据组数。接下来T行每行两个整数A,B表示一组数据。 T ≤ 2000,A,B ≤ 4 × 10^6 【输出】对每组数据输出一行一个整数表示答案模2^30的值 【输入样例】5
2 2
4 6
3 4
5 1
23333 33333 【输出样例】7
148
48
15
451085813 这道题网上很多题解是化出了一个函数然后快速求这个函数
【题目描述】给出N个圆,求其面积并 【输入】先给一个数字N ,N< = 1000 接下来是N行是圆的圆心,半径,其绝对值均为小于1000的整数 【输出】面积并,保留三位小数 辛普森积分实在太强了……它相当于用很多1、2、3次函数去拟合一个函数以达到轻松计算积分的目的。这里给一篇博客,讲的很好:一篇博客然后有一些小小的优化:为了解决函数不连续的问题,可以设置一个限定长度,让辛普森积分只在值域范围在限定长度以内的情况下才停止递归。然后有一个精度优化,辛普森的eps可以设置成每向下递归一层就除以2,效果拔群。#include<cstdio>
#include<algorith
【题目描述】同一时刻有N位车主带着他们的爱车来到了汽车维修中心。维修中心共有M位技术人员,不同的技术人员对不同的车进行维修所用的时间是不同的。现在需要安排这M位技术人员所维修的车及顺序,使得顾客平均等待的时间最小。 说明:顾客的等待时间是指从他把车送至维修中心到维修完毕所用的时间。 【输入】第一行有两个m,n,表示技术人员数与顾客数。 接下来n行,每行m个整数。第i+1行第j个数表示第j位技术人员维修第i辆车需要用的时间T。 【输出】最小平均等待时间,答案精确到小数点后2位。 【输入样例】2 2
3 2
1 4 【输出样例】1.50 【提示】数据范围: (2<
Problem Description Perhaps the sea‘s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling for my best lover Arrietty, but even that is not enough.Suppose the shell necklace is a sequence of shells (not a chain end to end
Problem description.You are given a tree. If we select 2 distinct nodes uniformly at random, what's the probability that the distance between these 2 nodes is a prime number? InputThe first line contains a number N: the number of nodes in this tree. The following N-1 lines contain pairs a[i] and b[i
Description懒得写背景了,给你一个字符串init,要求你支持两个操作 (1):在当前字符串的后面插入一个字符串 (2):询问字符串s在当前字符串中出现了几次?(作为连续子串) 你必须在线支持这些操作。 Input第一行一个数Q表示操作个数 第二行一个字符串表示初始字符串init 接下来Q行,每行2个字符串Type,Str Type是ADD的话表示在后面插入字符串。 Type是QUERY的话表示询问某字符串在当前字符串中出现了几次。 为了体现在线操作,你需要维护一个变量mask,初始值为0 读入串Str之后,使用这个过程将之解码成真
2018-07-22 09:54:21
507
0
0
此帖存放此前博客每周更换的背景音乐,如果喜欢都可以在网易云里找到哦~Week 1 :蓝调风暴 The Storm [BluesRemix] --- 跳舞的线 Dancing Line Week 2 :Where The Heart Is (Replacer Remix) --- Replacer Week 3 :The History of Ponyville --- MelodicPony Week 4 :The Moonlit Meadow --- Frozen Night
Problem StatementWe have a grid with H rows and W columns of squares. We will represent the square at the i-th row from the top and j-th column from the left as (i, j). Also, we will define the distance between the squares (i1, j1) and (i2,
题目描述A parade of all elephants is to commence soon at the Byteotian zoo. The zoo employees have encouraged these enormous animals to form a single line, as the manager wills it to be the initial figure of the parade. Unfortunately, the manager himself came to the parade and did not quite like what he
题意翻译描述 掷骰子是一种双人游戏,它的结果是完全随机的。最近它在整个Byteotia变得非常流行。在Byteotia的首都甚至有一个特别的掷骰子业余爱好者俱乐部。俱乐部的老主顾们花时间互相聊天并每隔一阵子就和一个随机选择的对手玩这他们最喜欢的游戏。一天中赢得最多游戏的人会得到“幸运者”头衔。有时晚上俱乐部很安静,只有很少的比赛。这是哪怕赢一场也能获得“幸运者”头衔的时间。 很久很久以前有一个很不走运的人,叫Byteasar,赢得了这个光荣的头衔。他被深深地震惊了以至于完全忘了他已经赢了多少场。现在他想知道他有多幸运,以及幸运之神是否最终会向他微笑——也许他的运气会变好?他确切地知道在那个幸运