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
int main() { | |
int n,q; | |
cin >> n >> q; | |
vector< vector<int> > a(n); | |
for (int i=0;i<n;i++) { | |
int k; | |
cin >> k; | |
for (int j=0;j<k;j++) { | |
int data; |
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
from bs4 import BeautifulSoup | |
import requests | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} | |
def search(url): | |
res = requests.get(url,headers=headers) | |
print("\nSearching for history....\n") | |
print("Things happens today...\n") | |
soup = BeautifulSoup(res.text,'html.parser') | |
length = len(soup.select('.event')) | |
for i in range (0,length): |
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
points_sam_house = list(map(int, input().split())) | |
points_apple = list(map(int, input().split())) | |
points_orange = list(map(int, input().split())) | |
s = int(points_sam_house[0]) | |
t = int(points_sam_house[1]) | |
a = int(points_apple[0]) | |
b = int(points_apple[1]) | |
m = int(points_orange[0]) | |
n = int(points_orange[1]) | |
apple_fall = list(map(int, input().split())) |
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
from statistics import mean | |
num = int(input()) | |
names =[] | |
for i in range(0,num): | |
names.append(list(map(str, input().split()))) | |
data =[] | |
check_name = str(input()) | |
for i in range(0,num): | |
if names[i][0]==check_name: | |
data.append(names[i][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
def merge_the_tools(s,num): | |
s=s | |
num=num | |
subsegments = int(len(s) / num) | |
for i in range(subsegments): | |
t = s[i * num : (i + 1) * num] ##indexing of the string | |
u = "" | |
for c in t: | |
if c not in u: |
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
string = str(input()) | |
digit ="" | |
cap="" | |
even="" | |
odd="" | |
zero = "" | |
for i in string: | |
if i.isupper()==True: | |
cap = cap+i | |
cap = cap[::-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
from __future__ import with_statement | |
import contextlib | |
try: | |
from urllib.parse import urlencode | |
except ImportError: | |
from urllib import urlencode | |
try: | |
from urllib.request import urlopen | |
except ImportError: | |
from urllib2 import urlopen |
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
num1 = int(input()) | |
set1 = set(input().split()) | |
num2 = int(input()) | |
set2 = set(input().split()) | |
print( len(set1 & set2)) |
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
num = int(input()) | |
set1 = set(input().split()) | |
num2 = int(input()) | |
set2 = set(input().split()) | |
print( len(set1.difference(set2))) |
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
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the kangaroo function below. | |
def kangaroo(x1, v1, x2, v2): | |
for n in range(10000): |