01 2021 档案

摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2021-01-31 00:05 XA科研 阅读(72) 评论(0) 推荐(0) 编辑
摘要:Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r 阅读全文
posted @ 2021-01-30 22:20 XA科研 阅读(63) 评论(0) 推荐(0) 编辑
摘要:模板: //树状数组 解决动态前缀和问题的数据结构 //树状数组单词查询 int d[maxn],n; //返回最后一个1的下标 int lowbit(int x){ return x&(-x); } //查询 int query(int x){ int res=0; while(x){ res+= 阅读全文
posted @ 2021-01-28 20:44 XA科研 阅读(40) 评论(0) 推荐(0) 编辑
摘要:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher 阅读全文
posted @ 2021-01-27 23:37 XA科研 阅读(73) 评论(0) 推荐(0) 编辑
摘要:第一种,先处理源点的邻接结点,再循环处理其他结点(同陈越姥姥慕课代码) int findMin(){//查找为收录结点中dist最小的点 int mind=inf; int minv=-1; for(int i=1;i<=N;i++){ if(collected[i]==false&&dist[i] 阅读全文
posted @ 2021-01-27 23:07 XA科研 阅读(112) 评论(0) 推荐(0) 编辑
摘要:map为映射,可以将任何基本类型(包括STL容器)映射到任何基本类型(包括STL容器) 一、map定义: map<typename1,typename2> mp; 二、访问: map中的键是唯一的 通过下标访问: 例如:mp['c']=20 迭代器访问: map<typename1,typename 阅读全文
posted @ 2021-01-27 14:31 XA科研 阅读(169) 评论(0) 推荐(0) 编辑
摘要:int型变量的取值范围:[-2^31, 2^31 - 1] -> [-2147483648, 2147483647] 0x7fffffff = 2147483647 = (2^31 - 1) = (1 << 31) - 1 0x3fffffff = 1073741823 = (2^30 - 1) = 阅读全文
posted @ 2021-01-27 14:21 XA科研 阅读(11368) 评论(0) 推荐(0) 编辑
摘要:set为集合,是一个内部自动有序且不含重复元素的容器 一、set的定义 set<typename> name; 二、元素访问 set只能通过迭代器(iterator)进行访问 set<typename> ::iterator it; 三、常用函数 (1)insert() insert(x)将x插入s 阅读全文
posted @ 2021-01-27 14:07 XA科研 阅读(145) 评论(0) 推荐(0) 编辑
摘要:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s 阅读全文
posted @ 2021-01-26 23:49 XA科研 阅读(83) 评论(0) 推荐(0) 编辑
摘要:程序在CPU中执行,CPU中有程序计数器,寄存器,控制器等 代码都在磁盘上,读取时被拿到内存中(转化成机器指令),并被程序计数器来技术和标记 无并发时:CPU中执行,需要排队,一行一行执行 有并发时:利用进程,来回切换--(将部分进程拿出)-->线程(只管理小块资源)(做CPU切换)->时间片 一个 阅读全文
posted @ 2021-01-26 22:08 XA科研 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Java连接数据库须知: 数据库的基本信息: 1、数据库服务器在哪儿?ip或者域名,202.196.38.84,localhost,127.0.0.1,用户名和密码 * 2、数据存放的数据库资源名叫什么?studnetmanage 3、数据库存放到数据库中的哪个数据表?student * */ /* 阅读全文
posted @ 2021-01-26 21:51 XA科研 阅读(119) 评论(0) 推荐(0) 编辑
摘要:SQL基础知识: Char :定长子符型 Varchar :变长字符型 创建数据库:create databalse 数据库名(); 选择数据库: use 数据库名; 创建表: Eg:CREATE TABLE Students(sno CHAR(9) NOT NULL PRIMARY KEY,sNa 阅读全文
posted @ 2021-01-26 21:48 XA科研 阅读(96) 评论(0) 推荐(0) 编辑
摘要:dfs:搜索全部解,棋盘问题,八皇后问题 bfs:用来搜索无权最短路径,最少步数,最少交换次数,因为bfs搜索过程中遇到的解一定是离根最近的,所以遇到第一个解,一定是最优解。 总结:无权图最短路径用广搜,全部解用深搜 阅读全文
posted @ 2021-01-26 17:14 XA科研 阅读(107) 评论(0) 推荐(0) 编辑
摘要:Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469135 阅读全文
posted @ 2021-01-25 22:58 XA科研 阅读(119) 评论(0) 推荐(0) 编辑
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the 阅读全文
posted @ 2021-01-25 21:13 XA科研 阅读(96) 评论(0) 推荐(0) 编辑
摘要:#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; //全排列算法 求n的全排列以及排列个数 void perm(int a[], 阅读全文
posted @ 2021-01-25 15:11 XA科研 阅读(75) 评论(0) 推荐(0) 编辑
摘要:pair是一种将两个元素绑在一起的容器,需要使用头文件:#include<utility> 1.定义: pair<typename1,typename2> name; 初始化: pair<string,int>p("hahaha",5); 2.pair元素的访问 示例: #include<iostr 阅读全文
posted @ 2021-01-25 14:53 XA科研 阅读(172) 评论(0) 推荐(0) 编辑
摘要:一、queue queue为队列 定义:queue<typename> name; 常用函数为: (1)push() push(x):将x进行入队 (2)empty() 检测队列是否为空 (3)pop() 令队首元素出队 (4)size() 返回队列元素的个数 (5)front() , back() 阅读全文
posted @ 2021-01-25 14:39 XA科研 阅读(122) 评论(0) 推荐(0) 编辑
摘要:一、max() , min() , abs() max(x,y)和min(x,y)分别返回x和y的最大值和最小值,且参数必须是两个(可以是浮点数) 二、swap() swap(x,y)用来交换x和y的值 三、reverse() reverse(it,it2)可以将数组指针在(t,t2)之间的元素或容 阅读全文
posted @ 2021-01-25 14:16 XA科研 阅读(264) 评论(0) 推荐(0) 编辑
摘要:在C语言中,一般使用字符数组char str[]来存放字符串,但是使用字符数组有时会显得麻烦,C++在STL中加入了string类型,对字符串常用的需求功能进行了封装,使得操作起来更方便,且不易出错。 如果需要使用string ,需要添加string头文件,即#include<string> (注: 阅读全文
posted @ 2021-01-25 11:44 XA科研 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Synchronized Synchronized锁定类,锁住的是类字节码对象 总结: 1、 无论synchronized关键字加在方法上还是对象上,如果它作用的对象是非静态的,则它取得的锁是对象;如果synchronized作用的对象是一个静态方法或一个类,则它取得的锁是对类,该类所有的对象同一把 阅读全文
posted @ 2021-01-25 10:47 XA科研 阅读(63) 评论(0) 推荐(0) 编辑
摘要:dijkstra与prim比较: 两者算法思想类似,只不过前者收录的是路径上的点,后者收录的是树上的点 另外,如果图中出现很多相同边,很可能在prim所确定的树上,源点到其他点的距离不满足dijkstra的条件,即距离不是最短的。 比如下图这种情况: 若A为源点,红线所连为prim生成的最小生成树, 阅读全文
posted @ 2021-01-25 10:44 XA科研 阅读(409) 评论(0) 推荐(0) 编辑
摘要:我相信 这两个月疯狂学习数学背单词和刷PAT的日子,将使我终生难忘 阅读全文
posted @ 2021-01-25 10:35 XA科研 阅读(29) 评论(0) 推荐(0) 编辑
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2021-01-24 23:47 XA科研 阅读(93) 评论(0) 推荐(0) 编辑
摘要:ctrl + shift+a : 代码格式化对齐 ctrl+左右键 : 使光标移动一个单词的距离 shift+左右键 : 可以选中光标左右的一个字符 阅读全文
posted @ 2021-01-24 21:54 XA科研 阅读(647) 评论(0) 推荐(0) 编辑
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2021-01-24 21:40 XA科研 阅读(79) 评论(0) 推荐(0) 编辑
摘要:A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp 阅读全文
posted @ 2021-01-22 22:28 XA科研 阅读(93) 评论(0) 推荐(0) 编辑
摘要:一、vector的常见用法详解 1.vector的定义 头文件:#include<vector> 单独定义一个vector: vector<typename> name; 注:如果typename也是一个STL容器,定义的时候要记得在>>符号之间加上空格,因为一些使用C++11之前标准的编译器会把它 阅读全文
posted @ 2021-01-22 21:29 XA科研 阅读(165) 评论(0) 推荐(0) 编辑
摘要:As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some ro 阅读全文
posted @ 2021-01-21 23:25 XA科研 阅读(139) 评论(0) 推荐(0) 编辑
摘要:It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c 阅读全文
posted @ 2021-01-19 22:44 XA科研 阅读(150) 评论(0) 推荐(0) 编辑
摘要:This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu 阅读全文
posted @ 2021-01-15 23:44 XA科研 阅读(123) 评论(0) 推荐(0) 编辑
摘要:设计函数分别求两个一元多项式的乘积与和(含排序) C++代码(全指针,无引用): #include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> # 阅读全文
posted @ 2021-01-15 22:36 XA科研 阅读(467) 评论(0) 推荐(0) 编辑
摘要:A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re 阅读全文
posted @ 2021-01-14 21:41 XA科研 阅读(120) 评论(0) 推荐(0) 编辑
摘要:Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, ..., N​j​​ } where 1. The Max 阅读全文
posted @ 2021-01-14 00:13 XA科研 阅读(87) 评论(0) 推荐(0) 编辑
摘要:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door 阅读全文
posted @ 2021-01-13 22:29 XA科研 阅读(154) 评论(0) 推荐(0) 编辑
摘要:With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing ba 阅读全文
posted @ 2021-01-13 21:45 XA科研 阅读(119) 评论(0) 推荐(0) 编辑
摘要:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev 阅读全文
posted @ 2021-01-13 21:12 XA科研 阅读(144) 评论(0) 推荐(0) 编辑
摘要:scattered 分散的 positive integers 正整数 negative 负的 currently 当前的 respectively 分别的,各自的 guaranteed 保证 print in 打印 separated 分开的 exactly 精确的 digits 数字 conse 阅读全文
posted @ 2021-01-07 23:02 XA科研 阅读(287) 评论(0) 推荐(0) 编辑
摘要:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2021-01-07 22:50 XA科研 阅读(117) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示