自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Android项目编译报Unresolved reference: xxx错误

1.出错的地方是通过viewBinding的方式使用控件,结果报错解决:之前项目能跑,版本问题更新即可,重新sync

2021-07-09 11:08:15 2799

原创 Java 后缀表达式求值

import java.util.Stack;/* 后缀表达式求值 */public class PostfixExpression extends Thread{ public static void main(String args[]) { String inputStr = ""; //后缀表达式字符串 Stack<Double> st = new Stack<Double>();

2020-10-30 10:50:02 774

原创 L1-002 打印沙漏 (20分)

注意:不用输出符号后面的空格AC代码:#include<iostream>using namespace std;int main(){ int n; int sum = 1; int i = 1; //该行的个数 int i2; int row = 1; //行数 char str; cin >> n; cin >> str; wh...

2020-01-13 23:53:08 1184

原创 L1-020 帅到没朋友 (20分)

当芸芸众生忙着在朋友圈中发照片的时候,总有一些人因为太帅而没有朋友。本题就要求你找出那些帅到没有朋友的人。输入格式:输入第一行给出一个正整数N(≤100),是已知朋友圈的个数;随后N行,每行首先给出一个正整数K(≤1000),为朋友圈中的人数,然后列出一个朋友圈内的所有人——为方便起见,每人对应一个ID号,为5位数字(从00000到99999),ID间以空格分隔;之后给出一个正整数M(≤100...

2020-01-03 08:46:32 942 2

原创 HDU 2544(单源最短路问题Dijkstra算法)

最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 112304 Accepted Submission(s): 48320Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-sh...

2019-11-24 11:46:54 96

原创 Jungle Roads(并查集和kruskal)

Jungle RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12024 Accepted Submission(s): 8794Problem DescriptionThe Head Elder of the t...

2019-11-24 09:33:34 125

原创 Oil Deposits(深度优先搜索DFS)

Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a ...

2019-11-24 09:28:54 189

转载 java mkdir()和mkdirs()区别

mkdirs()可以建立多级文件夹, mkdir()只会建立一级的文件夹, 如下:new File("/tmp/one/two/three").mkdirs();执行后, 会建立tmp/one/two/three四级目录new File("/tmp/one/two/three").mkdir();则不会建立任何目录, 因为找不到/tmp/one/two目录, 结果返回false...

2019-06-23 20:58:43 5015

原创 java try catch的用法与实例

package work;import java.io.*;public class Student{ public static String search()throws IOException { String s=" "; int n; try { InputStreamReader ir=new InputStreamReader(System.in...

2019-06-23 18:09:23 603

原创 c++-----vector开辟空间

#include<bits/stdc++.h>using namespace std;int main(){ int n=3; vector<int>c; for(int i=0;i<n;i++) { c.push_back(i); } for(int i=0;i<n;i++) { cout<<c[i]<&...

2019-06-23 18:09:05 2833

原创 Java---Math类

Math类public class Demo { public static void main(String []args) { double a; a=Math.random()*100;//随机数 System.out.println("a="+a); a=Math.PI; //PI System.out.println("a="+a); a=Math.sq...

2019-06-23 18:08:08 87

原创 java---String类与StringBuffer类

String类①:String内容一旦确定不能更改,更改只可以重新开辟空间来储存新的内容final类,不能继承。StringBuffer类②:StringBuffer的内容可以追加更改String类String s="we are student";String s=new String("we are student");StringBuffer类StringBuffer s...

2019-06-23 18:07:53 89

原创 java---迭代器的应用

Iterator的对象问题由集合调用iterator()方法返回一个Iterator对象ArrayList list=new ArrayList();Iterator itr=list.iterator();package 迭代器遍历ArrayList;import java.util.*;public class Demo { public static void main(Str...

2019-06-23 18:04:40 110

原创 java---arraylist类

①:arraylist 默认类型为object类②:

2019-06-23 15:04:03 125

原创 cf---A. Patrick and Shopping

Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his h...

2019-06-17 10:37:19 93

转载 cf---B. Nauuo and Chess

Nauuo is a girl who loves playing chess.One day she invented a game by herself which needs n chess pieces to play on a m×m chessboard. The rows and columns are numbered from 1 to m. We denote a cell ...

2019-06-10 11:45:35 313

原创 cf--A. Calculating Function 水题超时

For a positive integer n let’s define a function f:f(n) =  - 1 + 2 - 3 + … + ( - 1)nnYour task is to calculate f(n) for a given integer n.InputThe single line contains the positive integer n (1 ≤ ...

2019-06-10 11:45:10 235

原创 cf刷题---贪心算法应用-B. Taxi

B. Taxitime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the lessons n groups of schoolchildren went outside and decided to visit Polycar...

2019-06-10 11:45:04 324

原创 cf-贪心算法--A - Ilya and a Colorful Walk

#include<bits/stdc++.h>using namespace std;int main(){ int n; int max=0; int temp=0; int j; int house[300000]; cin>>n; j=n-1; for(int i=0;i<n;i++) { cin>>house[i]; ...

2019-06-10 11:44:56 259

转载 A. Combination Lock

Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there the treasures that he’s earned fair and square, he has to open the lock.The com...

2019-06-10 11:44:44 463

原创 刷题日记----136A - Presents

A. Presentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya very much likes gifts. Recently he has received a new laptop as a New...

2019-06-10 11:44:27 313

原创 A. Chat room

A. Chat roomtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has recently learned to type and log on to the Internet. He immediately ente...

2019-06-10 11:44:21 697

原创 cf-----A. Insomnia cure

A. Insomnia curetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output«One dragon. Two dragon. Three dragon», — the princess was counting. She had ...

2019-06-10 11:44:14 291

原创 天梯赛-----L1-2 6翻了 (15 分)

“666”是一种网络用语,大概是表示某人很厉害、我们很佩服的意思。最近又衍生出另一个数字“9”,意思是“6翻了”,实在太厉害的意思。如果你以为这就是厉害的最高境界,那就错啦 —— 目前的最高境界是数字“27”,因为这是 3 个 “9”!本题就请你编写程序,将那些过时的、只会用一连串“6666……6”表达仰慕的句子,翻译成最新的高级表达。输入格式:输入在一行中给出一句话,即一个非空字符串,由不...

2019-06-10 11:44:06 1435

原创 cf---A. Design Tutorial: Learn from Math

One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.For example, there is a stateme...

2019-06-10 11:43:56 258

原创 cf---A. Amusing Joke

So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two “New Year and Christmas Men” meet, thear assistants cut out of cardboard the letter...

2019-06-10 11:43:48 400

转载 codeforces -584A

#include<cstdio>#include<algorithm>using namespace std;int main(){ int n,t; while(scanf("%d%d",&n,&t)!=EOF) { if(t>=2&&t<10) { for(int i=0;i<n;i++) ...

2019-06-07 17:43:13 157

原创 java----setLayout(null)

未设置Layout时,java默认为flowLayout布局的,设置为null即为清空布局管理器,之后添加组件,常常是设置组件左上角坐标相对于容器左上角(0,0)的x,y值来确定组件的位置,即使更改容器大小也不会改变位置。这种方式常常用于窗体大小固定的容器里。...

2019-06-05 22:03:24 2929

原创 java---HashSet用法

import java.util.*;public class Demo { public static void main(String []args) { //HashSet不允许有重复的元素.主要用于哈希算法确定元素在集合中的位置 Set set = new HashSet(); set.add(new Data()); set.add(new Data()); S...

2019-06-04 22:51:26 2247

原创 c++---string遇到空格读取结束问题

string类基本的输入函数有如下几个:1)istream& operator>>(istream&,string&);2)istream& getline(istream&,string&);3)istream& getline(istream&,string&,char);所以使用cin默认是读取一个词...

2019-05-19 23:43:47 8968 1

原创 c++----memset用法

#include<iostream>//#include"string.h"using namespace std;int main(){ char str[10]; str[9] = 'w'; memset(str,97,9); for(int i=0;i<10;i++){ cout<<str[i]<&l...

2019-05-19 23:42:41 104

原创 c++----map函数的应用

//数据的插入–第一种:用insert函数插入pair数据map<int,string>mapstudent; mapstudent.insert(pair<int,string>(0,"student_one")); mapstudent.insert(pair<int,string>(1,"student_two")); mapstudent.ins...

2019-05-19 23:42:24 489

空空如也

空空如也

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

TA关注的人

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