数论
文章平均质量分 90
小伙子开的什么车啊
这个作者很懒,什么都没留下…
展开
-
POJ2142-The Balance(拓展欧几里得+个人小结)
The Balance Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7661 Accepted: 3368 DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dos原创 2018-01-21 20:59:55 · 187 阅读 · 0 评论 -
POJ2689-Prime Distance(区间素筛)
Prime Distance Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20161 Accepted: 5424 DescriptionThe branch of mathematics called number theory is about properties of numbers原创 2018-01-22 21:14:50 · 194 阅读 · 0 评论 -
POJ1286-Necklace of Beads(Polya模板题)
Necklace of Beads Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8930 Accepted: 3709 DescriptionBeads of red, blue or green colors are connected together into a circular neck原创 2018-01-25 14:03:54 · 173 阅读 · 0 评论 -
POJ2891-Strange Way to Express Integers(同余方程求解)
Strange Way to Express Integers Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choose k different positive int原创 2018-02-01 20:58:57 · 192 阅读 · 0 评论 -
POJ2154-Color(Polya+欧拉函数优化)
Color Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 11077 Accepted: 3589 DescriptionBeads of N colors are connected together into a circular necklace of N beads (NYou o原创 2018-01-25 19:51:40 · 228 阅读 · 0 评论 -
Codeforces Round #461 (Div. 2) C. Cave Painting(暴力)
C. Cave Painting time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Imp is watching a documentary about cave painting.Some numbers, carved ...原创 2018-02-26 20:07:29 · 151 阅读 · 0 评论 -
POJ 2888-Magic Bracelet(polya计数定理)
Magic Bracelet Time Limit: 2000MS Memory Limit: 131072K Total Submissions: 6024 Accepted: 1922 DescriptionGinny’s birthday is coming soon. Harry Potter is preparing a birthday present for h原创 2018-03-22 17:04:35 · 463 阅读 · 0 评论 -
Tinkoff Internship Warmup Round 2018 and Codeforces Round #475 (Div. 2) C.Alternating Sum
题目;这里写链接内容 题意:求 这里si是给定的一串正负号组成的字符,表示1~k项的符号,n+1可以整除k,即所求数列的符号是k循环的,a[i]=a[i+k]。 思路:由题意,很明显,这是一个等比数列,先用快速幂求出前k项的和a1,即等比数列的首项,n+1/k即是长度,套用等比数列求和公式即可。要用到逆元。#include <stdio.h>#include <a...原创 2018-05-02 21:34:02 · 208 阅读 · 0 评论 -
2018牛客多校第4场——Ternary string(欧拉降幂)
题意:给你一个三进制串,每一秒每个2后面会多出一个1,每个1后会多出一个0,同时串首的字符被抹去,问多少秒后这个串会被完全消去。思路:赛场上不会欧拉降幂,下来补的。 首先,这种题肯定是有规律的。对于这道题,很容易想到,一个数以及他衍生出来的数要全部消去一定和他存在的时间有关,那么暴力模拟一下,跑一下01,001,0001……,02,002,0002……这些数据,就会发现规律。...原创 2018-07-31 17:20:34 · 344 阅读 · 0 评论