This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * return a new asynchronous function which has same functionality as `func`, | |
| * but can at most run `maxCount` instance concurrently, exceeded calls will | |
| * be pend and run when old calls end. | |
| * @param {number} maxCount | |
| * @param {(...args: any[]) => Promise<any>} func | |
| * @returns {(...args: any[]) => Promise<any>} | |
| */ | |
| function limit(maxCount, func) { | |
| let currentCount = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| f = 0 < x <= 6 && 0 < y <= 6 && 0 < a <= 3 && 0 < b && 20 <= x + y + z + a + b <= 30 && Element[x | y | z | a | b, Integers]; | |
| (* z = 4 *) | |
| z4 = Maximize[ | |
| { | |
| ( | |
| Binomial[y, 3] (a b + a x + b x) + | |
| Binomial[y, 2] ( | |
| a b x + | |
| Binomial[a, 2] (x + b) + Binomial[b, 2] (x + a) + Binomial[x, 2] (a + b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { bv2av, av2bv } = (() => { | |
| const TABLE = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF'; | |
| const TABLE_REVERSED = {}; | |
| for (let i = 0; i < 58; ++i) TABLE_REVERSED[TABLE[i]] = i; | |
| const S = [11, 10, 3, 8, 4, 6]; | |
| const XOR = 177451812; | |
| const ADD = 8728348608; | |
| /** @param {string} bv */ | |
| const bv2av = bv => { | |
| let r = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.asyncAllForEach = async function(cb) { | |
| await Promise.all( | |
| this.map(async (...args) => { | |
| await cb(...args) | |
| }) | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .container { | |
| display: flex; | |
| max-height: 80vh; | |
| flex-direction: row; | |
| writing-mode: vertical-rl; | |
| flex-wrap: wrap; | |
| justify-content: space-between; | |
| } | |
| .word { | |
| display: inline-flex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const wx_p = (() => { | |
| const _wx = {}; | |
| const ret = {}; | |
| Object.keys(wx).forEach(n => { | |
| _wx[n] = wx[n]; | |
| ret[n] = (args = {}) => new Promise((resolve, reject) => { | |
| args.success = (res) => { resolve(res); }; | |
| args.fail = (res) => { reject(res); }; | |
| _wx[n](args); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --shadow-transition_-_transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);; | |
| --shadow-none_-_box-shadow: none;; | |
| --shadow-elevation-2dp_-_box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), | |
| 0 1px 5px 0 rgba(0, 0, 0, 0.12), | |
| 0 3px 1px -2px rgba(0, 0, 0, 0.2);; | |
| --shadow-elevation-3dp_-_box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), | |
| 0 1px 8px 0 rgba(0, 0, 0, 0.12), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int MAXN = 131072; | |
| int lowbit(int x) | |
| { | |
| return x & (-x); | |
| } | |
| class BIT { | |
| int a[MAXN]; | |
| void add(int x, int t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <ctime> | |
| #include <cstdlib> | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <cmath> | |
| using namespace std; |