4thirteen2one
4thirteen2one
全部文章
题解
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
全部文章
/ 题解
(共36篇)
题解 | #CC7 牛牛的单向链表#
#include <stdio.h> #include <stdlib.h> struct LinkNode { int value; struct LinkNode *next; }; int main() { int n; scanf(...
C
2022-05-03
3
741
题解 | #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
题解 | #HJ106 字符串逆序#
C语言版本 #include <stdio.h> #include <string.h> int main() { char content[10001]; int length; scanf("%[^\n]", content, &leng...
C
Python3
2022-04-17
1
1069
题解 | #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
552
题解 | #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
10
2567
题解 | #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
669
题解 | #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
530
题解 | #HJ23 删除字符串中出现次数最少的字符#
Python版本 content = input() index_map = {chr(i):[] for i in range(ord('a'), ord('z')+1)} for i, c in enumerate(content): index_map[c].append(i) # ...
Python3
2022-04-17
0
1426
首页
上一页
1
2
3
4
下一页
末页