数学
文章平均质量分 88
13vickey
从不思考到底离梦的距离有多远,走一步注定会近一步,一步一步,用旅途的努力来收获成长。
展开
-
fibonacci数列(二) nyoj 数学
题意: 输进去一个N,where 0 ≤ n ≤ 1,000,000,000,输出 f[n] 的后四位;#include#includeconst int mod=10000;int n;int quick_mul(){ if(n==0) return 0; int a11=1,a12=1,a21=1,a22=0; int b11,b12,b21;原创 2013-11-03 18:13:42 · 547 阅读 · 0 评论 -
CF# problem 450C Jzzhu and Chocolate
C. Jzzhu and Chocolatetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJzzhu has a big rectangular chocolate bar that原创 2014-07-20 10:28:35 · 552 阅读 · 0 评论 -
计算几何 三点求最小圆
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const double eps=1e-10;inline int sign(const double &x){ if(x原创 2014-06-30 14:47:51 · 732 阅读 · 0 评论 -
poj 1329 计算几何
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const double eps=1e-10;struct Point { double x,y; Point(doub原创 2014-06-30 18:32:06 · 448 阅读 · 0 评论 -
Codeforces Round #248 (Div. 2)
C. Ryouko's Memory Note题意: 给m 个数,0原创 2014-05-28 15:12:58 · 484 阅读 · 0 评论 -
Matrix Power Series 矩阵快速幂 + 因式分解(分治)
DescriptionGiven a n × n matrix A and a positive integer k, find the sumS = A + A2 + A3 + … + Ak.InputThe input contains exactly one test case. The first line of input contains three p原创 2014-05-28 21:29:48 · 681 阅读 · 0 评论 -
CF A. Trains
outputstandard outputVasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one原创 2014-08-04 23:56:57 · 566 阅读 · 0 评论 -
hdu 4923 Room and Moor
#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;const double eps=1e-9;int n;int a[100010];struct node{ int cnt; int a原创 2014-08-07 23:37:57 · 411 阅读 · 0 评论 -
hdu 4266 The Worm in the Apple 三维凸包
The Worm in the AppleTime Limit: 50000/20000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 540 Accepted Submission(s): 248Problem DescriptionWilly th原创 2014-09-20 17:42:45 · 654 阅读 · 0 评论 -
poj 2356 Find a multiple 抽屉原理
Find a multipleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6263 Accepted: 2734 Special JudgeDescriptionThe input contains N natural (i.e. positive原创 2014-11-17 16:08:07 · 475 阅读 · 0 评论 -
Tmutarakan Exams 简单的容斥定理
Tmutarakan ExamsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionUniversity of New Tmutarakan trains the first-class s原创 2014-11-17 23:04:54 · 589 阅读 · 0 评论 -
街区最短路径问题 规律题
街区最短路径问题原题链接: 点击打开链接时间限制:3000 ms | 内存限制:65535 KB难度:4描述 一个街区有很多住户,街区的街道只能为东西、南北两种方向。住户只可以沿着街道行走。各个街道之间的间隔相等。用(x,y)来表示住户坐在的街区。例如(4,20),表示用户在东西方向第4个街道,南北方向第20个街道。现在要建一原创 2015-02-01 09:58:28 · 820 阅读 · 0 评论 -
poj 2653 Pick-up sticks
题目原创 2014-05-13 16:08:57 · 429 阅读 · 0 评论 -
poj 1654
点击打开链接原创 2014-05-13 14:16:52 · 433 阅读 · 0 评论 -
poj 1106 计算几何
http://poj.org/problem?id=1106枚举i原创 2014-05-13 11:33:24 · 463 阅读 · 0 评论 -
cf /376/C
题意:题意还是有些问题的!很明显这是一个多组解的题目,但题目并没有注明输出答案之一就可。 注意题目“You have number a, whose decimal representation quite luckily contains digits 1, 6, 8, 9. Rearrangethe digits in its decimal representation so原创 2014-01-10 20:32:27 · 924 阅读 · 0 评论 -
CF/379/problem/C
记录下好的思路…………^.^题意: 有N个值: a1-an; 求一个新序列b1-bn,使得任意bi!=bj且bi>=ai且 b1-bn的和最小 我的思路: 先把ai 按从小到大排序,然后维护一个最大值maxn, 当 ai 当 ai>maxn,说明ai并没有出现过,maxn=b[ai.id]=ai; #inclu原创 2014-01-10 21:11:12 · 654 阅读 · 0 评论 -
B. Multitasking CF_384
题意: Iahub can choose a pair of distinct indices i and j (1 ≤ i, j ≤ m, i ≠ j). Then in each array the values at positions i and j are swapped only if the value at position i is strictly原创 2014-01-21 19:38:27 · 594 阅读 · 0 评论 -
CF contest/382/B. Number Busters
题解: 设t 分钟时: c'=c-t; a'=a- (x*t-b)/w; c' 整理出来 t>= (a*w-cw-b)/(x-w); 注意题目条件 xw的情况;#include#include#includeusing namespace std;long long a,b,w,x,c;// 比赛时候一激动竟然定义成int原创 2014-01-18 14:04:22 · 1424 阅读 · 10 评论 -
CF/359/C. Prime Number
C. Prime Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSimon has a prime number x and an array of n原创 2014-02-09 15:29:36 · 702 阅读 · 0 评论 -
poj 1862 Stripies 数学
StripiesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11109 Accepted: 5314DescriptionOur chemical biologists have invented a new very useful form of l原创 2014-02-10 00:19:40 · 699 阅读 · 0 评论 -
Morley's Theorem 计算几何
Morleys TheoremInput: Standard InputOutput: Standard Output Morleys theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilater原创 2014-02-18 15:44:20 · 713 阅读 · 0 评论 -
CF 392 Blocked Points
c. Blocked Pointstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputImagine you have an infinite 2D plane wit原创 2014-02-19 16:09:28 · 936 阅读 · 0 评论 -
Codeforces Round #236 (Div. 2)
A. NutsYou have a nuts and lots of boxes. The boxes have a wonderful feature: if you putx (x ≥ 0) divisors (the spacial bars that can divide a box) to it, you get a box, divided intox + 1 se原创 2014-03-19 21:22:28 · 414 阅读 · 0 评论 -
Same binary weight 数学
Same binary weight描述 The binary weight of a positive integer is the number of 1's in its binary representation.for example,the decmial number 1 has a binary weight of 1,and the decimal number 171原创 2014-04-09 11:02:52 · 540 阅读 · 0 评论 -
poj 1019 Number Sequence 数学&模拟
http://poj.org/problem?id=1019#include#include#include#includeusing namespace std;const int mm=35000;int cnt[mm];int ans[20];void predeal(){ cnt[0]=0; int len=1,ed=10; for(int i=1;i<=原创 2014-04-24 17:31:05 · 431 阅读 · 0 评论 -
Alice and Bob 数学题
Problem F:Alice and BobTime Limit: 1000/1000ms (Java/Other) Memory Limit : 65535/32768K(Java/Other) ProblemDescription Alice andBob like playing games very much.Today, they introduce a new g原创 2014-04-26 00:17:16 · 968 阅读 · 0 评论 -
vector pair sort
bool strict_weak_ordering(const std::pair a, const std::pair b) { return a.first < b.first; } int main() { using namespace std; vect原创 2016-01-15 21:20:42 · 858 阅读 · 0 评论