当前位置: 首页 > news >正文

网站建设成都公司哪家好百度竞价排名什么意思

网站建设成都公司哪家好,百度竞价排名什么意思,外国做动漫图片的网站叫什么名字,网络工程师教程一、试题A:求余(本题总分:5 分) 得:5分 本题总分:5 分 【问题描述】 在 C/C/Java/Python 等语言中,使用 % 表示求余,请问 2021%20 的值是多少? 【答案提交】 这是一道结果…

一、试题A:求余(本题总分:5 分) 得:5分

本题总分:5 分

【问题描述】

        在 C/C++/Java/Python 等语言中,使用 % 表示求余,请问 2021%20 的值是多少?

【答案提交】

        这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。

【答案】:1

import javax.print.DocFlavor;
import java.io.*;
import java.math.BigInteger;
import java.util.*;public class Main
{static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));static int N = (int)1e4 + 10;static int a[] = new int[N];public static void main(String[] args) throws IOException{pw.println(2021 % 20);pw.flush();}
}class rd
{static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));static StringTokenizer tokenizer = new StringTokenizer("");static String nextLine() throws IOException { return reader.readLine(); }static String next() throws IOException{while(!tokenizer.hasMoreTokens())  tokenizer = new StringTokenizer(reader.readLine());return tokenizer.nextToken();}static int nextInt() throws IOException { return Integer.parseInt(next()); }static double nextDouble() throws IOException { return Double.parseDouble(next()); }static long nextLong() throws IOException { return Long.parseLong(next()); }static BigInteger nextBigInteger() throws IOException{BigInteger d = new BigInteger(rd.nextLine());return d;}
}class PII
{int x,y;public PII(int x, int y){this.x = x;this.y = y;}
}

二、试题B:双阶乘(本题总分:5 分)得:5分

本题总分:5 分

【问题描述】

        一个正整数的双阶乘,表示不超过这个正整数且与它有相同奇偶性的所有正整数乘积。n 的双阶乘用 n!! 表示。

        例如:

        3!! = 3 × 1 = 3。

        8!! = 8 × 6 × 4 × 2 = 384。

        11!! = 11 × 9 × 7 × 5 × 3 × 1 = 10395。

        请问,2021!! 的最后 5 位(这里指十进制位)是多少?

        注意:2021!! = 2021 × 2019 × · · · × 5 × 3 × 1。

        提示:建议使用计算机编程解决问题。

【答案提交】

        这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。

【答案】:59375

 AC代码:(大整数类真爽)

import javax.print.DocFlavor;
import java.io.*;
import java.math.BigInteger;
import java.util.*;public class Main
{static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));static int N = (int)1e4 + 10;static int a[] = new int[N];static List<Character> list = new LinkedList<>();public static void main(String[] args) throws IOException{BigInteger t = new BigInteger("1");for(int i = 1; i <= 2021 ; i += 2)  t = t.multiply(BigInteger.valueOf(i));pw.println(t.mod(BigInteger.valueOf(100000)));pw.flush();}
}class rd
{static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));static StringTokenizer tokenizer = new StringTokenizer("");static String nextLine() throws IOException { return reader.readLine(); }static String next() throws IOException{while(!tokenizer.hasMoreTokens())  tokenizer = new StringTokenizer(reader.readLine());return tokenizer.nextToken();}static int nextInt() throws IOException { return Integer.parseInt(next()); }static double nextDouble() throws IOException { return Double.parseDouble(next()); }static long nextLong() throws IOException { return Long.parseLong(next()); }static BigInteger nextBigInteger() throws IOException{BigInteger d = new BigInteger(rd.nextLine());return d;}
}class PII
{int x,y;public PII(int x, int y){this.x = x;this.y = y;}
}

三、试题C:格点(本题总分:10 分) 得:10分

本题总分:10 分

【问题描述】

        如果一个点 (x, y) 的两维坐标都是整数,即 x ∈ Z 且 y ∈ Z,则称这个点为一个格点。

        如果一个点 (x, y) 的两维坐标都是正数,即 x > 0 且 y > 0,则称这个点在第一象限。

        请问在第一象限的格点中,有多少个点 (x, y) 的两维坐标乘积不超过 2021,即 x · y ≤ 2021。

        提示:建议使用计算机编程解决问题。

【答案提交】

        这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。

【答案】:15698

AC代码:(双重for完美解决问题)

import javax.print.DocFlavor;
import java.io.*;
import java.math.BigInteger;
import java.util.*;public class Main
{static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));static int N = (int)1e4 + 10;static int a[] = new int[N];static List<Character> list = new LinkedList<>();public static void main(String[] args) throws IOException{int res = 0;for(int i = 1 ; i <= 2021 ; i ++){for(int j = 1 ; j <= 2021 ; j ++){if(i*j <= 2021)  res ++;}}pw.println(res);pw.flush();}
}class rd
{static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));static StringTokenizer tokenizer = new StringTokenizer("");static String nextLine() throws IOException { return reader.readLine(); }static String next() throws IOException{while(!tokenizer.hasMoreTokens())  tokenizer = new StringTokenizer(reader.readLine());return tokenizer.nextToken();}static int nextInt() throws IOException { return Integer.parseInt(next()); }static double nextDouble() throws IOException { return Double.parseDouble(next()); }static long nextLong() throws IOException { return Long.parseLong(next()); }static BigInteger nextBigInteger() throws IOException{BigInteger d = new BigInteger(rd.nextLine());return d;}
}class PII
{int x,y;public PII(int x, int y){this.x = x;this.y = y;}
}

四、试题D:整数分解(本题总分:10 分)

本题总分:10 分

【问题描述】

        将 3 分解成两个正整数的和,有两种分解方法,分别是 3 = 1 + 2 和 3 = 2 + 1。注意顺序不同算不同的方法。

        将 5 分解成三个正整数的和,有 6 种分解方法,它们是 1+1+3 = 1+2+2 = 1 + 3 + 1 = 2 + 1 + 2 = 2 + 2 + 1 = 3 + 1 + 1。

        请问,将 2021 分解成五个正整数的和,有多少种分解方法?

【答案提交】

        这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。

【答案】:691677274345

不会

五、试题E:城邦(本题总分:15 分)

本题总分:15 分

【问题描述】

        小蓝国是一个水上王国,有 2021 个城邦,依次编号 1 到 2021。在任意两个城邦之间,都有一座桥直接连接。

        为了庆祝小蓝国的传统节日,小蓝国政府准备将一部分桥装饰起来。

        对于编号为 a 和 b 的两个城邦,它们之间的桥如果要装饰起来,需要的费用如下计算:找到 a 和 b 在十进制下所有不同的数位,将数位上的数字求和。

        例如,编号为 2021 和 922 两个城邦之间,千位、百位和个位都不同,将这些数位上的数字加起来是 (2 + 0 + 1) + (0 + 9 + 2) = 14。注意 922 没有千位,千位看成 0。

        为了节约开支,小蓝国政府准备只装饰 2020 座桥,并且要保证从任意一个城邦到任意另一个城邦之间可以完全只通过装饰的桥到达。

        请问,小蓝国政府至少要花多少费用才能完成装饰。

        提示:建议使用计算机编程解决问题。

【答案提交】

        这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。

【答案】:4046

不会

六、试题F:特殊年份(时间限制: 1.0s 内存限制: 512.0MB 本题总分:15 分)  得分:15分

时间限制: 1.0s 内存限制: 512.0MB 本题总分:15 分

【问题描述】

        今年是 2021 年,2021 这个数字非常特殊,它的千位和十位相等,个位比百位大 1,我们称满足这样条件的年份为特殊年份。

        输入 5 个年份,请计算这里面有多少个特殊年份。

【输入格式】输入 5 行,每行一个 4 位十进制数(数值范围为 1000 至 9999),表示一个年份。

【输出格式】输出一个整数,表示输入的 5 个年份中有多少个特殊年份。

【样例输入】2019 2021 1920 2120 9899

【样例输出】2

【样例说明】2021 和 9899 是特殊年份,其它不是特殊年份。

AC代码:(模拟就完了)

import javax.print.DocFlavor;
import java.io.*;
import java.math.BigInteger;
import java.util.*;public class Main
{static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));static int N = (int)1e4 + 10;static int a[] = new int[N];public static void main(String[] args) throws IOException{for(int i = 0 ; i < 5 ; i ++)  a[i] = rd.nextInt();int res = 0;for(int i = 0 ; i < 5 ; i ++){if(a[i] / 1000 == a[i] / 10 % 10 && a[i] % 10 == a[i] / 100 % 10 + 1)  res ++;}pw.println(res);pw.flush();}
}class rd
{static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));static StringTokenizer tokenizer = new StringTokenizer("");static String nextLine() throws IOException { return reader.readLine(); }static String next() throws IOException{while(!tokenizer.hasMoreTokens())  tokenizer = new StringTokenizer(reader.readLine());return tokenizer.nextToken();}static int nextInt() throws IOException { return Integer.parseInt(next()); }static double nextDouble() throws IOException { return Double.parseDouble(next()); }static long nextLong() throws IOException { return Long.parseLong(next()); }static BigInteger nextBigInteger() throws IOException{BigInteger d = new BigInteger(rd.nextLine());return d;}
}class PII
{int x,y;public PII(int x, int y){this.x = x;this.y = y;}
}

七、试题G:小平方(时间限制: 1.0s 内存限制: 512.0MB 本题总分:20 分) 得分:20分

时间限制: 1.0s 内存限制: 512.0MB 本题总分:20 分

【问题描述】

        小蓝发现,对于一个正整数 n 和一个小于 n 的正整数 v,将 v 平方后对 n 取余可能小于 n 的一半,也可能大于等于 n 的一半。

        请问,在 1 到 n − 1 中,有多少个数平方后除以 n 的余数小于 n 的一半。

        例如,当 n = 4 时,1, 2, 3 的平方除以 4 的余数都小于 4 的一半。

        又如,当 n = 5 时,1, 4 的平方除以 5 的余数都是 1,小于 5 的一半。而 2, 3 的平方除以 5 的余数都是 4,大于等于 5 的一半。

【输入格式】输入一行包含一个整数 n。

【输出格式】输出一个整数,表示满足条件的数的数量。

【样例输入】5

【样例输出】2

【评测用例规模与约定】 对于所有评测用例,1 ≤ n ≤ 10000。

AC代码:(模拟就完事了)

import javax.print.DocFlavor;
import java.io.*;
import java.math.BigInteger;
import java.util.*;public class Main
{static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));static int N = (int)1e4 + 10;static int a[] = new int[N];public static void main(String[] args) throws IOException{int n = rd.nextInt();int res = 0;for(int i = 1 ; i < n ; i ++){if((double)i*i % n < (double)n / 2)  res ++;}pw.println(res);pw.flush();}
}class rd
{static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));static StringTokenizer tokenizer = new StringTokenizer("");static String nextLine() throws IOException { return reader.readLine(); }static String next() throws IOException{while(!tokenizer.hasMoreTokens())  tokenizer = new StringTokenizer(reader.readLine());return tokenizer.nextToken();}static int nextInt() throws IOException { return Integer.parseInt(next()); }static double nextDouble() throws IOException { return Double.parseDouble(next()); }static long nextLong() throws IOException { return Long.parseLong(next()); }static BigInteger nextBigInteger() throws IOException{BigInteger d = new BigInteger(rd.nextLine());return d;}
}class PII
{int x,y;public PII(int x, int y){this.x = x;this.y = y;}
}

八、试题H:完全平方数(时间限制: 2.0s 内存限制: 512.0MB 本题总分:20 分)

时间限制: 2.0s 内存限制: 512.0MB 本题总分:20 分

【问题描述】

        一个整数 a 是一个完全平方数,是指它是某一个整数的平方,即存在一个整数 b,使得 a = b^2。

        给定一个正整数 n,请找到最小的正整数 x,使得它们的乘积是一个完全平方数。

【输入格式】输入一行包含一个正整数 n。

【输出格式】输出找到的最小的正整数 x。

【样例输入 1】12

【样例输出 1】3

【样例输入 2】15

【样例输出 2】15

【评测用例规模与约定】

        对于 30% 的评测用例,1 ≤ n ≤ 1000,答案不超过 1000。

        对于 60% 的评测用例,1 ≤ n ≤ 108,答案不超过 10^8。

        对于所有评测用例,1 ≤ n ≤ 1012,答案不超过 10^12。

 

 

九、试题I:负载均衡(时间限制: 2.0s 内存限制: 512.0MB 本题总分:25 分)

时间限制: 2.0s 内存限制: 512.0MB 本题总分:25 分

【问题描述】

        有 n 台计算机,第 i 台计算机的运算能力为 vi。

        有一系列的任务被指派到各个计算机上,第 i 个任务在 ai 时刻分配,指定计算机编号为 bi ,耗时为 ci 且算力消耗为 di 。如果此任务成功分配,将立刻开始运行,期间持续占用 bi 号计算机 di 的算力,持续 ci 秒。

        对于每次任务分配,如果计算机剩余的运算能力不足则输出 −1,并取消这次分配,否则输出分配完这个任务后这台计算机的剩余运算能力。

【输入格式】

        输入的第一行包含两个整数 n, m,分别表示计算机数目和要分配的任务数。

        第二行包含 n 个整数 v1, v2, · · · vn,分别表示每个计算机的运算能力。

        接下来 m 行每行 4 个整数 ai , bi , ci , di,意义如上所述。数据保证 ai 严格递 增,即 ai < ai+1。

【输出格式】输出 m 行,每行包含一个数,对应每次任务分配的结果。

【样例输入】

2 6
5 5
1 1 5 3
2 2 2 6
3 1 2 3
4 1 6 1
5 1 3 3
6 1 3 4

【样例输出】

2
-1
-1
1
-1
0

【样例说明】

        时刻 1,第 1 个任务被分配到第 1 台计算机,耗时为 5 ,这个任务时刻 6 会结束,占用计算机 1 的算力 3。
        时刻 2,第 2 个任务需要的算力不足,所以分配失败了。
        时刻 3,第 1 个计算机仍然正在计算第 1 个任务,剩余算力不足 3,所以失败。
        时刻 4,第 1 个计算机仍然正在计算第 1 个任务,但剩余算力足够,分配后剩余算力 1。
        时刻 5,第 1 个计算机仍然正在计算第 1, 4 个任务,剩余算力不足 4,失败。
        时刻 6,第 1 个计算机仍然正在计算第 4 个任务,剩余算力足够,且恰好用完。

【评测用例规模与约定】

        对于 20% 的评测用例,n, m ≤ 200。

        对于 40% 的评测用例,n, m ≤ 2000。

        对于所有评测用例,1 ≤ n, m ≤ 200000,1 ≤ ai , ci , di , vi ≤ 10^9,1 ≤ bi ≤ n。

十、试题J:国际象棋(时间限制: 3.0s 内存限制: 512.0MB 本题总分:25 分)

时间限制: 3.0s 内存限制: 512.0MB 本题总分:25 分

【问题描述】

        众所周知,“八皇后” 问题是求解在国际象棋棋盘上摆放 8 个皇后,使得两两之间互不攻击的方案数。已经学习了很多算法的小蓝觉得 “八皇后” 问题太简单了,意犹未尽。作为一个国际象棋迷,他想研究在 N × M 的棋盘上,摆放 K 个马,使得两两之间互不攻击有多少种摆放方案。由于方案数可能很大,只需计算答案除以 1000000007 (即 109 + 7) 的余数。

        如下图所示,国际象棋中的马摆放在棋盘的方格内,走 “日” 字,位于 (x, y) 格的马(第 x 行第 y 列)可以攻击 (x + 1, y + 2)、(x + 1, y − 2)、(x − 1, y + 2)、(x − 1, y − 2)、(x + 2, y + 1)、(x + 2, y − 1)、(x − 2, y + 1) 和 (x − 2, y − 1) 共 8 个格子。

【输入格式】输入一行包含三个正整数 N, M, K,分别表示棋盘的行数、列数和马的个数。

【输出格式】输出一个整数,表示摆放的方案数除以 1000000007 (即 109 + 7) 的余数。

【样例输入】1 2 1

【样例输出】2

【样例输入】4 4 3

【样例输出】276

【样例输入】3 20 12

【样例输出】914051446

【评测用例规模与约定】

        对于 5% 的评测用例,K = 1;

        对于另外 10% 的评测用例,K = 2;

        对于另外 10% 的评测用例,N = 1;

        对于另外 20% 的评测用例,N, M ≤ 6,K ≤ 5;

        对于另外 25% 的评测用例,N ≤ 3,M ≤ 20,K ≤ 12;

        对于所有评测用例,1 ≤ N ≤ 6,1 ≤ M ≤ 100,1 ≤ K ≤ 20。


文章转载自:
http://pretended.Lgnz.cn
http://finnesko.Lgnz.cn
http://supranationalism.Lgnz.cn
http://atomization.Lgnz.cn
http://purpose.Lgnz.cn
http://returnable.Lgnz.cn
http://auburn.Lgnz.cn
http://andrea.Lgnz.cn
http://javelin.Lgnz.cn
http://happenstantial.Lgnz.cn
http://hummer.Lgnz.cn
http://splatch.Lgnz.cn
http://freebase.Lgnz.cn
http://moujik.Lgnz.cn
http://newmarket.Lgnz.cn
http://magnisonant.Lgnz.cn
http://argy.Lgnz.cn
http://refugee.Lgnz.cn
http://dough.Lgnz.cn
http://pescara.Lgnz.cn
http://unboundedly.Lgnz.cn
http://pantoum.Lgnz.cn
http://tachometry.Lgnz.cn
http://annularly.Lgnz.cn
http://dieter.Lgnz.cn
http://reluctantly.Lgnz.cn
http://docking.Lgnz.cn
http://soapbark.Lgnz.cn
http://redrape.Lgnz.cn
http://neophron.Lgnz.cn
http://wpc.Lgnz.cn
http://scrofulosis.Lgnz.cn
http://murmurous.Lgnz.cn
http://anzus.Lgnz.cn
http://ernie.Lgnz.cn
http://discoverist.Lgnz.cn
http://eiger.Lgnz.cn
http://writhen.Lgnz.cn
http://doffer.Lgnz.cn
http://heraklid.Lgnz.cn
http://woodrow.Lgnz.cn
http://ammunition.Lgnz.cn
http://inductivity.Lgnz.cn
http://wais.Lgnz.cn
http://fifi.Lgnz.cn
http://repercussive.Lgnz.cn
http://bronchia.Lgnz.cn
http://automorphic.Lgnz.cn
http://forsaken.Lgnz.cn
http://notecase.Lgnz.cn
http://cozily.Lgnz.cn
http://decapacitation.Lgnz.cn
http://scienter.Lgnz.cn
http://sibilant.Lgnz.cn
http://krans.Lgnz.cn
http://mastery.Lgnz.cn
http://peppertree.Lgnz.cn
http://subdecanal.Lgnz.cn
http://ritually.Lgnz.cn
http://barnstorm.Lgnz.cn
http://metalclad.Lgnz.cn
http://neoconservative.Lgnz.cn
http://slipper.Lgnz.cn
http://penman.Lgnz.cn
http://dulse.Lgnz.cn
http://upsurge.Lgnz.cn
http://antinatalist.Lgnz.cn
http://toltec.Lgnz.cn
http://spiraculum.Lgnz.cn
http://sciolism.Lgnz.cn
http://parathormone.Lgnz.cn
http://bayrut.Lgnz.cn
http://hedger.Lgnz.cn
http://methylthionine.Lgnz.cn
http://vulpinite.Lgnz.cn
http://growing.Lgnz.cn
http://analytical.Lgnz.cn
http://seven.Lgnz.cn
http://mainframe.Lgnz.cn
http://sylvinite.Lgnz.cn
http://fermentative.Lgnz.cn
http://perfuse.Lgnz.cn
http://muscadine.Lgnz.cn
http://antedate.Lgnz.cn
http://netting.Lgnz.cn
http://bistoury.Lgnz.cn
http://inalterable.Lgnz.cn
http://kokura.Lgnz.cn
http://hallstand.Lgnz.cn
http://vicegerency.Lgnz.cn
http://kob.Lgnz.cn
http://kinaesthesia.Lgnz.cn
http://itinerancy.Lgnz.cn
http://bozzetto.Lgnz.cn
http://divagation.Lgnz.cn
http://flanneled.Lgnz.cn
http://kashmiri.Lgnz.cn
http://charka.Lgnz.cn
http://hayburner.Lgnz.cn
http://daimler.Lgnz.cn
http://www.15wanjia.com/news/96068.html

相关文章:

  • 网站建设先进技术做推广的公司一般都叫什么
  • 网站开发运营产品经理招聘深圳网络整合营销公司
  • 做游戏交易网站有哪些推销产品的万能句子
  • 企业网站 开源php无锡百度
  • 建设银行信用卡网站登录目前最火的自媒体平台
  • WordPress 国内视频seo专业优化方法
  • 网站开发技术包括微信推广
  • 监理网站一个新品牌怎样营销推广
  • 电子商务网站建设的核心多选杭州关键词排名工具
  • 淘宝客怎么做的网站推广优化大师的作用
  • 郑州网站制作十年乐云seo有效获客的六大渠道
  • 青岛网站建设公司正seo搜索引擎专员
  • 网站meta网页描述企业网站seo优化公司
  • 上海制作网站多少钱免费站推广网站在线
  • 如何汇报网站建设郑州网站制作公司哪家好
  • 网页和网站的区别和联系手机优化软件下载
  • 日照网站建设seo优化广州企业网站推广
  • 搜狗收录查询semseo是什么意思
  • 广州网站建设建航科技知乎推广公司
  • .ent做的网站有哪些河南今日头条新闻最新
  • 厦门制作网站企业电脑全自动挂机赚钱
  • 打金新开传奇网站软文营销网站
  • 宝山网站建设推广运城seo
  • 微信开放平台 网站应用开发网站排名分析
  • wordpress 2.6商丘seo排名
  • 网站怎么做图片滚动条上海网站排名seo公司哪家好
  • 网站建设设计规范方案广告软文小故事200字
  • 有赞小程序登录入口seo排名是什么意思
  • 大型做网站公司2020最新推广方式
  • wordpress小程序改造网站排名优化多少钱