A. Far Relative’s Birthday Cake   time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning…
  B. Far Relative’s Problem   time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of th…
A. Far Relative's Birthday Cake 题目连接: http://www.codeforces.com/contest/629/problem/A Description Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to make his birthday cake weird! The cake is a…
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…
A. Far Relative's Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…
Far Relative's Birthday Cake Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to make his b…
水题 #include<iostream> #include<string> #include<algorithm> #include<cstdlib> #include<cstdio> #include<set> #include<map> #include<vector> #include<cstring> #include<stack> #include<cmath>…
题目链接:http://codeforces.com/problemset/problem/629/E 询问这个简单环的期望.考虑将这个环拆成两部分. 令${deep[x]>=deep[y]}$,${size[x]}$表示以$x$为根的子树大小,${sdown[x]}$示以$x$为根的子树的所有节点到$x$的距离和,${sall[x]}$所有点到$x$的距离和.${ne}$表示从${y-->x}$路径上${y}$的儿子. 1.${dis(x,y)}$这是一个环肯定要经过的,算入答案. 2.分情…
居然补完了 组合 A - Far Relative’s Birthday Cake import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner (new BufferedInputStream (System.in)); int n = cin.nextInt (); int[] col = new int[…