Skip to content

Commit fa1c7ff

Browse files
committed
catch up on various minor edits
1 parent 87a6710 commit fa1c7ff

File tree

6 files changed

+25
-11
lines changed

6 files changed

+25
-11
lines changed

contests/2023-02-01_codeforces_848d2/C.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,14 @@ void solve() {
890890
ckmin(K, seen.size());
891891

892892
ll out = 0;
893-
FOR(mask, 0, (1<<seen.size())) {
893+
do {
894+
// FOR(mask, 0, (1<<seen.size())) {
894895
uset<char> allowed;
895-
FOR(b, 0, seen.size()) {
896-
if ((mask>>b) & 1) {allowed.insert(seen[b]);}
897-
}
898-
if (allowed.size() != K) {continue;}
896+
// FOR(b, 0, seen.size()) {
897+
// if ((mask>>b) & 1) {allowed.insert(seen[b]);}
898+
// }
899+
// if (allowed.size() != K) {continue;}
900+
FOR(k, 0, K) {allowed.insert(seen[k]);}
899901

900902
ll local = 0;
901903
ll curr = 0;
@@ -909,7 +911,8 @@ void solve() {
909911
}
910912
local += (curr * (curr+1)) / 2;
911913
ckmax(out, local);
912-
}
914+
// }
915+
} while (next_combination(seen.begin(), seen.begin() + K, seen.end()));
913916

914917
return ps(out);
915918
}

contests/2023-02-06_codeforces_841d2/E.thinking

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ I bet I need to use the problem structure some more.
4040

4141
Can I do some kinda square root decomposition trick?
4242

43+
4344
.

contests/2023-02-09_codeforces_851d2/E.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,10 @@ tcT> struct SegTree { // cmb(ID,b) = b
954954
}
955955
};
956956
template<class T>
957-
string to_string(SegTree<T> st) {
957+
string tsdbg(SegTree<T> st) {
958958
vector<T> out;
959959
FOR(k, st.n, st.n + st.orig_n) { out.push_back( st.seg[k] ); }
960-
return to_string( out );
960+
return tsdbg( out );
961961
}
962962

963963
void solve() {
@@ -998,6 +998,7 @@ void solve() {
998998
FOR(j, 0, psz) {helper.push_back(st.seg[st.n+j]);}
999999
dbgR(helper);
10001000
);
1001+
dbg(st);
10011002
// st.detailed_printouts();
10021003
running += dat[k];
10031004
/**

ideas/WIP_ctrlf

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ You're about to be handed `corpus` of length N.
88
You're guaranteed that `target` appears exactly once as a (contiguous) substring.
99
You want to find that occurrence using the following imaginary tool (pretty similar to ctrl+F).
1010

11-
To use the tool, you type some keystroke(s) matching [a-z ] or <deleteall> or <enter>.
11+
To use the tool, you type some keystroke(s) matching [a-z ] or <deleteall> or <enter>.
1212

1313
and your cursor automatically jumps to some random occurrence of that substring in the corpus. You can always add more characters later - like you could type 3 characters, decide you don't like what you see, and then add a 4th character.
1414

1515

16+
https://docs.google.com/document/d/1xp99xsVcjFmcCqXgqaeFuuehXykM6VzJPHAKL6wre8M/edit#
17+
1618
.

templates/template.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,12 @@ template<typename T>
610610
V<T> pqueue_to_iterable(priority_queue<T> PQ) { // PASS BY VALUE!
611611
V<T> working;
612612
while (!PQ.empty()) {working.push_back(PQ.top()); PQ.pop();}
613-
reverse(all(working));
613+
// reverse(all(working));
614614
return working;
615615
}
616616

617617
template <typename T>
618-
string tsdbg(priority_queue<T>&& PQ) {
618+
string tsdbg(priority_queue<T> PQ) {
619619
return tsdbg(pqueue_to_iterable(PQ));
620620
}
621621

todo

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ TODO:
1010
Rename tsdbg and tsish to repr and to_string in some order?
1111

1212

13+
Quick functions for max/min of a container? Similar to sumv?
14+
(Does this already exist?)
15+
(Yeah it definitely does... go remember how?)
16+
Yeah, it's just *max_element(all(dat)).
17+
18+
19+
1320
Maybe learn about jupyter server?
1421

1522
Make a version of mi that uses lls?

0 commit comments

Comments
 (0)