牛客710153440号
牛客710153440号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客710153440号的博客
全部文章
(共18篇)
题解 | 另类加法
class UnusualAdd { public: int addAB(int A, int B) { // write code here /* 以 A=3(011),B=5(101) 为例,递归过程如下: 第一次调用:C=3^5=6(110),D=(3...
2025-09-04
0
8
题解 | 词频统计
class Frequency { public: int getFrequency(vector<string> article, int n, string word) { // write code here int size = artic...
2025-09-04
0
8
题解 | 无判断max
class Max { public: int getMax(int a, int b) { // write code here int c = a - b; return a - (c & (c >> 31));//c ...
2025-09-04
0
7
题解 | 无判断max
class Max { public: int getMax(int a, int b) { // write code here int c = a - b; return a - (c & (c >> 31));//c ...
2025-09-04
0
7
题解 | 井字棋
class Board { public: bool checkWon(vector<vector<int> > board) { // write code here int row = board.size(); i...
2025-09-04
0
7
题解 | 碰撞的蚂蚁
class Ants { public: double antsCollision(int n) { // write code here return (1.0 - (1.0 / (1 << (n-1)))); //1<<(n-1)...
2025-09-04
0
11
题解 | 整数转化
class Transform { public: int calcCost(int A, int B) { // write code here //需要改变的位的个数:即A和B不同值的位数(一个为0一个为1),都为0或1的话就不需要改变. 无论是A变B还是...
2025-09-04
0
9
题解 | 二进制插入
class BinInsert { public: int binInsert(int n, int m, int j, int i) { // write code here // | :有1为1,全0为0。 &:0变1,1变0。 &:有0...
2025-09-04
0
8
首页
上一页
1
2
下一页
末页