B - Limit You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . Input The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degree…
CodeForces 554B Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Description Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty…
CodeForces 474B Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Description It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such that i-th pile co…
Almost Acyclic Graph CodeForces - 915D time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a directed graph consisting of n vertices and m edges (each edge is directed, so it can…
Persistent Bookcase CodeForces - 707D time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Recently in school Alina has learned what are the persistent data structures: they are data structures…
CodeForces 478B Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Description n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition e…
D. Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as wel…
codeforces 459E E. Pashmak and Graph time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pashmak's homework is a problem about graphs. Although he always tries to do his homework completely, he…
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... 其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Mike and Feet Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 548D Appoint description: Description Mike is the president of country What-The-Fatherland. There are n bears living in thi…