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
from math import sqrt, floor | |
T = int(input()) | |
for _ in range(T): | |
power = int(input()) | |
k = -0.5+sqrt(1+2*power)/2 | |
if k == floor(k): | |
k -= 1 | |
k = floor(k) | |
sum_bef = (k*(4+4*k))/2 |
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
''' | |
Problem | |
Write a program that reads a string S and find the minimum number r of applications of the function replace(a,b) to form a palindrome. | |
''' | |
def main(): | |
String = input() #Isn't displaying any string while taking input because | |
#if you're using an online judge to check our answers, then, it'd show wrong answer | |
#because of this. | |
count = i = 0 | |
j = len(String)-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
#Well, The task description said that | |
#NOT SOOO FASSTTTT! | |
def shift_bits(num, n): | |
''' | |
a function written to shift the bits of the given number by n | |
for example, | |
1 -> 1 | |
1 << n = 1......0(n zeroes!) | |
''' |
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 math | |
def number_of_factors(num): | |
count = 0 | |
for i in range(1, int(math.sqrt(num))+1): | |
if num%i == 0: | |
if num/i == i: | |
count += 1 | |
else: | |
count += 2 |
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
from functools import reduce | |
def return_factors(n): | |
p = 2 | |
Factors = {} | |
while p * p <= n: | |
count = 0 | |
while n % p == 0: | |
n //= p | |
count += 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
import requests | |
import re | |
from bs4 import BeautifulSoup | |
class colors: | |
GREEN = '\033[92m' | |
STOP = '\033[0m' | |
RED='\033[31m' | |
class CheckUsername: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
--- | |
- hosts: localhost | |
name: play_1 | |
tasks: | |
- name: Creating the Account | |
user: | |
name: test_3 | |
password: '2cc88511a4cd61e01f8d1636a2c82470fef06c9f473cff464b61798588b284b6' |
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
from flask import Flask, request | |
import telegram | |
import os | |
os.chdir('mysite') | |
bot_token = "API KEY" | |
bot_user_name = "Gotoh_Welcome_Bot" | |
URL = "your hosted url" | |
TOKEN = bot_token | |
bot = telegram.Bot(token=TOKEN) |
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
<html> | |
<head> | |
<title>Task for GCI</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<style> | |
input{ | |
border: none; | |
background-color: lightblue; | |
} | |
body{ |