基本的数值类型 一.数值类型 1.整数类型 byte: 1字节 short: 2字节 int: 4字节 long: 8字节 int num1=10; //最常用byte num2=20;short num3=30;long num4=30L; //long类型要在数字后面加个L 2.浮点类型 flo ...
分类:
其他好文 时间:
2020-10-09 20:57:46
阅读次数:
16
链接 Virtual participation A. Suborrays 观察发现任何排列均满足题意。 #include<bits/stdc++.h> using namespace std; int N; int main(){ ios::sync_with_stdio(0); cin.tie( ...
分类:
其他好文 时间:
2020-10-08 19:22:44
阅读次数:
15
一、java基础部分 1、java基本数据类型 共有八种:四种整数类型(byte、short、int、long) 两种浮点数类型(double、float) 一种字符类型(char) 一种布尔类型(boolean) 记忆:8位 Byte(字节型) 16位short(短整型)char(字符型) 32位 ...
分类:
编程语言 时间:
2020-10-07 20:43:46
阅读次数:
23
有一定的基础,但是还是要重新开始,2020.10.6 1.手写Hello World public class HelloWorld{ public static void main(String[] args){ System.out.println("Hello World"); } }2.设置 ...
分类:
编程语言 时间:
2020-10-06 21:11:09
阅读次数:
28
1. 什么是不可变类型 变量对应的值中的数据是不能被修改,如果修改就会生成一个新的值从而分配新的内存空间。 不可变类型: 数字(int,long,float) 布尔(bool) 字符串(string) 元组(tuple) 案例一 结果: 两个不同的数字 案例二: 结果: 两个不同的数字 2. 什么是 ...
分类:
编程语言 时间:
2020-10-06 20:15:20
阅读次数:
21
查询回文子串个数: #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<double,int> pii; const int N = 3e5+5; const int M = 1e6+5; c ...
分类:
其他好文 时间:
2020-10-05 22:16:55
阅读次数:
30
RT 考试的时候口胡出来的,正确性不会证,不过貌似100000内的数都是对的(现在已经会了,在此鸣谢gyz大佬) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=5e7+10,max ...
分类:
其他好文 时间:
2020-09-24 21:27:32
阅读次数:
46
IO队列长度监控 #!/bin/bash io () { device_num=`iostat -x | egrep "^sd[a-z]"` | wc -l iostat -x 1 3 | egrep "^sa[a-z]" | tail -n +$((device_num+1)) | awk '{i ...
分类:
其他好文 时间:
2020-09-21 11:55:46
阅读次数:
45
1 #include "apue.h" 2 3 int globvar = 6; 4 char buf[] = "a write to stdout\n"; 5 6 int main() 7 { 8 int var; 9 pid_t pid; 10 11 var = 88; 12 if (write ...
分类:
其他好文 时间:
2020-09-18 04:07:04
阅读次数:
36
P4349 CERC2015 Digit Division 思维提高,代码难度入门。 正解:快速幂。 考虑一个区间,如果模 \(M\) 等于0,那么就可以作为决策点,而决策点前后加合法段也是合法段。那么直接对于每一个前缀求一个模M的值,当值为0即可作为决策点。 判无解:如果最后一个区间(也就是末尾和 ...
分类:
其他好文 时间:
2020-09-18 03:28:13
阅读次数:
28