码迷,mamicode.com
首页 >  
搜索关键字:answer    ( 2371个结果
编写一个截取字符串的函数,输入为一个字符串和字节数,输出为按字节截取的字符串。 但是要保证汉字不被截半个,如“我ABC”4,应该截为“我AB”,输入“我ABC汉DEF”,6,应该输出为“我ABC”而不是“我ABC+汉的半个”。
一、思路: 1、汉字的字节不能截半,截半的话字节对于的ASC码是小于0的值 2、一个英文字母(不分大小写)占一个字节的空间,一个中文汉字占两个字节的空间 PS: 不同编码方式1个英文字母占的字节是不同的: 1,ASCII码:一个英文字母(不分大小写)占一个字节的空间,一个中文汉字占两个字节的空间。 ...
分类:其他好文   时间:2020-05-11 18:23:08    阅读次数:95
POJ-2387(原始dijkstra求最短路)
Til the Cows Come Home "POJ 2387" 这题是最简单的最短路求解题,主要就是使用dijkstra算法,时间复杂度是$O(n^2)$. 需要注意的是,一定要看清楚题目的输入要求,是先输入边,再输入顶点,一开始我没看清,wrong answer了一次。 ...
分类:其他好文   时间:2020-05-09 20:41:51    阅读次数:53
The Shortest Statement
"题目" You are given a weighed undirected connected graph, consisting of $n$ vertices and $m$ edges. You should answer $q$ queries, the $i$ th query is ...
分类:其他好文   时间:2020-05-09 19:04:20    阅读次数:66
CF1051F The Shortest Statement
题目 You are given a weighed undirected connected graph, consisting of n vertices and m edges. You should answer q queries, the i th query is to find th ...
分类:其他好文   时间:2020-05-08 22:56:50    阅读次数:83
Servlet的本质?它是如何工作的?大白话
https://www.zhihu.com/question/21416727/answer/339012081 https://www.zhihu.com/question/21416727/answer/690289895 实战 https://www.runoob.com/servlet/se ...
分类:其他好文   时间:2020-05-06 21:51:56    阅读次数:85
luogu SP1043 GSS1 - Can you answer these queries I
``` //单点修改 pushup //查询区间内的最大字段和 #include #include #include #include using namespace std; const int N = 500010; int n, m; int w[N]; struct Node { //端点 ... ...
分类:其他好文   时间:2020-05-06 20:03:08    阅读次数:53
Can you answer these queries? HDU - 4027 (区间修改+区间查询)
Can you answer these queries? HDU - 4027 A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secre ...
分类:其他好文   时间:2020-05-05 00:41:14    阅读次数:64
Find Pair
Find Pair 思路 排一下序然后枚举计数就行了,不是挺简单的嘛。 这是我以为能过的代码,没想到$Wrong\ answer\ on\ test\ 3$,还是只能过样例。 ...
分类:其他好文   时间:2020-05-04 13:05:34    阅读次数:64
WPF 圆型布局(测量过程)
这个例子来自书上。 记录过程。 主要是数学上极坐标,WPF中的测量过程 简单来说在一个具有固定轴的坐标系内,一个由原点射出的向量并与固定轴有一定角度且在向量上确定长度的这么个东西。 可以参考: 知乎https://www.zhihu.com/question/318613418/answer/640 ...
分类:Windows程序   时间:2020-05-03 20:30:55    阅读次数:80
[Java工程实践] 1.Java常用概念
一、Java Bean基本概念: 1、所有属性为private2、提供默认构造方法3、提供getter和setter4、实现serializable接口 作者:杨博链接:https://www.zhihu.com/question/19773379/answer/31625054来源:知乎著作权归作 ...
分类:编程语言   时间:2020-05-02 18:35:58    阅读次数:65
2371条   上一页 1 ... 8 9 10 11 12 ... 238 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!