Problem Description In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For example, in polar Coordinate system,ρ=cos3θ is like rose, ρ=1−sinθ is a Cardioid, and so on. Today, there…
Problem Description Given a prime number C(1≤C≤2×105), and three integers k1, b1, k2 (1≤k1,k2,b1≤109). Please find all pairs (a, b) which satisfied the equation a^(k1⋅n+b1 )+ b^(k2⋅n−k2+1) = 0 (mod C)(n = 1, 2, 3, ...). Input There are multiple test…
Problem Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types of operation. 1. multiply X with a number. 2. divid…
题目;http://acm.hdu.edu.cn/showproblem.php?pid=5475 题意就是给X赋初值1,然后给Q个操作,每个操作对应一个整数M:如果操作是1则将X乘以对应的M,如果是2则除以第M次操作对应的M',求最后X的值对给定值取摸的结果, 直接暴力会爆long long,用数组存每一步的话 会超时,所以用线段树优化进行区间更新 #include<cstdio> using namespace std; typedef long long ll; struct point…
题目;http://acm.hdu.edu.cn/showproblem.php?pid=5455 题意就是找出所给字符串有多少个满足题目所给条件的子串,重复的也算,坑点是如果有c,f以外的字符也是不满足条件的,还有我被坑了的地方就是当输入很多f的时候,我尽然脑抽的 认为这是不满足条件的,注意这两点就行了,直接暴力 #include<cstdio> #include<cstring> using namespace std; int main() { int t,i,j,x,y,k…
题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和. Sample Input2 //T1 32 5 Sample OutputCase #1: 36Case #2: 224 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmath> # define LL long long using na…