自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(513)
  • 问答 (1)
  • 收藏
  • 关注

原创 L1-015. 跟奥巴马一起画方块

L1-015. 跟奥巴马一起画方块时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统。2014年底,为

2017-10-14 09:49:29 255

转载 关于sync_with_stdio(false);

tietie是将两个stream绑定的函数,空参数的话返回当前的输出流指针[cpp] view plain copy#include   #include      ///////////////////////////SubMain//////////////////////////////////  int

2017-10-13 22:42:40 385

原创 L1-005. 考试座位号(输入问题)

运行示例:(输入) 4 10120150912233 2 4 10120150912119 4 1 10120150912126 1 3 10120150912002 3 2 2 3 4 上图蓝框中的代码不对 改成这样就对了,为什么??? 学长解答: scanf("%s%d%d",nu,&sn,&mes[sn].kn); 对于scanf() 这个读入函数,读入的数

2017-10-13 22:00:15 961

转载 C++ pair的用法

1、pair的应用pair是将2个数据组合成一个数据,当需要这样的需求时就可以使用pair,如stl中的map就是将key和value放在一起来保存。另一个应用是,当一个函数需要返回2个数据的时候,可以选择pair。 pair的实现是一个结构体,主要的两个成员变量是first second 因为是使用struct不是class,所以可以直接使用pair的成员变量。2、 make_p

2017-10-10 21:44:55 623

转载 poj题目清单(一)

著名题单,最初来源不详。直接来源:http://blog.csdn.net/a1dark/article/details/11714009 OJ上的一些水题(可用来练手和增加自信) (POJ 3299,POJ 2159,POJ 2739,POJ 1083,POJ 2262,POJ 1503,POJ 3006,POJ 2255,POJ 3094) 初期:一.基本算法:枚举. ...

2017-10-09 23:23:20 769

原创 (枚举初级+回溯)poj1753 Flip Game

Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 47376 Accepted: 20247DescriptionFlip game is played on a rectangular 4x4 field with two-sided p

2017-10-09 21:06:30 291

原创 数组

数组a的定义放在函数内部,最大可开到52万;#include <stdio.h>#define maxn 520000int main(){ int a[maxn]; int x,n=0; while(scanf("%d",&x)==1) a[n++]=x; int i; for(i=n-1;i>=1;i--) printf

2017-09-29 17:11:23 248

原创 思考题(精度问题)

下面程序的运行结果是什么? 提示:请上机实验,不要凭主观感觉回答。#include <stdio.h>int main(){ double i; for(i=0;i!=10;i+=0.1) printf("%.lf\n",i); return 0;} 由于浮点误差的存在,i一直满足i!=10这个条件,程序就没有了使其终止的限制条件。 i精确点的取

2017-09-29 16:49:09 308

原创 分数化小数

Description输入正整数a,b,c 0 Input输入正整数a,b,c Output输出a/b的小数形式,精确到小数点后的c位,例如a=1 b=6 c=4输出应该是0.1667 Sample Input1 6 41 2 20Sample Output0.16670.50000000000000000000#include #in

2017-09-29 15:46:44 267

原创 打印倒三角形

输入正整数n我的代码:#include using namespace std;int main(){ int n; while(cin>>n) { int cnt=0; for(int i=n;i>0;i--) { int t=2*i-1; for(int

2017-09-29 14:46:36 888

原创 ???题目7 : Bounce

题目7 : Bounce时间限制:1000ms单点时限:1000ms内存限制:256MB描述For Argo, it is very interesting watching a circle bouncing in a rectangle.As shown in the figure below, the rectangle is

2017-09-26 19:46:18 245

原创 ???题目6 : Cake

题目6 : Cake时间限制:1000ms单点时限:1000ms内存限制:256MB描述To celebrate that WF-2018 will be held in PKU, Alice, Bob, and Cate are asked to makeN cakes.Every cake i needs to go thro

2017-09-26 19:44:53 296

原创 ???题目5 : Territorial Dispute

题目5 : Territorial Dispute时间限制:1000ms单点时限:1000ms内存限制:256MB描述In 2333, the C++ Empire and the Java Republic become the most powerful country in the world. They compete with

2017-09-26 19:44:03 222

原创 ???题目4 : Agent Communication

题目4 : Agent Communication时间限制:1000ms单点时限:1000ms内存限制:256MB描述In Peking University, there are many homeless cats. The students of cat club built n nests and some paths for t

2017-09-26 19:42:52 300

原创 ???题目3 : Matrix

题目3 : Matrix时间限制:1000ms单点时限:1000ms内存限制:256MB描述Once upon a time, there was a little dog YK. One day, he went to an antique shop and was impressed by a beautiful picture. Y

2017-09-26 19:41:34 280

原创 ???题目2 : Reverse Suffix Array

题目2 : Reverse Suffix Array时间限制:1000ms单点时限:1000ms内存限制:256MB描述There is a strong data structure called "Suffix Array" which can effectively solve string problems.Let S=s1s

2017-09-26 19:38:59 475

原创 ???题目1 : Visiting Peking University

题目1 : Visiting Peking University时间限制:1000ms单点时限:1000ms内存限制:256MB描述Ming is going to travel for n days and the date of these days can be represented by n integers: 0, 1, 2,

2017-09-26 19:38:21 210

原创 ???Frequent Subsets Problem

The frequent subset problem is defined as follows. Suppose UU={1, 2,\ldots…,N} is the universe, and S_{1}S​1​​, S_{2}S​2​​,\ldots…,S_{M}S​M​​are MM sets over UU. Given a positive constant \alp

2017-09-26 19:35:18 232

原创 ???The Heaviest Non-decreasing Subsequence Problem

Let SS be a sequence of integers s_{1}s​1​​, s_{2}s​2​​, ......, s_{n}s​n​​ Each integer is is associated with a weight by the following rules:(1) If is is negative, then its weight is 00.(2)

2017-09-26 19:33:47 246

原创 ???Line Segments Clipped by Windows

A rectangular area specified in world coordinates is called a window. The rectangular area on the display device to which a window is mapped is called a viewport. The picture elements that fall with

2017-09-26 19:32:11 368

原创 ???Minimum Distance in a Star Graph

In this problem, we will define a graph called star graph, and the question is to find the minimum distance between two given nodes in the star graph.Given an integer nn, an n-dimensionaln−dimensi

2017-09-25 22:44:01 311

原创 ???GSM Base Station Identification

In the Personal Communication Service systems such as GSM (Global System for Mobile Communications), there are typically a number of base stations spreading around the service area. The base station

2017-09-25 22:42:02 328

原创 ???A Cache Simulator

Cache memories have been used widely in current microprocessor systems. In this problem, you are asked to write a program for a cache simulator. The cache has the following metrics:1. The cache size

2017-09-25 22:39:55 530

原创 ???Finding the Radius for an Inserted Circle

Three circles C_{a}C​a​​, C_{b}C​b​​, and C_{c}C​c​​, all with radius RR and tangent to each other, are located in two-dimensional space as shown in Figure 11. A smaller circle C_{1}C​1​​ with

2017-09-25 22:34:33 356

原创 ???Visible Surface

In computer graphics rendering it is required to do hidden surface removal, the first step in hidden surface removal is to determine the visible surfaces. In this problem you are asked to write a pr

2017-09-25 22:31:34 539

原创 ???Path Search with Constraints

Consider the i-ji−j plane shown in Fig. 1Fig.1. The discrete-points, or nodes, of interest in this plane are indexed by ordered pairs of positive integers as those points in the first quadrant o

2017-09-25 22:28:51 354

原创 ???Auction Bidding

Company ABC is holding an antique auction. In the auction, there are NN, 1 \leq N \leq 10001≤N≤1000, lots. We number the lots from 11 to NN. There are MM, 1 \leq M \leq 5001≤M≤500, bidders p

2017-09-25 22:26:24 473

原创 ???Train Seats Reservation

You are given a list of train stations, say from the station 11 to the station 100100.The passengers can order several tickets from one station to another before the train leaves the station one.

2017-09-25 22:19:51 215

原创 ???Weather Patterns

Consider a system which is described at any time as being in one of a set of NN distinct states, 1,2,3,...,N1,2,3,...,N. We denote the time instants associated with state changes as t = 1,2,...t

2017-09-25 21:42:12 398

原创 ???Overlapping Rectangles

Overlapping Rectangles 样例输入20 0 2 21 1 3 330 0 1 12 2 3 34 4 5 50样例输出73*题目来源2017 ACM-ICPC 亚洲区(南宁赛区)网络赛

2017-09-25 21:38:12 304

原创 数据统计(重定向)

输入一些整数,求出它们的最小值、最小值和平均值(保留3位小数)。输入保证这些数都是不超过1000的整数。 样例输入: 2 8 3 5 1 7 3 6 样例输出: 1 8 4.375#include <stdio.h>#define INF 1000000000int main(){ freopen("in.txt","r",stdin); //输入重定向,输入数据将从in.

2017-09-24 22:45:31 376

原创 阶乘之和

#include <iostream>using namespace std;long factorial(int n){ long res=1; for(int i=1;i<=n;i++) res*=i; return res;}int main(){ int t; cin>>t; long sum=0; for(in

2017-09-22 17:00:16 383

原创 近似计算

循环终止判断是在计算后。#include<stdio.h>int main(){ double sum=0; int i; for(i=0;;i++){ double term=1.0/(i*2+1); if(i%2==0) sum+=term; else sum-=term;

2017-09-22 15:41:33 392

转载 floor函数 与 ceil函数

floor函数   floor(x),有时候也写做Floor(x),其功能是“向下取整”,或者说“向下舍入”,即取不大于x的最大整数 (与 “四 舍 五入”不同,下取整是直接去掉小数部分),例如:    x=3.14,floor(x)=3    y=9.99999,floor(y)=9  在C语言的库函数中,floor函数的语法如下:   #include

2017-09-22 14:40:20 6905

原创 BigDecimal

BigDecimal java大数类用法

2017-09-20 23:12:15 165

原创 PAT乙级-1001 A+B和C (15)

题目描述 给定区间[-2的31次方, 2的31次方]内的3个整数A、B和C,请判断A+B是否大于C。输入描述: 输入第1行给出正整数T(<=10),是测试用例的个数。随后给出T组测试用例,每组占一行,顺序给出A、B和C。整数间以空格分隔。输出描述: 对每组测试用例,在一行中输出“Case #X: true”如果A+B>C,否则输出“Case #X: false”,其中X是测试用

2017-09-20 22:09:40 510

原创 1001 Apple

Problem Description Apple is Taotao’s favourite fruit. In his backyard, there are three apple trees with coordinates (x1,y1), (x2,y2), and (x3,y3). Now Taotao is planning to plant a new one, bu

2017-09-19 21:10:48 609

原创 顺序表(学习笔记)

#include<iostream>using namespace std;int a[5];typedef struct { int *elem; int length;}SqList;void InitList(SqList &L){ L.elem=new int [5]; L.length=0;}void Input(SqList &L){

2017-09-19 19:24:22 425

原创 1003 The Dominator of Strings

Problem Description Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated by T if S is a substring of T.Input The input co

2017-09-18 19:33:36 401

原创 1011 A Cubic number and A Cubic Number

Problem Description A cubic number is the result of using a whole number in a multiplication three times. For example, 3×3×3=27 so 27 is a cubic number. The first few cubic numbers are 1,8,27,6

2017-09-18 19:10:35 481

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除