Re: [閒聊] 每日leetcode

看板 Marginalman
作者 sixB (6B)
時間 2024-11-23 02:54:53
留言 0 ( 0推 0噓 0→ )
回文 60則
1072. bitset 翻一翻 因為要固定size 所以做了個mask 讓超過n的不變 我還是很不習慣直接對數字操作 class Solution { public: int maxEqualRowsAfterFlips(vector<vector<int>>& mat) { unordered_map<bitset<301>, int> mp; int n = mat[0].size(); string m = string(301 - n, '1') + string(n, '0'); bitset<301> mask(m); cout << "M: " << mask << '\n'; for(auto& row: mat){ string bit_s(row.begin(), row.end()); for(char& c: bit_s){ c += '0'; } bitset<301> bs(bit_s); mp[bs | mask]++; bs.flip(); mp[bs | mask]++; } int mx = 1; for(auto& [bs, cnt]: mp){ mx = max(mx, cnt); } return mx; } }; ----- Sent from JPTT on my iPad -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.205.121.194 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1732301697.A.757.html

回文

[閒聊] 每日Leetcode
marginalman Rushia
2022-03-29 10:59:05
[閒聊] 每日LeetCode
1 3 marginalman Rushia
2022-09-14 23:02:29
Re: [閒聊] 每日LeetCode
1 3 marginalman Rushia
2022-09-15 12:15:47
Re: [閒聊] 每日LeetCode
2 2 marginalman pandix
2022-09-15 12:57:55
Re: [閒聊] 每日LeetCode
marginalman Rushia
2022-09-21 15:41:31
Re: [閒聊] 每日LeetCode
3 5 marginalman Rushia
2022-09-21 15:53:41
Re: [閒聊] 每日LeetCode
4 5 marginalman Rushia
2022-09-22 10:40:56
Re: [閒聊] 每日LeetCode
1 6 marginalman yam276
2022-09-22 11:38:13
Re: [閒聊] 每日LeetCode
1 2 marginalman yam276
2022-09-22 16:12:43
Re: [閒聊] 每日LeetCode
2 7 marginalman Rushia
2022-09-24 12:54:51
Re: [閒聊] 每日LeetCode
marginalman Rushia
2022-09-25 15:51:32
Re: [閒聊] 每日LeetCode
2 4 marginalman pandix
2022-09-26 19:55:34
Re: [閒聊] 每日LeetCode
marginalman pandix
2022-09-27 23:40:49
Re: [閒聊] 每日LeetCode
2 5 marginalman Rushia
2022-09-27 23:48:21
Re: [閒聊] 每日LeetCode
2 2 marginalman Rushia
2022-09-28 10:06:53
Re: [閒聊] 每日LeetCode
3 5 marginalman pandix
2022-09-28 19:00:24
Re: [閒聊] 每日LeetCode
4 5 marginalman Rushia
2022-09-29 10:22:39
Re: [閒聊] 每日LeetCode
3 6 marginalman pandix
2022-09-29 10:45:51
Re: [閒聊] 每日LeetCode
marginalman pandix
2022-09-29 23:33:27
Re: [閒聊] 每日LeetCode
3 3 marginalman Rushia
2022-10-01 15:21:10
Re: [閒聊] 每日LeetCode
2 3 marginalman pandix
2022-10-01 23:23:27
Re: [閒聊] 每日LeetCode
3 8 marginalman Pash97143
2022-10-02 00:38:24
Re: [閒聊] 每日LeetCode
2 2 marginalman fxfxxxfxx
2022-10-02 09:00:25
Re: [閒聊] 每日LeetCode
4 5 marginalman pandix
2022-10-02 17:01:46
Re: [閒聊] 每日LeetCode
5 7 marginalman fxfxxxfxx
2022-10-03 09:12:35
Re: [閒聊] 每日LeetCode
4 4 marginalman pandix
2022-10-03 09:37:14
Re: [閒聊] 每日LeetCode
marginalman qwer338859
2022-10-03 11:25:38
Re: [閒聊] 每日LeetCode
5 6 marginalman Rushia
2022-10-03 11:26:31
Re: [閒聊] 每日LeetCode
3 3 marginalman Rushia
2022-10-04 09:52:42
Re: [閒聊] 每日LeetCode
5 5 marginalman Rushia
2022-10-05 09:25:45
Re: [閒聊] 每日LeetCode
4 5 marginalman pandix
2022-10-05 09:40:08
Re: [閒聊] 每日LeetCode
4 6 marginalman Rushia
2022-10-06 10:18:27
Re: [閒聊] 每日LeetCode
marginalman pandix
2022-10-06 10:27:49
Re: [閒聊] 每日LeetCode
1 3 marginalman Rushia
2022-10-06 10:53:34
Re: [閒聊] 每日LeetCode
marginalman fxfxxxfxx
2022-10-06 15:02:54
Re: [閒聊] 每日LeetCode
2 5 marginalman pandix
2022-10-07 12:06:19
Re: [閒聊] 每日LeetCode
1 4 marginalman fxfxxxfxx
2022-10-07 19:36:15
Re: [閒聊] 每日LeetCode
3 3 marginalman Rushia
2022-10-08 12:37:47
Re: [閒聊] 每日LeetCode
marginalman pandix
2022-10-08 13:02:09
Re: [閒聊] 每日LeetCode
2 4 marginalman fxfxxxfxx
2022-10-08 14:13:09
Re: [閒聊] 每日LeetCode
1 1 marginalman SecondRun
2022-10-08 16:09:03
Re: [閒聊] 每日LeetCode
2 2 marginalman Rushia
2022-10-09 14:11:02
Re: [閒聊] 每日LeetCode
1 2 marginalman Rushia
2022-10-10 14:38:07
Re: [閒聊] 每日LeetCode
2 2 marginalman Rushia
2022-10-11 11:21:19
Re: [閒聊] 每日LeetCode
2 3 marginalman Rushia
2022-10-12 10:06:55
Re: [閒聊] 每日LeetCode
6 10 marginalman Rushia
2022-10-13 09:12:42
Re: [閒聊] 每日LeetCode
4 6 marginalman fxfxxxfxx
2022-10-13 12:17:26
Re: [閒聊] 每日LeetCode
6 7 marginalman Rushia
2022-10-14 16:24:57
Re: [閒聊] 每日LeetCode
3 3 marginalman pandix
2022-10-15 18:59:40
Re: [閒聊] 每日LeetCode
4 7 marginalman pandix
2022-10-16 16:24:59
Re: [閒聊] 每日LeetCode
2 2 marginalman Rushia
2022-10-17 09:42:50
Re: [閒聊] 每日LeetCode
2 3 marginalman abcd991276
2022-10-18 15:24:10
Re: [閒聊] 每日LeetCode
1 2 marginalman Rushia
2022-10-18 16:37:56
Re: [閒聊] 每日LeetCode
2 3 marginalman pandix
2022-10-18 16:50:13
Re: [閒聊] 每日LeetCode
marginalman Rushia
2022-10-19 09:45:48
Re: [閒聊] 每日LeetCode
1 3 marginalman pandix
2022-10-19 11:07:59
Re: [閒聊] 每日LeetCode
3 4 marginalman Rushia
2022-10-20 09:21:06
Re: [閒聊] 每日LeetCode
6 6 marginalman fxfxxxfxx
2022-10-21 02:46:22
Re: [閒聊] 每日LeetCode
1 2 marginalman Rushia
2022-10-21 09:12:55
Re: [閒聊] 每日LeetCode
3 4 marginalman pandix
2022-10-22 15:36:18

最新文章

[日本] 日本各大網站代購
helpbuy b7753251
2024-11-23 07:36:29
[贈送] 一葉蓮小苗
aqua-shop notre927
2024-11-23 07:34:54
[代買] Pchome 24H 9折代買
helpbuy bastille
2024-11-23 07:28:02
Re: [請益] Lush洗髮皂
beautysalon umunya
2024-11-23 07:01:10