![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm(运用到数学知识的题)
题目
不会编程怎么行
fighting
展开
-
Max Sum
#include<bits/stdc++.h>using namespace std;const int N=1e5+10;int a[N],dp[N];int main(){ int t,k=0; cin>>t; while(t--) { int n; cin>>n; ...原创 2020-02-04 18:18:40 · 128 阅读 · 0 评论 -
Division by 3
思路:找到规律,模3取余 1 0 0 1 0 0 1 0 0…(1不能被3整除,0能被3整除)例1 0 0 1 0 0.1 0 0 。 。 。 。a b此时a=1,b=7,整除的个数为7-1-(7-1)/3个a和b同时都在模3取余为1的位置上其有b-a-(b-a)/3个可以被3整除,后面代码中利用sum计数,将a和b都移到最近的模3取余为1的位置上#...原创 2020-02-04 20:30:50 · 178 阅读 · 0 评论 -
Eyad and Math(对数转换)
Eyad was given a simple math problem, but since he is very bad at math he asked you to help him.Given 4 numbers, a, b, c, and d. Your task is to find whether ab is less than cd or not.It is guarante...原创 2020-02-18 15:52:28 · 132 阅读 · 0 评论 -
Power Strings
DescriptionGiven two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” then ab = “abcdef”. If we think of concatenation as multiplication, exponentiation...原创 2020-02-19 20:42:35 · 157 阅读 · 0 评论 -
K - Table(思维题+数学知识)
There are 4 bars, possibly, having different lengths. Can they be used as the legs of the table, such that:The legs stay vertically in the vertices of some rectangle;The surface of the table, possi...原创 2020-04-14 22:00:05 · 350 阅读 · 0 评论 -
Primes(素数筛)
A prime number is a natural number greater than 1 and has exactly 2 divisors which are 1 and the number itself.You are given a prime number n, find any 2 prime numbers a and b such that a+b=n or sta...原创 2020-04-25 20:29:53 · 1186 阅读 · 0 评论 -
C - Jumps on a Circle(考数学应用)
There are p points on the circle numbered from 0 to (p - 1) in a way that from the point 0 you can move to the point 1, from the point 1 — to the point 2, and so on, and from the point (p - 1) you ca...原创 2020-04-28 21:43:25 · 443 阅读 · 0 评论 -
F-求复合(模的性质)
如果n>m的时候输入的数列一定有两个数余m后的结果相同,那么这两个数如果相减得到的就是能被m整除的数,那么这所有的数乘起来余m结果就是0.#include<bits/stdc++.h>using namespace std;long long int a[200005];int main(){ ios::sync_with_stdio(false); ...原创 2020-05-05 16:39:30 · 176 阅读 · 0 评论 -
B - Array Reconstructing(思想+模拟)
题面:You are given an array a consisting of n elements a1, a2, …, an. Array a has a special property, which is: ai = ( ai - 1 + 1) % m, for each i (1 < i ≤ n)You are given the array a...原创 2020-03-21 21:24:33 · 194 阅读 · 0 评论