原创 C. Problem for Nazar(奇偶性質)

Nazar, a student of the scientific lyceum of the Kingdom of Kremland, is known for his outstanding mathematical abiliti

原创 E - Birthday Paradox

Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose yo

原创 C. Match Points(二分答案)

You are given a set of points x1x1, x2x2, ..., xnxn on the number line. Two points ii and jj can be matched with each o

原创 R - Race to 1 (期望)

Dilu have learned a new thing about integers, which is - any positive integer greater than 1 can be divided by at least

原创 E - Equal Numbers Gym - 101612E

題目鏈接:http://codeforces.com/gym/101612/attachments 題解:給出來n個數,進行i次操作使得進行i次操作後剩得的不同數字個數最少,注意這n次操作是最優值,這n次操作可能不連續!!! 那麼我們就想

原创 L - Little Difference Gym - 101612L(二分答案)

 題目鏈接:http://codeforces.com/gym/101612/attachments 題解: 先考慮到特殊情況:如果該數是n的次冪的話,肯定能分解成任意個1與對應個2的乘積,此時輸出-1。 在考慮下題意,該數只能被分解成a

原创 高斯消元

//高斯消元 時間複雜度O(n^3) 使用浮點數計算 #include<iostream> #include<string.h> #include<math.h> using namespace std; const double ep

原创 w

#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=100010; int a[maxn],dp[maxn][2]; vec

原创 KMP

#include <stdio.h> #include <stdlib.h> #include<map> #include<algorithm> #include<iostream> #include<bits/stdc++.h> us

原创 博客園地址

https://www.cnblogs.com/cherish-lin/

原创 E - A New Function LightOJ - 1098

We all know that any integer number n is divisible by 1 and n. That is why these two numbers are not the actual divisor

原创 頭文件

#include<iostream> #include<stdio.h> #include<iomanip> #include<queue> #include<algorithm> #include<cstring> #include<

原创 複數運算

#include<iostream> #include<cstring> #include<stdio.h> #include<string> #include<queue> #include<cmath> #include<set>

原创 E - Round Numbers POJ - 3252

The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Ro

原创 D. Almost All Divisors

We guessed some integer number xx. You are given a list of almost all its divisors. Almost all means that there are all