摘要: #数学方法 class Solution { public: int maxProductAfterCutting(int n) { //特判一下n≤3的情况 if(n<=3) return 1*(n-1); int res=1; if(n%3==1) n-=4,res*=4;//拆出4 else 阅读全文
posted @ 2023-03-18 20:19 穿过雾的阴霾 阅读(21) 评论(0) 推荐(0)
摘要: class Solution { public: int cnt=0; int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; bool st[55][55]; void dfs(int x,int y,int k,int rows, int cols) 阅读全文
posted @ 2023-03-18 10:36 穿过雾的阴霾 阅读(16) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2023-03-18 09:57 穿过雾的阴霾 阅读(15) 评论(0) 推荐(0)