简单数学
Lyang0.0
这个作者很懒,什么都没留下…
展开
-
Non-Prime Factors(素数筛 + 质因分解)
In many programming competitions, we are asked to find (or count the number of) Prime Factors of an integerii. This is boring. This time, let’s count the number of Non-Prime Factors of an integerii,...原创 2019-05-03 19:26:39 · 362 阅读 · 0 评论 -
Sasha and Array (线段树 + 快速幂)
Sasha has an array of integersa1, a2, ..., an. You have to performmqueries. There might be queries of two types:1 l r x— increase all integers on the segment fromltorby valuesx; 2 l r— fi...原创 2019-02-21 17:28:18 · 239 阅读 · 2 评论 -
C - Looooops (欧几里得+裴蜀定理)
Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the...原创 2019-02-21 10:19:24 · 377 阅读 · 1 评论 -
SDUT-233 Matrix(矩阵快速幂)
In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the question: Suppose we have a matrix called 233 matrix. I...原创 2019-02-19 10:48:31 · 141 阅读 · 0 评论 -
A - LCM from 1 to n (欧拉筛 + 快速幂 + LCM )
Given an integern, you have to findlcm(1, 2, 3, ..., n)lcmmeans least common multiple. For example lcm(2, 5, 4) = 20, lcm(3, 9) = 9, lcm(6, 8, 12) = 24.InputInput starts with an integerT (≤...原创 2019-08-16 09:42:19 · 355 阅读 · 1 评论 -
B. Odd Sum Segments(基础数论)
题目地址:http://codeforces.com/contest/1196/problem/BYou are given an arrayaaconsisting ofnnintegersa1,a2,…,an You want to split it into exactlykknon-empty non-intersecting subsegmentssuch that ...原创 2019-08-17 08:59:54 · 629 阅读 · 3 评论