Array数组的创建和初始化12int[] a = new int[n];Array.fill(a,1);//全部初始化为1
List(链表数组)1List<Integer>[]g = new List[n];
Binary Indexed Trees(树状数组)1.lowbit**lowbit(x)**是x的二进制表达式中最低位的1所对应的值。比如,6的二进制是110,所以lowbit(6)=2。
lowbit(x) = x&(-x)
![imag...
Sort1.Array.sort()1234567891011121314import java.io.BufferedWriter;import java.io.OutputStreamWriter;import java.util.Arrays;...
Integer一、引入基本数据类型: boolean,char,byte,short,int,long,float,double封装类类型:Boolean,Character,Byte,Short,Integer,Long,Float,Double
...
StringcharAt返回指定索引的字符:
12String a = new String("Hello world\n");char c = a.charAt(4);
compareTo与其他字符串比较
相同为0
用大比小:正
用小比大:负
...
Write1.BufferedWriter主要用于写入字符串,如果要将整型写入到BufferedWriter,你需要先转为字符串再进行写入。如果你尝试传递一个整数,它将被视为字符的Unicode码。
头文件:
1import java.io.*;
...
BigInteger & BigDecimal1.BigInteger高精度整数
头文件:
1import java.math.BigInteger ;
1.1类型转换1.1.1 string 转 BigInteger1Biginteger...
fast_read1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162i...
判环的几种方法拓扑排序判环
对于有向图:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556...
The 2023 ICPC Asia Nanjing Regional Contest CGC. Primitive Root题意:问你满足:并且的有多少个?
思路:我们知道异或的性质:
由于,即
那么
根据上述性质:,则有:
即:
又因为,那么...