4thirteen2one
4thirteen2one
全部文章
题解
归档
标签
去牛客网
登录
/
注册
4thirteen2one的博客
全部文章
/ 题解
(共36篇)
题解 | #HJ53 杨辉三角的变形#
#include <stdio.h> int main() { int n, pos; while(scanf("%d", &n) != EOF) { if (n==1 || n==2) { pos = -1; ...
C
2022-06-18
0
358
题解 | #HJ62 查找输入整数二进制中1的个数#
#include <stdio.h> int countOnes(int x) { int ones = 0; while (x > 0) { x &= (x - 1); ones++; } return o...
C
2022-06-18
0
353
题解 | #HJ48 从单向链表中删除指定值的节点#
#include <stdio.h> #include <stdlib.h> typedef struct tLinkNode { int data; struct tLinkNode *next; } LinkNode; int main() { ...
C
2022-06-17
2
458
题解 | #AB9 【模板】链表#
C语言版本 #include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef struct tLinkNode { int data; struct tLinkNode *ne...
C
链表
2022-05-30
3
762
题解 | #AB8 【模板】循环队列#
C语言版本 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> typedef struct tQueue { int *data, ...
C
队列
2022-05-30
1
448
题解 | #HJ108 求最小公倍数#
C语言版本 #include <stdio.h> int gcd(int a, int b) { return (b==0)? a: gcd(b, a%b); } int lcm(int a, int b) { return a*b/gcd(a,b); } int ...
C
2022-05-27
0
823
题解 | #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
首页
上一页
1
2
3
4
下一页
末页