自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 HDU-5971 Wrestling Match

Problem Description Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”, the rest is "bad player”. Now, Xiao Ming i...

2018-08-25 11:20:59 199

原创 F - X^2 Mod P

X*X mod P = A,其中P为质数。给出P和A,求<=P的所有X。Input两个数P A,中间用空格隔开。(1 <= A < P <= 1000000, P为质数)Output输出符合条件的X,且0 <= X <= P,如果有多个,按照升序排列,中间用空格隔开。 如果没有符合条件的X,输出:No SolutionSample Inpu...

2018-08-23 20:33:38 143

原创 1002—Multivariate function

内容:Description Input 第一行一个整数T,表示T组测试数据 (1≤T≤10)(1\leq T \leq 10)(1≤T≤10).每组数据第一行一个整数n (4≤n≤1000)(4 \leq n \leq 1000)(4≤n≤1000).第二行 n个浮点数: x1,x2...xnx_{1},x_{2}...x_{n}x1​,x2​...xn​,(1≤xi...

2018-08-13 18:10:14 185

原创 C—质数(素数)检测

内容:给出N个正整数,检测每个数是否为质数。如果是,输出"Yes",否则输出"No"。Input第1行:一个数N,表示正整数的数量。(1 <= N <= 1000) 第2 - N + 1行:每行1个数(2 <= Sii <= 10^9)Output输出共N行,每行为 Yes 或 No。Sample Input523456Sam...

2018-08-13 17:09:50 494

原创 B—最小公倍数 LCM

内容:输入2个正整数A,B,求A与B的最小公倍数。Input2个数A,B,中间用空格隔开。(1<= A,B <= 10^9)Output输出A与B的最小公倍数。Sample Input30 105Sample Output210解题剖析:最小公倍数=两数之积/最大公约数;LCM=a*b/gcd(a,b);1<= A,B &l...

2018-08-13 10:03:00 235

原创 A—最大公约数GCD

内容:输入2个正整数A,B,求A与B的最大公约数。Input2个数A,B,中间用空格隔开。(1<= A,B <= 10^9)Output输出A与B的最大公约数。Sample Input30 105Sample Output15解题剖析:gcd的应用;int gcd(int a,int b){         return b?g...

2018-08-13 09:40:28 141

原创 E-不稳定排序

内容:大家都知道,快速排序是不稳定的排序方法。 如果对于数组中出现的任意a[i],a[j](i<j),其中a[i]==a[j],在进行排序以后a[i]一定出现在a[j]之前,则认为该排序是稳定的。 某高校招生办得到一份成绩列表,上面记录了考生名字和考生成绩。并且对其使用了某排序算法按成绩进行递减排序。现在请你判断一下该排序算法是否正确,如果正确的话,则判断该排序算法是否为稳定的。 ...

2018-07-25 23:23:07 110

原创 G - Ekka Dokka

内容:Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and D...

2018-07-25 16:45:42 125

原创 B - Relatives

内容:Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such...

2018-07-25 16:10:09 254

原创 E Large Division

内容:Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only if there exists an integer c such that a = b *...

2018-07-25 00:53:36 79

原创 D Integer Divisibility

内容:If an integer is not divisible by 2 or 5, some multiple of that number in decimal notation is a sequence of only a digit. Now you are given the number and the only allowable digit, you should rep...

2018-07-25 00:47:57 131

原创 C 3的幂的和

内容:求:3^0 + 3^1 +...+ 3^(N) mod 1000000007Input输入一个数N(0 <= N <= 10^9)Output输出:计算结果Sample Input3Sample Output40My code:#include <stdio.h>#include <math.h>co...

2018-07-25 00:44:31 288

原创 B 乘法逆元

内容:给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的。Input输入2个数M, N中间用空格分隔(1 <= M < N <= 10^9)Output输出一个数K,满足0 < K < N且K * M % N = 1,如果有多个满足条件的,...

2018-07-25 00:38:53 294

原创 A A/B

内容:要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Inpu...

2018-07-25 00:33:22 148

原创 B 排序去重

问题描述用计算机生成了N个1到1000之间的随机整数(1≤N≤1000 ),对于其中重复的数字,只保留一 个,把其余相同的数去掉,然后再把这些数从小到大排序。输入多组输入,有2行,第1行为1个正整数,表示所生成的随机数的个数: N 第2行有N个用空格隔开的正整数,为所产生的随机数。输出也是2行,第1行为1个正整数M,表示不相同的随机数的个数。第2行为M个用空格隔开的正整 数,为...

2018-07-25 00:27:33 154

原创 A 辞树的QAQ水题

 题目描述蒟蒻的辞树又被吊打了嘤嘤嘤。留下了属于弱者的眼泪QAQAQAQAQAAQAAQA······ 现在我 们定义辞树的悲伤值 F 。F的值为主串中子序列为”QAQ”的个数。注意字母“QAQ”不一定是 连续的,但是字母的顺序应该是准确的。输入输入一个整数T(0 ≤ T ≤ 20),代表有T组数据。每组数据会给出一个字符串S,长度为len,0 < len ≤ 1000000...

2018-07-24 23:46:46 105

原创 C: {A} + {B}

#include <stdio.h>#include <algorithm>using namespace std;int main(){ int n,m; while(scanf("%d %d",&n,&m)!=EOF) { int i,j,t,k=0,a[30000],b[30000]; for(i=0;i<n+m;i++)...

2018-07-21 23:59:17 206

翻译 B: A and B and Compilation Errors

#include <stdio.h>#include <map>#include <iostream>using namespace std;const int MAXN = (int)2e5+10;map<int, int> mp;int a[MAXN], b[MAXN], c[MAXN];int main() { ...

2018-07-21 23:53:25 163

原创 A:不重复数字

#include <stdio.h> #include <set>using namespace std;set<int> a;int main(){ int t,n,i,k; scanf("%d",&t); while(t--) { scanf("%d",&n); a.clear(); scanf("%d&qu

2018-07-21 23:39:42 137

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除