Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://codeforces.com/contest/985/problem/F Description You are given a string s of length n consisting of lowercase English letters. For two given strings s an…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://codeforces.com/contest/985/problem/E Description Mishka received a gift of multicolored pencils for his birthday! Unfortunately he lives in a monochrome w…
E. Sum of Remainders 题目连接: http://www.codeforces.com/contest/616/problem/E Description The only line contains two integers n, m (1 ≤ n, m ≤ 1013) - the parameters of the sum. input The only line contains two integers n, m (1 ≤ n, m ≤ 1013) - the para…
题目链接:http://codeforces.com/contest/616/problem/E 题目大意:给定整数n,m(1≤n,m≤1013), 求(n mod 1 + n mod 2 + ... + n mod m)的值(mod Pt = 1e9 + 7). 思路:这题一看是看觉得题意简洁,通过人数不多一定是一道用到各种定理的碉堡数论题.后来仔细想了一下发现是乱搞… 首先通过观察数据范围,结合数论题的复杂度传统考虑O(√n)算法. 把n拆解,可以任意写成很多种n = px + r 的形式,…
E. Analysis of Pathes in Functional Graph time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output You are given a functional graph. It is a directed graph, in which from each vertex goes exactly o…
E. Minimum spanning tree for each edge 题目连接: http://www.codeforces.com/contest/609/problem/E Description Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n vertices and m edges. For each edge (u, v) f…
C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school computer room there are n servers which are responsible for processing several computing tasks. You know the number of scheduled tasks for each server:…
A. USB Flash Drives 题目连接: http://www.codeforces.com/contest/609/problem/A Description Sean is trying to save a large file to a USB flash drive. He has n USB flash drives with capacities equal to a1, a2, ..., an megabytes. The file size is equal to m…
题目链接:http://codeforces.com/contest/818 A. Diplomas and Certificates 题解:水题 #include <iostream> #include <cstring> #include <cmath> using namespace std; typedef long long ll; int main() { ll n , k; cin >> n >> k; ll gg = n / 2;…
E. Minimum spanning tree for each edge 题目连接: http://www.codeforces.com/contest/609/problem/E Description Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n vertices and m edges. For each edge (u, v) f…