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
name: Build and Test | |
on: | |
push: | |
paths-ignore: | |
- '*.md' | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 |
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
import sys | |
line = sys.stdin.readline() | |
N=int(line) | |
words=[] | |
for _ in range(N): | |
words.append((sys.stdin.readline()).replace("\n","")) | |
chain=0 | |
for key,val in enumerate(words): | |
if key==0: |
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
import sys | |
line = sys.stdin.readline() | |
dataSize=int(line) #Bytes | |
transferSpeed=int(sys.stdin.readline()) #Bps | |
N=int(sys.stdin.readline()) | |
init_best_time=dataSize/transferSpeed | |
best_time=init_best_time | |
for x in range(N): | |
arch=(sys.stdin.readline()).split(" ") #processingSpeed || compressionRate |
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
import sys | |
line = sys.stdin.readline() | |
N=line | |
smooth="YES" | |
arr=(sys.stdin.readline()).split(" ") | |
for key,val in enumerate(arr): | |
if key==0: | |
continue | |
val=int(val) |
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
import sys | |
line = sys.stdin.readline() | |
# print(line) | |
N=line | |
for x in range(int(N)): | |
output=[] | |
M=sys.stdin.readline() | |
for y in range(1,int(M)+1,1): |
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
#!/bin/python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
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
#!/bin/bash | |
set -x | |
VERSION=$( awk -F= '$1=="ID" { print $2 ;}' /etc/os-release | tr -d '"') | |
if [ $VERSION == "ubuntu" ] | |
then | |
# remove old versions | |
sudo apt-get remove docker docker-engine docker.io containerd runc |
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 solution(A): | |
if len(A) < 5: | |
return False | |
total_s = sum(A) | |
left_s,right_s = A[0],A[-1] | |
left_idx,right_idx = 1,len(A) - 2 | |
while left_idx < right_idx: | |
mid_s = total_s - left_s - right_s - (A[left_idx] + A[right_idx]) |
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
import unittest | |
def minimumConcat(initial, goal): | |
#Put your code here | |
# print(initial,goal) | |
res = 0 | |
if(set(goal)-set(initial)): | |
res=-1 | |
else: | |
i=j=0 | |
while i<len(goal): |
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
""" | |
Author: Ian Muge | |
Date: | |
""" | |
import multiprocessing,threading,collections,itertools,hashlib,time | |
from pprint import pprint | |
""" | |
Base functions | |
""" |
NewerOlder