Codeforces Round #267 (Div. 2) D. Fedor and Essay tarjan缩点

D. Fedor and Essaytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter you had helped Fedor to

Codeforces Round #271 (Div. 2) E. Pillars 线段树优化dp

E. Pillarstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarmot found a row with n pil

Codeforces Round #271 (Div. 2) F. Ant colony 线段树

F. Ant colonytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMole is hungry again. He found one a

Codeforces Round #396 (Div. 2) E

Mahmoud and Ehab live in a country with n cities numbered from 1 to n and connected by n - 1 undirected roads.

Codeforces Round #396 (Div. 2) D

Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i.&nbs

Codeforces Round #396 (Div. 2) C

Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a

Codeforces Round #396 (Div. 2) B

Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to

Codeforces Round #396 (Div. 2) A

While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest common subsequence. They solved it, and then Ehab challeng

codeforces gym 101164 K Cutting 字符串hash

题意:给你两个字符串a,b,不区分大小写,将b分成三段,重新拼接,问是否能得到A;思路:暴力枚举两个断点,然后check的时候需要字符串hash,O(1)复杂度N*N;题目链接:传送门#pragma comment(linker, "/STACK:1024000000,1024000000")#in

Codeforces Round #390 (Div. 2) D

All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket.The goods in the supermarket have uniqu