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
fn main() { | |
initscr(); | |
noecho(); | |
keypad(stdscr(), true); | |
start_color(); | |
init_pair(REGULAR_PAIR, COLOR_WHITE, COLOR_BLACK); | |
init_pair(HIGHLIGHT_PAIR, COLOR_BLACK, COLOR_WHITE); | |
let mut quit = false ; | |
let mut rows = 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
#include <cctype> | |
#include <istream> | |
#include <algorithm> | |
#include <bits/chrono.h> | |
#include <ctime> | |
#include <iostream> | |
#include <chrono> | |
#include <fstream> | |
#include <string> | |
#include <vector> |
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
while (t--) | |
{ | |
int out = 0 , last = 0 ; | |
dec (int , n , m , k ); | |
array(int , dis , n ); | |
array(int , size , m); | |
std :: sort (dis.begin() , dis.end()); | |
std :: sort (size.begin() , size.end()); | |
int ptr1 = 0 , ptr2 = 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
#include <iostream> | |
#include <windows.h> | |
#include <string> | |
#include<array> | |
using namespace std; | |
bool working=true; | |
bool waiting=false; |
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
################################# | |
# Transitions # | |
################################# | |
# When windows get moved or resized it transitions window position | |
transition = true; | |
# How many pixels move window to make the first position in transition (defaults to 20) | |
transition-offset = 20; |
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
vector <pair <long long , int > > pri (long long n ) { | |
vector <pair <long long , int > > f ; | |
for ( long long d = 2 ; d *d <= n ; d++ ) { | |
int p = 0 ; | |
while (n % d == 0 ) { | |
n/= d; | |
p++ ; | |
} | |
if (p) |
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
use either::Either; | |
fn sum_mix(arr: &[Either<i32, String>]) -> i32 { | |
let mut x : i32 = 0 ; | |
for my_either in arr { | |
match my_either{ | |
Either::Left(left_value) => { | |
println!("Left value: {}", left_value); | |
x = x+ left_value; | |
} |
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
bool is_prime (int n ) | |
{ | |
if (n == 2 ) | |
return true; | |
if ( n == 1 ) | |
return false ; | |
for (int i =2 ; i * i < (n) ; i ++ ) | |
if (n % i == 0 ) | |
return false; | |
return true; |
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
std :: vector primes_under (int n ) { | |
std::vector<bool> isPrime(n + 1, true); | |
std :: vector <int> primes ; | |
for (int p =2 ; p * p< (n) ; p ++ ) | |
if (isPrime[p]) { | |
// If p is prime, mark all multiples of p as non-prime | |
for (int i = p * p; i <= n; i += p) { | |
isPrime[i] = false; | |
} | |
} |
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 <fstream> // for file reading | |
#include <filesystem>// to check if it is there ; | |
#include <stack> | |
#include <string> | |
#include <system_error> | |
//funcs | |
bool isvalid(std::string s) ; | |
void operate(std :: string s); |