- 博客(22)
- 收藏
- 关注
原创 hdu_1102_prime
Constructing RoadsProblem Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A
2017-11-30 20:17:41 181
原创 hdu_2682_prime
TreeThere are N (2<=N<=600) cities,each has a value of happiness,we consider two cities A and B whose value of happiness are VA and VB,if VA is a prime number,or VB is a prime number or (VA+VB) is a pr
2017-11-30 19:40:11 258
原创 zoj_3166_floyd_好久没打还翻车一次_丢人
Lazy Tourist Fat Murphy is really a lazy guy. When he goes out for sightseeing, only he cared about is to get back to the hotel which he stayed in as soon as possible. Taday is the Valentine’s day, Fa
2017-11-29 22:35:31 196
原创 poj_2031_已连接部分点的最小生成树_prime
Building a Space Station Time Limit: 1000msMemory Limit: 30000KB This problem will be judged on PKU. Original ID: 2031 64-bit integer IO format: %lld Java class name: Main Prev Submit Status St
2017-11-28 21:48:34 314
原创 nitoj_怎么又是签到题
怎么又是签到题 Time Limit: 500msMemory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main Prev Submit Status Statistics Next Type: NoneTag it! 万年过去,一切都归于尘土。女神觉得世界太单调,于是创造了balakala
2017-11-28 21:10:28 923
原创 6-5 链栈的基本操作(10 分)PTA无法评测但是感觉写的符合要求
6-5 链栈的基本操作(10 分) S是一个顺序栈,函数Push_L(LinkStack &S, SElemType e)是在链栈中插入一个元素e,函数Pop_L(LinkStack &S, SElemType &e)是删除链栈的栈顶元素(进行此操作是保证栈里有元素),函数StackEmpty_L(LinkStack &S)是判断栈是否为空,函数StackLength_L(LinkStack &S
2017-11-27 16:30:13 1128
原创 6-2 Evaluate Postfix Expression(25 分)_后缀表达式求值
6-2 Evaluate Postfix Expression(25 分) Write a program to evaluate a postfix expression. You only have to handle four kinds of operators: +, -, x, and /. Format of functions:ElementType EvalPostfix( c
2017-11-27 14:03:45 5496 2
原创 PTA_6-4 另类堆栈(15 分)_单指针栈
6-4 另类堆栈(15 分) 在栈的顺序存储实现中,另有一种方法是将Top定义为栈顶的上一个位置。请编写程序实现这种定义下堆栈的入栈、出栈操作。如何判断堆栈为空或者满? 函数接口定义:bool Push( Stack S, ElementType X ); ElementType Pop( Stack S ); 其中Stack结构定义如下: typedef int Position; t
2017-11-27 14:02:39 8714
原创 Bit String Reordering UVALive - 6832
给你 n,m 第一行有n个,第二行m个; n 行 就只有0,1;接下来就是有m个数字,代表有多个连续的0或者1 6 3 1 0 0 1 0 1 1 3 2转成 011100这样的最小操作次数/*#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>using name
2017-11-26 22:39:03 215
原创 nit_241_三角形数
B. 三角形数1 12 3 2 3 4 5 6 4 5 6 7 8 9 10形如此类的为三角形数{1,3,6,10},现在我想知道接下来给出的数字是不是三角形数,聪明的你能否帮我解决一下这个问题?Input 多组案例每一行输入一个n 求n是否为三角形数1<=n<=1e9Output 若n为三角形数,请输出Yes否
2017-11-26 22:23:43 203
原创 poj_1287_prime
NetworkingYou are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect p
2017-11-26 22:17:59 224
原创 poj_1258_prime_就是dj减配版
Agri-NetFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. Farmer John ordered a
2017-11-26 22:11:50 154
原创 计蒜课_F. Falling Apart
两个人一前以后拿数字都最大程度拿输出拿的结果#include<bits/stdc++.h>using namespace std;int main(){ int n,a[111],i,j; while(cin>>n) { for(i=0;i<n;i++) scanf("%d",a+i); sort(a,a+n);
2017-11-25 19:10:58 210
原创 计蒜客_A. Amsterdam Distance_思维
给你图片让你走,只有两种走法#include<bits/stdc++.h>using namespace std;#define pi acos(-1.0)int main(){ // cout<<pi<<endl; // printf("%lf\n",2.0/5+(pi*(4.0/5)*3)/6); double n,l,r,x,y,xx,yy; while(c
2017-11-25 19:08:47 299
原创 计蒜客_King of the Waves_dfs
Translate 给你n,代表有0 n-1个人,给你n行,每行n个字符, 字符是X,i=j就是这个人在这个位置 1 代表,i人能赢j人当king 0代表输; 游戏规则是b 是king a能赢b a当king 问裁判按什么安排顺序0能当king //#include<bits/stdc++.h>#include<iostream>#include<vector>#include
2017-11-25 19:05:04 371
原创 nitoj_244_很有意思的贪心
SYS招新啦! ES天天在SYS没事干,忽然想组织一波招新以扩大SYS的队伍。然后有一堆萌新报名了,所有萌新的关系都特别好,因为同性。因为萌新实在是太多了,ES想要做一个刷选,来刷掉一些人。ES使用超自然力,造了一条很长很长的直线跑道,萌新被带到了跑道上面,跑道上有些位置存在宝石,坏坏的ES说:“如果你们能按规定的时间拿到宝石并到我指定的点,就算你们晋级了!”每个萌新,宝石以及ES指定的位置都在同
2017-11-25 18:54:33 308
原创 codeforce 829C
PridePrev Submit Status Statistics Next You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, and replace one o
2017-11-22 21:17:55 234
原创 Evaluate Postfix Expression_后缀表达式求解
6-2 Evaluate Postfix Expression(25 分) Write a program to evaluate a postfix expression. You only have to handle four kinds of operators: +, -, x, and /. Format of functions:ElementType EvalPostfix( c
2017-11-20 20:10:26 2779
转载 主席树
主席树搞了一个多星期TAT,,,,,,也只是大致领悟而已!!!主席树又称函数式线段树,顾名思义,也就是通过函数来实现的线段树,至于为什么叫主席树,那是因为是fotile主席创建出来的这个数据结构(其实貌似是当初主席不会划分树而自己想出来的另一个处理方式。。。。是不是很吊呢? ORZ...)不扯了,切入正题。主席树就是利用函数式编程的思想来使线段树支持询问历史版本、同时充分利用它们之间的共同
2017-11-07 19:20:05 170
原创 6-3 在一个数组中实现两个堆栈(20 分)-pta_same_无聊的水体
6-3 在一个数组中实现两个堆栈(20 分) 本题要求在一个数组中实现两个堆栈。 函数接口定义:Stack CreateStack( int MaxSize ); bool Push( Stack S, ElementType X, int Tag ); ElementType Pop( Stack S, int Tag ); 其中Tag是堆栈编号,取1或2;MaxSize堆栈数组的规模;
2017-11-06 14:55:49 2470 3
原创 6-1 Two Stacks In One Array-PTA双指指针stack表操作实现
6-1 Two Stacks In One Array(20 分) Write routines to implement two stacks using only one array. Your stack routines should not declare an overflow unless every slot in the array is used. Format of fun
2017-11-06 14:12:47 1473
原创 Codeforces Round #442 (Div. 2) A. Alex and broken contest,B - Nikita and string
A. Alex and broken contest time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output One day Alex was creating a contest about his friends, but acci
2017-11-04 09:47:49 362
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人