This file contains 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
f = open("27-a.txt") | |
n = int(f.readline()) | |
arr = [[] for i in range(9)] | |
for i in range(n): | |
now = int(f.readline()) | |
arr[now % 9].append(now) | |
for i in range(9): |
This file contains 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
a = [[0] * 100 for i in range(100)] | |
for i in range(100): | |
for j in range(100): | |
if i + 1 + j >= 79 or 2 * i + j >= 79 or i + 2 * j >= 79: | |
a[i][j] = 1 | |
for k in range(100): | |
for i in range(1, 100): |
This file contains 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
f = open("test.txt") | |
def get(): | |
return list( map(int, f.readline().split())) | |
n = int(f.readline()) | |
s = get() |
This file contains 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
############################################################################ | |
def dividers(n): | |
arr = [] | |
for i in range(1, int(n ** 0.5) + 1): | |
if n % i == 0: | |
arr.append(i) | |
if i*i != n: | |
arr.append(n // i) | |
arr.sort() | |
return arr |
This file contains 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
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
This file contains 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
def toBase(base, num): | |
newNum = '' | |
while num > 0: | |
newNum = str(num % base) + newNum | |
num //= base | |
return newNum | |
def toDec(num, base): | |
iu = str(num) |
This file contains 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.17) | |
project(WebSocket) | |
find_package(Boost REQUIRED COMPONENTS system) | |
include_directories( . ${Boost_INCLUDE_DIRS}) | |
set(CMAKE_CXX_STANDARD 11) | |
add_executable(WebSocket main.cpp User.cpp User.h) |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.vdk</groupId> | |
<artifactId>example-test</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains 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
int gcd (int a, int b) { | |
while (b) { | |
a %= b; | |
swap (a, b); | |
} | |
return a; | |
} | |
int lcm (int a, int b) { | |
return a / gcd (a, b) * b; |