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 <vector> | |
#include <numeric> | |
class Solution { | |
public: | |
int summize(std::vector<int> nums) | |
{ | |
int result=std::accumulate(nums.begin(),nums.end(),0); | |
if (nums.size() == 2) | |
{ |
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 <vector> | |
#include <algorithm> | |
struct SubArray | |
{ | |
std::vector<int>::iterator low; | |
std::vector<int>::iterator high; | |
int sum; | |
}; |
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
diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c | |
index 6157d18..8237ec7 100644 | |
--- a/src/shared/linux_osl.c | |
+++ b/src/shared/linux_osl.c | |
@@ -942,7 +942,7 @@ osl_getcycles(void) | |
void * | |
osl_reg_map(uint32 pa, uint size) | |
{ | |
- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); | |
+ return (ioremap((unsigned long)pa, (unsigned long)size)); |
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
diff --git a/src/Screen.cpp b/src/Screen.cpp | |
index bba16a97..1cde7131 100644 | |
--- a/src/Screen.cpp | |
+++ b/src/Screen.cpp | |
@@ -461,8 +461,14 @@ void Screen::updateEffectiveRendition() | |
_effectiveBackground = _currentBackground; | |
} | |
- if ((_currentRendition & RE_BOLD) == 0 && (_currentRendition & RE_FAINT) != 0) { | |
+ if ((_currentRendition & RE_BOLD) != 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
diff --git a/src/Screen.cpp b/src/Screen.cpp | |
index 54634d6a..172e4b32 100644 | |
--- a/src/Screen.cpp | |
+++ b/src/Screen.cpp | |
@@ -620,7 +620,7 @@ void Screen::copyFromHistory(Character* dest, int startLine, int count) const | |
if (_selBegin != -1) { | |
for (int column = 0; column < _columns; column++) { | |
if (isSelected(column, line)) { | |
- dest[destLineOffset + column].rendition |= RE_SELECTED; | |
+ reverseRendition(dest[destLineOffset + column]); |
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
#!/usr/bin/env python3 | |
lines=[] | |
with open("input.txt",'r') as input: | |
lines=[line.strip() for line in input.read().strip().split('\n')] | |
max_lines=len(lines) | |
max_length=0 | |
ratios: dict[tuple[int,int],list[int]]={} # position of the gear is the key, list of adjacent parts is the value | |
gear='*' | |
no_gear=(-1,-1) |
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 <Windows.h> | |
int main() | |
{ | |
INPUT input[3]; | |
input[0].type = INPUT_KEYBOARD; | |
input[0].ki.wScan = 0; | |
input[0].ki.time = 0; | |
input[0].ki.dwExtraInfo = 0; | |
input[0].ki.wVk = 0x11; |
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 <type_traits> | |
#include <concepts> | |
#include <vector> | |
#include <optional> | |
#include <iostream> | |
template <typename T> | |
struct TreeNodeGeneric | |
{ | |
T val; |
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
template <typename ...T> void Test(typename std::conditional<std::is_pointer<T>::value,T,T&>::type ...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
cmake_minimum_required(VERSION 3.28) | |
project(vtk19 LANGUAGES CXX) | |
set(CMAKE_CXX_STANDARD 23) | |
set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
add_executable(vtk19 main.cpp) |
OlderNewer