题意:给你两个一元多项式\(f(x)\)和\(g(x)\),保证它们每一项的系数互质,让\(f(x)\)和\(g(x)\)相乘得到\(h(x)\),问\(h(x)\)是否有某一项系数不被\(p\)整除. 题解:这题刚开始看了好久不知道怎么写,但仔细看题目给的条件可能会看出一点门道来,我们知道,\(c_{i}\)是由\(f(x)\)和\(g(x)\)中多个某两项积的和来得到的(\(c_{i}=a_{0}b{i}+a_{1}b_{i-1}+...+a_{i}b_{0}\)),那么我们只要找到第一个不…
It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You being his favourite student, put your heart into solving it one last time. You are given two polyno…
CF1316C [Primitive Primes] 给出两个多项式\(a_0+a_1x+a_2x^2+\dots +a_{n-1}x^{n-1}\)和\(b_0+b_1x+b_2x^2+ \dots +a_{m-1}x^{m-1}\),每个多项式的系数的\(\gcd\)都为1 给出质数\(p\),求在这两个多项式乘积的系数中,任意一个不能被\(p\)整除的系数 比赛的时候没想到,居然了想用线段树维护,什么都想用线段树..然后悲惨掉分 设乘积的系数序列为\(c\) 我们可以设在这两个序列中,第一…
数学题 在f(x)和g(x)的系数里找到第一个不是p的倍数的数,然后相加就是答案 为什么? 设x1为f(x)中第一个不是p的倍数的系数,x2为g(x)...... x1+x2前的系数为(a[x1+x2]*b[0]+a[x1+x2-1]*b[1]..)+a[x1]*b[x2]+(.....a[0]*b[x1+x2]) 除了a[x1]b[x2]外,其余的都含有p的倍数,所以和肯定不是p的倍数 #include<bits/stdc++.h> using namespace std; ; int ar…
题面 It is Professor R's last class of his teaching career. Every time Professor R taught a class, he gave a special problem for the students to solve. You being his favourite student, put your heart into solving it one last time. You are given two pol…
B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/C Description Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pair…
F. Video Cards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Vlad is fond of popular computer game Bota-2. Recently, the developers announced the new add-on named Bota-3. Of course…
C. Harmony Analysis   The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how does the professor look like, at least. Danil was very bored on this lesson until the teacher gave the group a…
D. "Or" Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of…
C. Parity Game 题目连接: http://www.codeforces.com/contest/298/problem/C Description You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes…