recolor

Codeforces 1108D

冷暖自知 提交于 2021-02-17 23:53:09
题目链接: http://codeforces.com/problemset/problem/1108/D time limit per test  1 second memory limit per test  256 megabytes input  standard input output  standard output You have a garland consisting of n lamps. Each lamp is colored red, green or blue. The color of the i-th lamp is si ('R', 'G' and 'B' — colors of lamps in the garland). You have to recolor some lamps in this garland (recoloring a lamp means changing its initial color to another) in such a way that the obtained garland is diverse. A garland is called diverse if any two adjacent (consecutive) lamps (i. e. such lamps that the

爬虫大作业(虎扑足球新闻)

倖福魔咒の 提交于 2020-12-21 20:25:31
import requests from bs4 import BeautifulSoup import jieba from PIL import Image,ImageSequence import numpy as np import matplotlib.pyplot as plt from wordcloud import WordCloud,ImageColorGenerator def changeTitleToDict(): f = open('yingchao.txt', 'r',encoding='utf-8') str = f.read() stringList = list(jieba.cut(str)) symbol = {"/", "(", ")" , " ", ";", "!", "、" , ":"} stringSet = set(stringList) - symbol title_dict = {} for i in stringSet: title_dict[i] = stringList.count(i) print(title_dict) return title_dict for i in range(1,10): page = i; hupu = 'https://voice.hupu.com/soccer/tag/496-%s

Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

筅森魡賤 提交于 2020-05-09 12:23:04
A : A. Doggo Recoloring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Panic is rising in the committee for doggo standardization — the puppies of the new brood have been born multi-colored! In total there are 26 possible colors of puppies in the nature and they are denoted by letters from ' a' to ' z' inclusive. The committee rules strictly prohibit even the smallest diversity between doggos and hence all the puppies should be of the same color. Thus Slava, the committee employee, has been assigned the task to recolor some puppies