
2019校内发现杯大赛
?????????????? ???2018??????????? ??????????????????????2018???
???0?2019?????? ??????????????????9? ????9?????1?
???????? ???????????? ??????????????? ????????????
???????? ?????????? ??????????m???? ????????????
??????n? ???1?n?????? ????????????????? ????????????
?????(1,1)?(m,n)??????? ??x??y??????????? ????????x?y?????????
??????????????? ??????????????? ??????????????
发布日期:2021-05-14 16:28:37
浏览次数:24
分类:精选文章
本文共 5481 字,大约阅读时间需要 18 分钟。
??????????
2019???????
???????????????????????????????????????????????????????25?????????????????????????7????????????????????????????
Java????????
?2019???????
???????????????????????????????????????????????????????????????
System.out.println(Integer.toBinaryString(2019));
??????????????????????????
????????
System.out.println(Integer.valueOf("11111100011", 2)); // ???????System.out.println(Integer.valueOf("876", 8)); // ???????System.out.println(Integer.valueOf("FFFF", 16)); // ????????
????????????
System.out.println(Integer.toOctalString(876)); // ???????System.out.println(Integer.toHexString(65535)); // ????????
????1200000??????????
????1200000??????????????????????????
int count = 0;for (int i = 1; i <= Math.sqrt(1200000); i++) { if ((1200000 / i) * i == 1200000) { count++; }}System.out.println(count * 2);
????????1??1200000??????????????1200000??????????????????????????????????????????????2?
????2019????????????????
???????????????????????????????????????????????2018???
????
????1-2019??9????????
????1?2019??9??????????????????????????
public class Main { public static void main(String[] args) { int count = 0; for (int i = 0; i <= 2019; i++) { if (check(i)) { count++; } } System.out.println(count); } public static boolean check(int n) { while (n > 0) { if (n % 10 == 9) { return true; } n /= 10; } return false; }}
????
??????????????????????
??????????????????????????????????????
import java.util.*;public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); int count = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (isVowelOrConsonant(c)) { count++; } } System.out.println(count); } private static boolean isVowelOrConsonant(char c) { c = Character.toLowerCase(c); if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') { return true; } if (c >= 'a' && c <= 'z') { return true; } return false; }}
????
?????n?????????????m??????????????????
?????????????????????????????
import java.util.*;public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int count = 0; int[] numbers = new int[n]; for (int i = 0; i < n; i++) { numbers[i] = scan.nextInt(); } for (int i = 0; i < n; i++) { for (int j = n - 1; j >= i; j--) { if ((numbers[i] + numbers[j]) % m == 0) { count++; } } } System.out.println(count); }}
????
??????1~n????????????????????
????1?n??????????????????????????????????????
import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int count = 0; int n = scan.nextInt(); for (int i = 1; i <= n; i++) { if (check(i)) { count++; } } System.out.println(count); } private static boolean check(int a) { int[] array = new int[10]; while (a > 0) { array[a % 10]++; a /= 10; } for (int j = 0; j < 10; j++) { if (array[j] > 1) { return false; } } return true; }}
????
?????????
??????????????????????????(1,1)??(m,n)????????d?????????
????
????????????
?????????????????????????????????
import java.util.*;public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); int[][] a = new int[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { a[i][j] = scan.nextInt(); } } int[] sum = new int[m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { sum[j] += a[i][j]; } } int x = sum[0]; int y = sum[m - 1]; for (int k = m - 2; k >= 0; k--) { for (int r = 1; r <= k; r++) { if (x < y) { x += sum[r]; } else { break; } if (r == k) { break; } } if (y > x && r + 1 > k) { System.out.println(y - x); break; } if (y > x && r == k) { break; } } if (x > y) { System.out.println(x - y); } }}
????
???????????????????????
???????????????????????????????
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2025年05月01日 23时09分28秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
如何提高SQL查询的效率?
2019-03-12
Docker入门之-镜像(二)
2019-03-12
设置canvas图作为背景图?亲测有效
2019-03-12
搭建Docker本地 Registry
2019-03-12
数据结构——链表(3)
2019-03-12
32位机器与64位机器在编程方面的差别
2019-03-12
socket模块和粘包现象
2019-03-12
Python学习--模块
2019-03-12
分享拉线位移传感器有哪些实质性的特点
2019-03-12
去了解拉绳位移编码器的影响因素
2019-03-12
影响拉线位移传感器精度的原因有哪些?
2019-03-12
无法初始化Winsock2.2处理
2019-03-12
Horizon Cloud之UAG访问异常
2019-03-12
vm无法打开电源
2019-03-12
vMotion 操作失败进度卡在14% ,报错: Operation Timed out
2019-03-12
vCenter日志相关
2019-03-12
重置UAG Application admin密码
2019-03-12
TA部署失败重置过程
2019-03-12
Horizon Daas租户管理平台扩展分配时报:内部错误
2019-03-12
vcenter访问报503错误处理
2019-03-12