原创 Poj - 3694 Network(橋+LCA)

題目連接 A network administrator manages a large network. The network consists of N computers and M links between pairs

原创 Poj - 1236 Network of Schools(縮點)(有向圖加邊變成強連通圖)

題目鏈接 A number of schools are connected to a computer network. Agreements have been developed among those schools: e

原创 UVA-796 Critical Links(割邊)

In a computer network a link L, which interconnects two servers, is considered critical if there are at least two s

原创 UVA-315 Network(割點)

A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places nu

原创 牛客練習賽48 B 小w的a=b問題

題意: 給你兩個序列,長度分別是n,m,問這兩個序列中的每個數階乘的累積是否相等。 思路: 典型的質因子分解,在一個序列中,對每個數求階乘的連乘積,可以統計從2開始每個數的乘積次數,然後把每個數質因子分解,轉化成求這個質數乘積的次

原创 HDU-6602 Longest Subarray(2019杭電多校第二場1012)

題目鏈接 Problem Description You are given two integers C,K and an array of N integers a1,a2,…,aN. It is guaranteed tha

原创 nbuoj 1587 最大乘積

Description 一個正整數一般可以分爲幾個互不相同的自然數的和,如3=1+2,4=1+3,5=1+4=2+3,6=1+5=2+4,。。。。 現在你的任務是將指定的正整數n分解成互不相同的自然數和,且使這些自然數的乘積最大。

原创 E. Middle-Out(思維)

The problem was inspired by Pied Piper story. After a challenge from Hooli’s compression competitor Nucleus, Richar

原创 2018-2019 Pacific Northwest Regional (Div. 1) F Rectangles(線段樹掃描線)

題目鏈接 題意: 矩形覆蓋面積奇數次的面積和 思路: 線段樹節點每次更新只用看其覆蓋奇數次還是偶數次,反轉一下即可!!節點的權值也要反轉,當前區間長度-上次區間權值 即爲節點反轉後的權值。仔細想一下即可。 #include<b

原创 HDU-5698 瞬間移動(楊輝三角 逆元 快速冪)

瞬間移動 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2538

原创 Educational Codeforces Round 64 (Rated for Div. 2)ABC

A. Inscribed Figures The math faculty of Berland State University has suffered the sudden drop in the math skills o

原创 HDU 3410 Passing the Message 三種方法(暴力,單調棧,線段樹+DFS)

Passing the Message Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi

原创 ZOJ-4109 Welcome Party(並查集+BFS+優先隊列)

題目鏈接 題意: 有n個人要參加聚會,1~n分別表示他們的序列,m行表示他們之間的關係,這n個人一次進場,若進場後發現沒有自己的朋友,這個人就會不開心。現在要求排他們的入場順序,使得不開心的人數最少,同時,進場人的字典序最小。 思

原创 Codeforces Round #555 (Div. 3)E. Minimum Array

題目鏈接 You are given two arrays a and b, both of length n. All elements of both arrays are from 0 to n−1. You can reo

原创 Codeforces Round #562 (Div. 2) C. Increasing by Modulo(二分)

題目鏈接 Toad Zitz has an array of integers, each integer is between 0 and m−1 inclusive. The integers are a1,a2,…,an.