4thirteen2one
4thirteen2one
全部文章
分类
题解(37)
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
TA的专栏
1篇文章
0人订阅
我的刷题记录
1篇文章
353人学习
全部文章
(共57篇)
题解 | #NC61 两数之和#
C语言版本 【暴力遍历+边界过滤】 /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param numbers int整型一维数组 * @param numbersLen int numbers数组长度 * @param target in...
C
Python3
哈希表
2022-05-24
0
1903
题解 | #CC7 牛牛的单向链表#
#include <stdio.h> #include <stdlib.h> struct LinkNode { int value; struct LinkNode *next; }; int main() { int n; scanf(...
C
2022-05-03
3
755
题解 | #HJ29 字符串加解密#
Python版本 Python 里无法直接对单个字符作差得到ASCII码(Unicode码),所以需要借助 ord 和 chr,或者你能记住 a、A、0 的ASCII码也行…… def crypto(string): temp = [] for c in string: ...
Python3
2022-04-30
1
953
题解 | #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
874
题解 | #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
5
1201
题解 | #HJ106 字符串逆序#
C语言版本 #include <stdio.h> #include <string.h> int main() { char content[10001]; int length; scanf("%[^\n]", content, &leng...
C
Python3
2022-04-17
2
1132
题解 | #HJ45 名字的漂亮度#
Python版本 import sys def histogram(string): histo = {} for c in string: histo[c] = histo.get(c, 0) + 1 return histo def func(stri...
Python3
2022-04-17
0
561
题解 | #HJ8 合并表记录#
Python 版本 n = int(input()) table = {} for i in range(n): k, v = map(int, input().split(' ')) if k in table: table[k] += v else: ...
Python3
C
2022-04-17
11
2641
题解 | #HJ101 输入整型数组和排序标识,对其元素按照升序或降序进行排序#
Python版本 n = int(input()) vals = [i for i in map(int, input().strip().split())] order = input() if order == '0': vals.sort(reverse=False) elif or...
Python3
2022-04-17
4
675
题解 | #HJ33 整数与IP地址间的转换#
Python 版本 def ip2num(ip): temp = ip.split('.') num = 0 num = sum([int(s)*(256**(len(temp)-i-1)) for i,s in enumerate(temp)]) return nu...
Python3
2022-04-17
0
543
首页
上一页
1
2
3
4
5
6
下一页
末页