自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 数据结构上机3

#include#include#include#include#include #include using namespace std;#define SOURCEFILE "5.data"const int LineLenght = 20;//控制屏幕打印时,每行元素个数const int MaxSize = 30000;int temp[MaxSize];//归并排序辅

2017-11-08 20:59:30 340

原创 dfs城堡问题 百练2815

2815:城堡问题查看提交统计提示提问总时间限制: 1000ms 内存限制: 65536kB描述 1 2 3 4 5 6 7 ############################# 1 # | # | # | | # #####---#####---#---#####-

2017-10-30 12:40:54 353

原创 bfs简单题 迷宫问题

使用队列保存未被检测的节点 节点按照深度优先的次序被访问 并依次压入队列中 并以相反的次序进行出队列#include#include#includeusing namespace std;int dir[4][2]={1,0,-1,0,0,1,0,-1};struct point{ int x,y,step;};int bfs(point s,point e,in

2017-10-25 23:18:16 418

原创 数据结构上机2

#include #include #include using namespace std;const int maxn = 50000+10;const int MIN = -1e9;typedef struct Node{ int data; struct Node *next;} Node;void slove(int n,int k){

2017-09-19 19:35:25 439

原创 Rails UVA - 514

RailsThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possib

2017-09-17 18:54:49 254

原创 POJ2306 Lake Counting

Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 37065 Accepted: 18433DescriptionDue to recent rains, water has pooled in various places in

2017-09-17 14:12:17 247

原创 Codeforces Round #433 Div. 2 B. Maxim Buys an Apartment

B. Maxim Buys an Apartmenttime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputMaxim wants to buy an apartment i

2017-09-17 11:44:56 227

原创 Codeforces Round #433 Div. 2 A. Fraction

A. Fractiontime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputPetya is a big fan of mathematics, especially it

2017-09-17 11:24:38 220

原创 数据结构上机1

1.//// Created by shadow on 2017/9/13.//#include#include#define N 1005using namespace std;int main(){ int n, x, a[N]; scanf("%d%d",&n,&x); int sum; int count = 1; scanf(

2017-09-13 11:33:03 305

原创 练习

import java.util.*;import java.util.Collections;public class Muser { public static void main (String[] args){ Collection list =new ArrayList<>(); list.add("a"); list.a

2017-09-12 20:07:56 316

原创 链表

链表(linked list)中的对象都是按线性顺序排列,与数组不同的是,链表的顺序是由每个对象里的指针决定的。双向链表(doubly linked list)L中的每个元素有一个关键元素key和两个指针,next和prev,x.next则指向它的前驱元素,x.prev则指向后继元素 那么区分这个元素是头还是尾就很简单了.要注意的是L.head指向链表的第一个元素 如果L.head=N

2017-09-11 22:53:54 202

原创 io框架练习

1.import java.io.InputStream;import java.io.Reader;import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.*; public class ReadFile {public static void main(String[] a

2017-09-10 19:05:25 249

原创 数组和集合练习

1.import java.util.Random;import java.util.Arrays;public class TestlntArray { public static void main(String[] args) { int[] a = new int [10]; Random random = new Random();

2017-09-08 21:27:51 430

原创 java语言基础类

1.public class Dog { String name; int weight; public Dog(String name, int weight) { this.name = name; this.weight = weight; } public String toString() { return this.

2017-09-05 18:50:52 357

原创 继承和多态练习

1.public class Manager extends Employee{ public Manager(String name,int age,double salary){ super(name,age); this.salary=salary; } public static void main(String[] args)

2017-09-05 15:46:24 812

原创 类和对象练习

1.public class Point { int x; int y; double getDistance(){ double distance=Math.sqrt(x*x+y*y); return distance; } public static void main(String[] args){ P

2017-09-05 12:34:42 890

原创 书本第四章编程练习

public class Main { public static void main(String args[]) { CPU cpu = new CPU(); cpu.setSpeed(2200); HardDisk disk = new HardDisk(); disk.setAmount(200);

2017-09-03 22:38:55 277

原创 简单练习java写类

简单定义一个人类 实行简单的输出public class People {double height;int age;int sex;String name; public People(int h,int a,int s,String n){ height = h; age = a; sex = s; name = n; }void cry(){ System

2017-09-03 12:38:09 464

原创 java方法练习

实现一个方法,接收一个层数值n,打印一个有n层的直角三角形,并返回底边最后一个值。并打印出来。import java.text.*;import java.util.Scanner;import java.io.*; import javax.print.attribute.standard.PrinterMessageFromOperator;import org.omg.CORB

2017-09-03 11:20:32 1749

原创 二维数组练习

在控制台上每10个数为一组,打印出前100的数,即1~100。import java.text.*;import java.util.Scanner;import java.io.*; import javax.print.attribute.standard.PrinterMessageFromOperator;import java.math.*;public cla

2017-09-03 10:22:21 611

原创 课本第二章java编程题

1.输出你我他在unicode表中的位置public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); char a1,a2,a3; a1='你';a2='我';a3='他'; System.out.p

2017-09-02 09:14:06 371

原创 动态规划 数字三角形 poj1163

The TriangleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 51078 Accepted: 30942Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write

2017-09-02 07:42:22 217

原创 课本第三章java编程题

1.求1!+....+10!public class Main { public static void main(String[] args) { int sum=1;int sum1=0;for(int i=1;i<=10;i++){sum*=i;sum1+=sum;}System.out.println(sum1); } }2.求出100

2017-09-02 06:44:42 315

原创 java练习-字符串排序

字符串排序 用Java编写一个能对一组字符串按字典序升序排序的程序 输入为N和N行字符串,需要按行输出字符串升序排序的结果 如输入3AbcAbeAbd输出:AbcAbdAbeimport java.io.*; import java.util.*;import java.util.ArrayList.*;import java.uti

2017-08-30 05:32:01 4419

原创 java-冒泡排序

分类排序算法数据结构数组最坏时间复杂度O(n2)最优时间复杂度O(n)平均时间复杂度O(n2)空间复杂度总共O(n),需要辅助空间O(1)冒泡排序(英语:Bubble Sort,台湾另外一种译名为:泡沫排序)是一种简单的排序算法。它重复地走访过要排序的数列,一次比较两个元素,如果他们的顺

2017-08-29 11:39:43 273

原创 java高精度加法 hdu1002

A + B Problem IITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 241933    Accepted Submission(s): 46646Problem DescriptionI ha

2017-08-29 09:16:31 410

原创 数学

1.快速辗转相除法求最大公约数int gcd(int a,int b){if(b==0) return a;else return gcd(b,a%b);}2.2.辗转欧几里得算法//int extgcd(int a,int b,int& x,int& y){ 辗转欧几里得算法 int d=a; if(b!=0){ d= extgcd(b, a%

2017-08-27 03:39:19 336

原创 java的输入和输出及其学习过程记录

关于读入读一个整数: int n = cin.nextInt(); 相当于 scanf(“%d”, &n); 或 cin >> n;  读一个字符串:String s = cin.next(); 相当于 scanf(“%s”, s); 或 cin >> s;  读一个浮点数:double t = cin.nextDouble(); 相当于 scanf(“%lf”, &t); 或

2017-08-27 03:35:37 407

原创 读入挂模版

一般读入挂inline ll read(){ int x=0,f=1;char ch=getchar(); while(ch'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}更高级的读入挂namesp

2017-08-26 08:36:00 366

原创 简单学习如何在mac终端上编写c语言代码并编译

1.首先打开终端 然后输入 cd /Users/shadow(自己的用户名)/Desktop 用来指定文件夹位置 然后输入 vim 或者vi 来创建程序的名字之后按i键进行编写 编写完毕按esc 之后输入:wq 回车保存退出2.进行编译和执行 输入“gcc hello.c”编译程序,如果没有错误,继续输入./a.out hello.c执行该程序

2017-08-26 07:47:55 14232 4

原创 shawn的博客开通啦

#includeusing namespace std;int main(){cout<<"hello\n";return 0;}

2017-08-23 02:18:06 242

空空如也

空空如也

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

TA关注的人

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