4thirteen2one
4thirteen2one
全部文章
题解
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
全部文章
/ 题解
(共36篇)
题解 | #NC17 最长回文子串#
Python 版本 暴力遍历 class Solution: def getLongestPalindrome(self , A: str) -> int: for i in range(len(A), 0, -1): # 从大到小控制回文长度 ...
Python3
2022-07-07
1
741
题解 | #HJ80 整型数组合并#
#include <stdio.h> #include <stdlib.h> #include <string.h> int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*...
C
2022-06-19
0
330
题解 | #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
题解 | #HJ105 记负均正II#
#include <stdio.h> int main() { int num; int negativeCount = 0, nonNegativeSum = 0, nonNegativeCount = 0; double nonNegativeMean =...
C
2022-06-19
0
357
题解 | #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
题解 | #HJ73 计算日期到天数转换#
#include <stdio.h> int main() { int daysPerMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int y, m, d, s; while (scanf...
C
2022-06-19
0
351
首页
上一页
1
2
3
4
下一页
末页