Given a total cooking time of T
and a list of ingredients with properties: t[i]
, a[i]
, b[i]
.
The value of each ingredient put in is (a[i] + (brew time) * b[i])
where brew time = T - (time the ingredient was put in)
.
Each ingredient put in has to cook for t[i]
time before another ingredient can be put in.
Each ingredient can only be used once.
Our task is to output the maximum value that can be obtained.
#include <ctime> | |
#include <cassert> | |
#include <string> | |
#include <fstream> | |
#include <sstream> | |
#include <memory> |
#!/bin/bash | |
# A Multi-Configuration Launcher for Eclipse | |
array_contains () { | |
local array="$1[@]" | |
local seeking=$2 | |
local in=1 |
This is a quick guide to changing the keymap on the GH60 "Satan" or RevCHN. Note that the Satan is NOT a true GH60, and using the GH60 with the normal TMK would not work.
Note that installing dependencies or compiling TMK is not a part of the scope of this document. If you have problems with this part, seek help elsewhere. Note also that these instructions are written for Linux and Mac. If you're using windows, just use the Command Prompt for the git commands, and Windows Explorer to move and delete files. Thirdly, I don't do backlighting or lighting. Whenever I tried to compile this software with support for pwm or any of that stuff, it failed, so I removed those functions. So if you like the lights, you have some debugging to do. Feel free to fork this gist and send me a PR if you can fix it :)
- Dependencies.
- Download and install GIT: https://git-scm.com/downloads
- Download and install the dependencies for compiling TMK: https://github.com/tmk/tmk_keyboard/blob/core/doc/build.md (Point 1 only)
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c | |
index 3a3c401..35ffc7d 100644 | |
--- a/tmk_core/common/action.c | |
+++ b/tmk_core/common/action.c | |
@@ -66,6 +66,12 @@ void process_action(keyrecord_t *record) | |
if (IS_NOEVENT(event)) { return; } | |
action_t action = layer_switch_get_action(event.key); | |
+ static action_t action_on_press[MATRIX_ROWS][MATRIX_COLS]; | |
+ if (event.pressed) { |
/* | |
Encode an NEC IR command into code for Tuya ZS06/ZS08/TS1201 | |
Usage: encode_nec("<four bytes in hex, two bytes of address followed by two bytes of command>") | |
If your address and/or command is just one byte (8 bits), append the complement of the byte after it to make it two bytes. | |
Example: | |
encode_nec("04fb08f7") // encodes nec address 0x04 and command 0x08 | |
See: |