C语言 使用long类型: #include "math.h" int reverse(int x){ int max = pow(2,31)-1; int min = pow(2,31)*-1; long n=0; while (x!=0){ n = n*10 + x%10; x = x/10; ...
分类:
编程语言 时间:
2021-05-23 23:09:40
阅读次数:
0
public class Test { public static void main(String[] args) { // \u000A String s = "Hello World"; String s = "1212"; System.out.println(s); } } 错误:java ...
分类:
编程语言 时间:
2021-05-23 23:09:26
阅读次数:
0
二叉搜索树 二叉搜索树满足这样的性质: 每个节点 x 有一个键值。 节点 x 的键值大于等于左子树的任意节点 y 的键值. 节点 x 的键值小于等于右子树的任意节点 z 的键值. 二叉搜索树的表达 struct Node{ int key; Node*parent ; Node*left; Node ...
分类:
其他好文 时间:
2021-05-23 23:08:30
阅读次数:
0
class Solution { public: int reverse(int x) { // cout << 1111 << endl; long long ret = 0; long long y = x; int f = 0; if(y < 0) f = 1, y = -y; // cout ...
分类:
其他好文 时间:
2021-05-23 23:04:46
阅读次数:
0
3. 区间合并 原理:区间排序左端点有交集的区间可以合并 struct OI{int l, r;}num[N]; inline int cmp(OI a, OI b){return a.l < b.l;} //按照左端点排序 sort(num+1, num+1+n,cmp); void combin ...
分类:
其他好文 时间:
2021-05-23 23:02:19
阅读次数:
0
很明显的拓扑 推一波: https://www.luogu.com.cn/blog/Hehe-0/p2017-dizzy-cows-g 1 #include<bits/stdc++.h> 2 3 4 using namespace std; 5 const int mmm=1e6+1; 6 7 in ...
分类:
其他好文 时间:
2021-05-23 23:01:52
阅读次数:
0
//单链表基本操作 1 #include <stdio.h> 2 3 #include <stdlib.h> 4 5 6 typedef struct _NODE 7 { 8 int data; 9 struct _NODE *pNext; 10 }NODE,*PNODE; 11 12 PNODE ...
分类:
编程语言 时间:
2021-05-23 22:56:58
阅读次数:
0
类型转换 `低 高` `byte,short,char -> int -> long -> float -> double` 强制类型转换 (高 低) 自动类型转换(低 高) 注意点: 不能进行布尔值的转换 不能把对象类型转换为不相干的类型 在把高容量转换为低容量的时候,强制转换 转换的时候可能存在 ...
分类:
其他好文 时间:
2021-05-23 22:54:36
阅读次数:
0
Lock锁 公平锁:十分公平:可以先来后到 非公平锁:十分不公平:可以插队 (默认) public class Test02 { public static void main(String[] args) { //并发;多线程操作同一个资源类,把资源类丢入线程 Ticket1 ticket = n ...
分类:
其他好文 时间:
2021-05-20 17:50:58
阅读次数:
0
贪心。 经典活动安排问题。 注意点 不要忘记最后一个区间对最长连续挤奶时间区间的更新。 const int N=5010; PII a[N]; int n; int main() { cin>>n; for(int i=0;i<n;i++) cin>>a[i].fi>>a[i].se; sort(a ...
分类:
其他好文 时间:
2021-05-04 16:30:13
阅读次数:
0