A /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define pb push_back using namespace std; typedef long long ll; typedef unsigned long long ull; const ll LLmaxn = 2e18; ; int main() { ; ; int n; cin >> n; ; i <= n;…
Servlet访问路径的两种方式: 1:注解 即在Servlet里写一个@WebServlet @WebServlet("/myServlet") 2:配置web.xml <Servlet-mapping> <Servlet-name>xxxx</Servlet-name> <url-pattern>/myServlet</url-pattern> </Servlet-mapping> Servlet生命周期特点:…
/** * calc_map_distance() , 根据地图上的两个点各自的x,y坐标,计算出2点之间的直线距离 * @param array $point_1 第1个点的x,y坐标 array( 101 , 202 ) * @param array $point_2 第2个点的x,y坐标 array( 101 , 202 ) * @param bool $calc_as_string 是否计算为字符串公里距离 , 如果未否返回数字 * @return float | false | str…
Codeforces 题面传送门 & 洛谷题面传送门 首先题目中涉及排列的 interval,因此可以想到析合树.由于本蒟蒻太菜了以至于没有听过这种神仙黑科技,因此简单介绍一下这种数据结构:我们注意到排列的区间有一个性质:对于排列中的两段区间 \(X,Y\),如果它们有交,那么必然有 \(X\cap Y,X\cup Y,X\setminus(X\cap Y),Y\setminus(X\cap Y)\) 四个集合均为区间,也就是说连续段之间只有包含没有相交关系,因此它们可以表示为一棵树形结构. 我…
最近公司一个需要,需要把商品的优惠卷分享链接,生成一个二维码然后和商品主图合成一张,并且在新合成的主图增加商品信息的描述,好了直接看合成后图片的样式 下面我就直接贴代码,首先是Contorller层 /** * 淘宝二维码,商品主图,合成一张图 * * @param pictUrl * @param request * @param response * @throws IOException */ @RequestMapping("/getTaoBaoqQRCode") public…
A /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define pb push_back using namespace std; typedef long long ll; typedef unsigned long long ull; const ll LLmaxn = 2e18; ; inline int readint() { char c = getchar(); ; ') { c…
Bob and Alice are often participating in various programming competitions. Like many competitive programmers, Alice and Bob have good and bad days. They noticed, that their lucky and unlucky days are repeating with some period. For example, for Alice…
题目链接:Letters Removing 题意: 给你一个长度为n的字符串,给出m次操作.每次操作给出一个l,r和一个字符c,要求删除字符串l到r之间所有的c. 题解: 看样例可以看出,这题最大的难点在于每次在字符串中删除了前面的字符会对后面的字符产生影响.如何确定当前l和r所指的字符?这里由于对字符的位置查询相当于单点操作区间查询,可以用树状数组维护字符串的前缀和,这样就可以确定l和r的位置了(二分+树状数组 : 复杂度(log(n)×log(n))).再把所有的字符放到set里面进行删除操…
update manage set mark = concat(mark,remark) select concat(mark,remark) as pp from manage…
  C. Dividing the numbers   time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Petya has n integers: 1, 2, 3, ..., n. He wants to split these integers in two non-empty groups in such a way tha…
B. Months and Years   time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Everybody in Russia uses Gregorian calendar. In this calendar there are 31 days in January, 28 or 29 days in February (…
  A. Splitting in Teams   time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There were n groups of students which came to write a training contest. A group is either one person who can write…
sql 同一张表开两个字段合成一个字段 例如   SQL tab 字段1 字段2 字段3 3 4 莫 合成 tab 字段1 字段2 3-4 莫     SQL SERVER select 字段1 + '-' + 字段2 as 字段1,字段3 as 字段2 from table1; ORACLE select 字段1 || '-' ||字段2 as 字段1,字段3 as 字段2 from table1…
一个日期段如工作时间为 8:00 至 17:00 public class TimeHelper { /// <summary> /// 计算时间间隔 /// </summary> /// <param name="tsStart"></param> /// <param name="tsEnd"></param> /// <param name="time_start"…
A. Points on the line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We've got no test cases. A big olympiad is coming up. But the problemsetters' number one priority should be adding anot…
C#计算两个时间年份月份差 DateTime dt1 = Convert.ToDateTime("2008-8-8"); DateTime dt2 = System.DateTime.Now; int Year = dt2.Year - dt1.Year; int Month = (dt2.Year - dt1.Year) * 12 + (dt2.Month - dt1.Month); 计算两个日期的时间间隔 TimeSpan ts1=new   TimeSpan(DateTime1.…
对成绩表"11_1_1.csv" "11_2_1.csv"进行集成,并重新计算4门课程的平均分为综合测评,增加“排名”属性,并按排名排序 "11_1_1.csv","11_2_1.csv"是两个不同班级的学生 setwd('D:\\data') #读取数据 dat1=read.csv('./11_1_1.csv',he=T) dat2=read.csv('./11_2_1.csv',he=T) result=rbind(dat…
由于JavaScript属于弱类型脚本语言,因此当其与强类型的后台语言进行数据交互时会产生各种问题,特别是加解密的操作.本人由于工作中遇到用js与Java进行相互加解密的问题,在网上查了很多资料及代码段,均无法解决.后总结多篇文档内容终于找到解决办法,现记录与此: 第一种:加解密时需要秘钥(key)和秘钥偏移量(iv)的情况,在线验证地址:http://www.seacha.com/tools/aes.html //该方法可与Java进行相互加解密 <!doctype html> <ht…
题目链接:点击打开链接 #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <iostream> #include <cmath> using namespace std; typedef long long ll; template <class T> inline bool rd(T &ret)…
E. Sonya and Problem Wihtout a Legend time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output Sonya was unable to think of a story for this problem, so here comes the formal description. You are g…
DateTime dtLast = new DateTime(Convert.ToInt32(LastMenses.Year), Convert.ToInt32(LastMenses.Month), Convert.ToInt32(LastMenses.Day)); DateTime dtThis = new DateTime(Convert.ToInt32(Year), Convert.ToInt32(thisMonth), Convert.ToInt32(Day)); int interva…
A /* Huyyt */ #include <bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define mkp(a,b) make_pair(a,b) #define pb push_back ][] = {{, }, {, }, {, -}, { -, }, {, }, {, -}, { -, -}, { -, }}; using namespace std; typedef long long ll; int main()…
题目链接:http://codeforces.com/problemset/problem/1121/B 题意 给n个数 最多的对数 其中每一对(i,j)的ai+aj都相等(不知道怎么解释.... 判断的话 大概是4重循环 因为每次都选4个数嘛 两两相加判等 不过会TLE 而且并不知道哪些值用了哪些没用 就可以预处理记录a[i]+a[j]出现的次数 然后排序找最大的就好了 代码有点鬼畜.. 代码如下 #include <cstdio> #include <algorithm> #i…
题目链接:http://codeforces.com/contest/1194                                            A.Remove a Progression time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output You have a list of numbers from 11…
I. Move Between Numbers   time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output You are given n magical numbers a1, a2, ..., an, such that the length of each of these numbers is 20 digits. You can move fro…
http://codeforces.com/gym/101911/problem/C Recently Monocarp has created his own mini-laboratory! The laboratory contains n bacteria. Monocarp knows that he can merge any two bacteria having equal sizes, and the resulting bacterium will have the size…
这篇文章开始正式<algorithm puzzles>一书中的解谜之旅了! 狼羊菜过河: 谜题:一个人在河边,带着一匹狼.一只羊.一颗卷心菜.他需要用船将这三样东西运至对岸,然而,这艘船空间有限,只容得下他自己和另一样东西(狼.羊或卷心菜).若他不在场看管的话,狼就会吃掉羊,羊就会吃掉卷心菜.此人如何才能把这三个“乘客”没有损失的送到对岸? 提示:看到这个谜题的谜面非常小,利用穷举解决是绰绰有余的. 解谜:首先搬运的一定是羊,将其搬运到对岸,将其放下,随后驾空船回来,这次带狼或者卷心菜都可以,…
1.前言 Atomicity是内存访问的一个属性,描述为原子性访问,包括single-copy atomicity和multi-copy atomicity 2.基本概念 observer 可以发起对memory read/write访问的都是observer Coherent order 全局一致性,即shareability domain中所有的observer观察到的对同个内存位置的全局的一致的写入动作(顺序): 注[1]:属于同一个shareability domain的observer…
#include<cassert> #include<cstdio> #include<vector> using namespace std; ,maxt=,maxn=; int seq[maxm]; int cnt[maxt]; vector<int> to[maxn]; int n,T; ; int ext[maxn]; bool flag; void dfs(int x){ vis[x]=timer; for(vector<int>::i…