Фотография
нажмите — покажем
2 · нажмите — покажем
#include <seth>
Ответhttps://leetcode.com/problems/score-of-parentheses/
int scoreOfParentheses (char *s) {
int score = 0;
for (int i = 0, d = 0; s[i]; ++i) {
d += ((s[i] == '(') - (s[i] == ')'));
score += (s[i] == ')' && s[i - 1] == '(') ? (1 << d) : 0;
}
return score;
}
#leetcode #chttps://leetcode.com/problems/minimum-add-to-make-parentheses-valid/
int minAddToMakeValid(char* s) {
int d = 0, x = 0;
for (int i = 0; s[i]; ++i) {
d += ((s[i] == '(') - (s[i] == ')'));
x += d < 0;
d &= ~((d) >> 31);
}
return d + x;
}
#leetcode #c
2 · Ссылка
нажмите — покажем
нажмите — покажем
Dostoevsky: Better Space-Time Trade-Offs for LSM-Tree Based Key-Value Stores via Adaptive Removal of Superfluous Merging
Comments
via nivdayan.github.io via typesanitizer
2 · #include <seth>
Видео
batch_4c38f32f-0082-4fe1-80f2-b7e11196c452_0.mp4 · 6.2 МБ · нажмите — покажем
2 · batch_4c38f32f-0082-4fe1-80f2-b7e11196c452_0.mp4 · 6.2 МБ · нажмите — покажем
Calling a function in C without naming it
Comments
via wiro.world by mrnossiom
2 · #include <seth>
Ссылка
нажмите — покажем
нажмите — покажем
вот видео https://www.youtube.com/watch?v=h56tg3vBB8k
и презентация https://t.me/kruzhochek179/1065
1 · #include <seth>
Ответhttps://leetcode.com/problems/minimum-add-to-make-parentheses-valid/
int minAddToMakeValid(char* s) {
int d = 0, x = 0;
for (int i = 0; s[i]; ++i) {
d += ((s[i] == '(') - (s[i] == ')'));
x += d < 0;
d &= ~((d) >> 31);
}
return d + x;
}
#leetcode #chttps://leetcode.com/problems/sum-of-squares-of-special-elements/
int sumOfSquares(int* a, int n) {
int x = 0;
for (int i = 0; i < n; ++i)
x += !(n % -~i) * a[i] * a[i];
return x;
}
#leetcode #c
3 · Ответhttps://leetcode.com/problems/sum-of-squares-of-special-elements/
int sumOfSquares(int* a, int n) {
int x = 0;
for (int i = 0; i < n; ++i)
x += !(n % -~i) * a[i] * a[i];
return x;
}
#leetcode #c
https://leetcode.com/problems/apply-operations-on-array-to-maximize-sum-of-squares/
const long long MOD = 1000000007LL;
int maxSum(int* nums, int numsSize, int k) {
int count[30] = {0};
for (int i = 0; i < numsSize; ++i)
for (int j = 0; j < 30; ++j)
count[j] += (nums[i] >> j) & 1;
int x = 0;
for (int i = 0; i < k; ++i) {
long long y = 0;
for (int j = 0; j < 30; ++j)
if (count[j]) {
y |= (1LL << j);
--count[j];
}
x = (x + y * y) % MOD;
}
return x;
}
#leetcode #c
3 · #include <seth>
Ссылка
нажмите — покажем
нажмите — покажем
Очень смешная и весёлая песня на злобу дня про то, как всех заменит ИИ. Наткнулся случайно на просторах YouTube. Шикарный текст и видеоряд - я прям каждую смену кадра ставил на паузу, чтобы вчитаться - создатели очень точно и иронично передали современный корпоративный вайб на оптимизацию через ИИ.
Отличный способ хорошо посмеяться в начале выходных
1 · Ссылка
нажмите — покажем
нажмите — покажем
Real-time Software On Linux: How Hard Can It Be?
Presentation by Jeff Pele at Software You Can Love Vancouver 2026Comments
via youtube.com via leela
1 ·