title: 2019年12月蓝桥杯校赛
date: 2019-12-13 17:11:19
categories:
- 蓝桥杯
tags: - 蓝桥杯
- 01
问题描述
不超过19000的正整数中,与19000互质的数的个数是多少?
答案提交
package school;
import java.util.ArrayList;
public class test3 {
public static void main(String[] args){
int count=0;
ArrayList<Integer> list = new ArrayList<Integer>();
for(int i=2;i<=19000;i++){
if(19000%i==0){
for (int j = i; j < 19000;j=j+i) {
if(list.contains(j))
continue;
else {
list.add(j);
}
}
}
}
System.out.print(list.size());
}
}
结果是11800,反过来说与19000互质的数为7200
- 02
问题描述
在计算机存储中,15.125GB是多少MB?
答案提交
System.out.print(15.125*1024);
结果:15488
- 03
问题描述
个包含有2019个结点的有向图,最多包含多少条边?(不允许有重边)
答案提交
System.out.print((2019*2020)/2);
4074342
- 04
问题描述
问题描述
由1对括号,可以组成一种合法括号序列:()
由2对括号,可以组成两种合法括号序列:()()、(())
由4对括号组成的合法括号序列一共有多少种?
由4对括号组成的合法括号序列共有多少种?
答案提交
其前几项为(从第零项开始) : 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147324, 4861946401452, ...
- 05
问题描述
给定正整数 n,请问在整数 1 至 n 中,数字中没有数位相同的数有多少个?
例如,当 n=30 时,除开 11 和 22 以外,其他的数都没有数位相同,因此答案为 28。
输入格式
输入的第一行包含一个整数 n。
输出格式
输出一行包含一个整数,表示答案。
样例输入
30
样例输出
28
评测用例规模与约定
对于 40% 的评测用例,1 <= n <= 1000。
对于 80% 的评测用例,1 <= n <= 100000。
对于所有评测用例,1 <= n <= 1000000。
代码:
import java.util.Scanner;
public class answer1 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int m = in.nextInt();
int result = 0;
in.close();
for(int i=10;i<=m;i++){
if (judge(i)==true) <