Dfine
Dfine
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Dfine的博客
全部文章
(共78篇)
题解 | 机器人走方格II
#include <vector> class Robot { const int mod = 1000000007; vector<vector<int>> ways; int dfs(vector<vector<int>...
2025-07-04
0
20
题解 | 机器人走方格I
#include <vector> class Robot { public: int countWays(int x, int y) { // write code here if(x==1 || y==1 ) return 1; ...
2025-07-04
0
33
题解 | 加到n
#include <vector> class GoUpstairs { vector<int> ways = {1,1,2,4}; const int mod = 1000000007; public: int countWays(int n) { ...
2025-07-04
0
22
题解 | 第k个数
#include <algorithm> #include <vector> class KthNumber { public: int findKth(int k) { // write code here vector<int...
2025-07-04
0
30
题解 | 穿点最多的直线
/* struct Point { int x; int y; Point() : x(0), y(0) { } Point(int xx, int yy) { x = xx; y = yy; }...
2025-07-04
0
25
题解 | 平分的直线
/* struct Point { int x; int y; Point() : x(0), y(0) { } Point(int xx, int yy) { x = xx; y = yy; }...
2025-07-03
0
16
题解 | 加法运算替代
#include <algorithm> class AddSubstitution { int negate(int x) { int delta = x > 0 ? -1 : 1; int sum = 0; while (...
2025-07-03
0
19
题解 | 判断直线相交
class CrossLine { public: bool checkCrossLine(double s1, double s2, double y1, double y2) { // write code here if(s1 != s2) return...
2025-07-03
0
24
题解 | 碰撞的蚂蚁
#include <cmath> class Ants { public: double antsCollision(int n) { // write code here return 1- 1.0f/pow(2, n-1); } };
2025-07-03
0
24
题解 | 像素设定
#include <iterator> class Render { public: vector<int> renderPixel(vector<int> screen, int x, int y) { // write code her...
2025-07-03
0
20
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页