codeforces——961B. Lecture Sleep】的更多相关文章

本文为博主原创文章,未经允许不得转载. 我在csdn也同步发布了此文,链接 https://blog.csdn.net/umbrellalalalala/article/details/79891969   题目来源 http://codeforces.com/problemset/problem/961/B [题目] Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer t…
题目链接:http://codeforces.com/problemset/problem/499/B 题目意思:给出两种语言下 m 个单词表(word1, word2)的一一对应,以及 professor's lecture 的 n 个单词.问记下来的笔记是什么.对于professor's lecture 的某个单词,如果在单词表中找到,word1, word2 都有可能.如果 word1 的长度  <= word2 的长度,就输出word1,否则word2 考了map<string, st…
##Advice for Applying Machine Learning Applying machine learning in practice is not always straightforward. In this module, we share best practices for applying machine learning in practice, and discuss the best ways to evaluate performance of the le…
题目:http://codeforces.com/problemset/problem/519/E 题意:给你一个n个点的树,有m个询问(x,y),对于每个询问回答树上有多少个点和x,y点的距离相等 分析:对于x,y,容易知道距离相等的点是链x->y上的中点除去x.y所在子树的其他所有子树的和 于是分类: 链x->y的长度是奇数:则一定没有距离相等的点,输出0 链x->y的长度是偶数: 链上的中点Mid恰好是x,y的lca,则输出n-size[lca(x,y)的某个儿子(这个儿子是x的父…
Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 519E Description A and B are preparing themselves for programming contests. The University where A and B study is a set of rooms connected…
The Maths Lecture 题意:求存在后缀Si mod k =0,的n位数的数目.(n <=1000,k<=100); 用f[i][j]代表 长为i位,模k等于j的数的个数. 可以用 f[i+1][(t*10i+j)%k]=∑f[i][j]+(j==0),(t*10i+j)%k!=0;动态规划 这样可以求出所有f[n][i] i>0 的值. 最后用9*10^(n-1)-∑f[n][i] 就可以得到 答案 #include <bits/stdc++.h> using…
http://codeforces.com/contest/519/problem/E 题意: 给出一棵树和m次询问,每次询问给出两个点,求出到这两个点距离相等的点的个数. 思路: lca...然后直接判就好了,挂dp标签的人是什么心态.. #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> #include<iostream> ],first[],next…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud E. A and B and Lecture Rooms A and B are preparing themselves for programming contests. The University where A and B study is a set of rooms connected by corridors. Overall, the University ha…
A and B and Lecture Rooms time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. The University where A and B study is a set of rooms co…
传送门 D. The Maths Lecture time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Amr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher…