4thirteen2one
4thirteen2one
全部文章
分类
题解(37)
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
TA的专栏
1篇文章
0人订阅
我的刷题记录
1篇文章
353人学习
全部文章
(共29篇)
题解 | #HJ76 尼科彻斯定理#
while True: try: m = int(input()) odds = list(range(m * m - (m - 1), m * m + m, 2)) print('+'.join(map(str, odds))) ex...
Python3
数学
2022-06-19
0
388
题解 | #HJ86 求最大连续bit数#
C语言版本 #include <stdio.h> int main() { int n, rangeMax, rangeCur; while(scanf("%d", &n) != EOF) { rangeMax = 0, rangeCur = 0...
C
Python3
2022-06-19
0
447
题解 | #HJ37 统计每个月兔子的总数#
递推 while True: try: n = int(input()) total = [] sum1 = 1 # 一个月兔子个数 sum2 = 0 # 两个月兔子个数 sum3 = 0 # 三个月以及三个月以...
Python3
2022-06-19
5
1055
题解 | #NC52 有效括号序列#
Python版本暴力解法 class Solution: def isValid(self, s: str) -> bool: stack = [] for c in s: if c == '(' or c == '[' or c...
Python3
2022-05-25
1
646
题解 | #HJ68 成绩排序#
Python版本 n = int(input()) order_mode = int(input()) status_list = [] for i in range(n): name, score = input().strip().split() score = int(sco...
Python3
2022-05-25
2
796
题解 | #HJ14 字符串排序#
Python版本 n = int(input()) string_list = [] for i in range(n): string_list.append(input()) string_list.sort() for string in string_list: prin...
C
Python3
2022-05-25
8
1830
题解 | #NC61 两数之和#
C语言版本 【暴力遍历+边界过滤】 /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param numbers int整型一维数组 * @param numbersLen int numbers数组长度 * @param target in...
C
Python3
哈希表
2022-05-24
0
1858
题解 | #HJ29 字符串加解密#
Python版本 Python 里无法直接对单个字符作差得到ASCII码(Unicode码),所以需要借助 ord 和 chr,或者你能记住 a、A、0 的ASCII码也行…… def crypto(string): temp = [] for c in string: ...
Python3
2022-04-30
1
943
题解 | #HJ102 字符统计#
C语言版本 #include <stdio.h> #include <string.h> int main() { char string[1001]; scanf("%s", string); int length = strlen(string)...
C
Python3
2022-04-28
3
869
题解 | #HJ27 查找兄弟单词#
Python版本 content = input().strip().split() n = int(content[0]) words = content[1: 1+n] x = content[1+n] k = int(content[2+n]) as_x_list = sorted([wo...
Python3
2022-04-18
4
1168
首页
上一页
1
2
3
下一页
末页