简单数学
ZZ --瑞 hopeACMer
WA就完事了
展开
-
E - Sasha and Array(线段树懒人)+(矩阵快速幂)
Sasha has an array of integers a1, a2, ..., an. You have to perform m queries. There might be queries of two types: 1 l r x — increase all integers on the segment from l to r by values x; 2 l...原创 2019-02-19 15:43:25 · 240 阅读 · 0 评论 -
找循环节
#include<stdio.h>//#define mod 1000000007#define mod 222222224int main(){long long i,a=1,b=0,t;for( i = 2 ; ; ++i ){t = ( 3*a+b ) % mod;b = a;a = t;if( a == 1 && b == 0 ){pri原创 2019-02-18 15:25:50 · 746 阅读 · 0 评论 -
C - A Short problem(找循环节)
According to a research, VIM users tend to have shorter fingers, compared with Emacs users. Hence they prefer problems short, too. Here is a short one: Given n (1 <= n <= 10 18), You shou...原创 2019-02-18 19:39:54 · 120 阅读 · 0 评论 -
B - 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. ...原创 2019-02-18 11:30:21 · 164 阅读 · 0 评论 -
A - Carmichael Numbers
An important topic nowadays in computer science is cryptography. Some people even think thatcryptography is the only important eld in computer science, and that life would not matter at allwithout...原创 2019-02-18 09:50:40 · 150 阅读 · 0 评论 -
D - K-based Numbers. Version 3(矩阵快速幂+快速乘法)
D - K-based Numbers. Version 3Let’s consider K-based numbers, containing exactly N digits. We define a number to be valid if its K-based notation doesn’t contain two successive zeros. For example: ...原创 2019-02-20 15:30:43 · 169 阅读 · 0 评论