4thirteen2one
4thirteen2one
全部文章
题解
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
全部文章
/ 题解
(共23篇)
题解 | #NC17 最长回文子串#
Python 版本 暴力遍历 class Solution: def getLongestPalindrome(self , A: str) -> int: for i in range(len(A), 0, -1): # 从大到小控制回文长度 ...
Python3
2022-07-07
1
741
题解 | #HJ84 统计大写字母个数#
C语言版本 #include <stdio.h> int main() { char s[251]; scanf("%[^\n]", s); int count = 0; for (int i = 0; i < strlen(s); i++) { ...
C
Python3
2022-06-19
0
532
题解 | #HJ94 记票统计#
while True: try: n = int(input()) candidates = input().split() m = int(input()) votes = input().split() ...
Python3
2022-06-19
0
386
题解 | #HJ81 字符串字符匹配#
C语言版本 #include <stdio.h> #include <stdbool.h> int main() { char S[201]; char T[201]; scanf("%s", S); scanf("%s", T); ...
C
Python3
2022-06-19
0
476
题解 | #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
首页
上一页
1
2
3
下一页
末页