nikkei2019_2_qual_e Non-triangular Triplets https://atcoder.jp/contests/nikkei2019-2-qual/tasks/nikkei2019_2_qual_e 给出 \(N\) 和 \(K\) . 判断对于这 $3N$ 个数 \ ...
分类:
其他好文 时间:
2020-06-25 09:34:22
阅读次数:
52
方法一: 哈希表 时间复杂度:O(n) 空间复杂度:O(n) class Solution: def hasCycle(self, head: ListNode) -> bool: dict = {} while head: if head in dict: return True else: di ...
分类:
其他好文 时间:
2020-06-25 09:26:14
阅读次数:
60
C++相比较C语言来说,多了两个东西: 类(面向对象的编程),模板(泛型编程) 数据类型 1.bool 布尔 表示真假 占一个字节(只需一个位,但内存最小存储单位是字节) 取值:true false bool isMax(int a,int b) { return a > b; } 2.引用 为变量 ...
分类:
编程语言 时间:
2020-06-24 23:35:52
阅读次数:
87
题目链接:https://codeforces.com/contest/1369/problem/E 题意 Lee 有 $n$ 种不同种类的食物和 $m$ 个朋友,每种食物有 $w_i$ 个,每个朋友喜欢吃两种食物 $x_i, y_i$,如果一个朋友被叫去厨房时一个喜欢吃的食物也没有,他就会吃掉 L ...
分类:
其他好文 时间:
2020-06-24 22:07:53
阅读次数:
71
https://www.luogu.com.cn/problem/P1873 #include<bits/stdc++.h> using namespace std; int n, m, a[1000005], max_h=-1; bool check(int h){ long long sum=0 ...
分类:
其他好文 时间:
2020-06-24 21:58:12
阅读次数:
53
#include <string> #include <iostream> #include <thread> #include <atomic> class spin_lock{ private: std::atomic<bool> flag = ATOMIC_VAR_INIT(false); p ...
分类:
其他好文 时间:
2020-06-24 20:00:25
阅读次数:
50
转 https://www.cnblogs.com/qq450867541/p/5977689.html 传值就是将实参的值传到所调用的函数里面,实参的值并没有发生变化,默认传值的有int型,浮点型,bool型,char字符型,结构体等等。 传址就是将地址传到所调用的函数里面操作,实参的值也会跟着变 ...
#include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<iostream> using namespace std; const int maxn=1e6+10; const int inf=0x ...
分类:
其他好文 时间:
2020-06-24 12:05:43
阅读次数:
37
List 接口概述: 鉴于 Java 中数组用来存储数据的局限性,我们通常使用 List 替代数组; List 集合类中元素有序,可重复,集合中的每个元素都有对应的顺序索引; List 容器中的元素都对应一个整数型的序号记载其在容器中的位置,可以根据序号存取容器中的元素; JDK API中List接 ...
分类:
其他好文 时间:
2020-06-24 10:33:37
阅读次数:
73
/** * 秒数转时分格式 * @param $time int * @author jack * @throws string * @return string */ function Sec2Time($time) { if (is_numeric($time)) { return (bool) ...
分类:
Web程序 时间:
2020-06-24 00:15:41
阅读次数:
258