![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
Dejavu1z
做题,总结,不断的学习
展开
-
codeforces 1349A(数学)
题意描述思路题意要求求出gcd(lcm(ai,aj))∣i<jgcd(lcm(a_{i},a_{j})) | i<jgcd(lcm(ai,aj))∣i<j,由于lcm(ai,aj)=ai∗aj/gcd(ai,aj)lcm(a_{i},a_{j})=a_{i}*a_{j}/gcd(a_{i},a_{j})lcm(ai,aj)=ai∗aj/gcd(ai,aj),故得到式子gcd(ai∗aj/gcd(ai,aj))gcd(a_{i}*a_{j}/gcd(a_{i},a_{j原创 2020-10-15 19:54:43 · 184 阅读 · 0 评论 -
codeforces 1216D(数学)
题意描述There were n types of swords in the theater basement which had been used during the plays. Moreover there were exactly x swords of each type. y people have broken into the theater basement and each of them has taken exactly z swords of some single typ原创 2020-09-08 16:07:45 · 198 阅读 · 0 评论 -
codeforces 515C (数学)
题意描述定义F(x)为x的每一位的阶乘之积,求F(a)=F(x),使a尽可能的大思路通过观察可以发现4!=3!+2!+2!4!=3!+2!+2!4!=3!+2!+2!6!=5!+3!6!=5!+3!6!=5!+3!8!=7!+2!+2!+2!8!=7!+2!+2!+2!8!=7!+2!+2!+2!9!=7!+3!+3!+2!9!=7!+3!+3!+2!9!=7!+3!+3!+2!所以我们统计一下个数,然后sort一下输出即可AC代码#include<bits/stdc++.h>原创 2020-09-06 10:56:38 · 194 阅读 · 0 评论 -
codeforces 1005D(数学)
题意描述给定一个字符串s,询问有s最多能够分成几部分可以被3整除思路我们发现,如果连续三位的数都不能被3整除,那么这三位加起来一定可以被整除。所以我们遍历一遍即可。AC代码#include<bits/stdc++.h>#define x first#define y second#define PB push_back#define mst(x,a) memset(x,a,sizeof(x))#define all(a) begin(a),end(a)#define rep原创 2020-08-02 13:46:36 · 190 阅读 · 0 评论 -
codeforces 1364B(数学)
题意描述Given a permutation p of length n, find its subsequence s1, s2, …, sk of length at least 2 such that:|s1−s2|+|s2−s3|+…+|sk−1−sk| is as big as possible over all subsequences of p with length at least 2.Among all such subsequences, choose the one whos原创 2020-08-01 16:41:16 · 197 阅读 · 0 评论 -
codeforces 1366B(线段相交)
题意描述You are given an array consisting of n integers a1, a2, …, an. Initially ax=1, all other elements are equal to 0.You have to perform m operations. During the i-th operation, you choose two indices c and d such that li≤c,d≤ri, and swap ac and ad.Calc原创 2020-08-01 15:13:30 · 155 阅读 · 0 评论