class Solution { public: int peakIndexInMountainArray(vector<int>& arr) { int n = arr.size(); if(n==0) { return -1; } int left = 0; int right = n-1; w ...
分类:
编程语言 时间:
2020-11-04 17:43:48
阅读次数:
26
root@pcl-01:/usr/share/defaults/kata-containers# qemu-system-aarch64 -vqemu-system-aarch64: error while loading shared libraries: librbd.so.1: cannot ...
分类:
系统相关 时间:
2020-11-04 17:41:12
阅读次数:
35
这里是看了学长的例会以及挑战上关于博弈的知识进行一下知识总结 1、PN法 定义: 必败点P:位于此位置的人,在双方操作均优的情况下,必败,记作“0” 必胜点N:位于此位置的人,在双方操作均优的情况下,必胜,记作“1” 性质: 游戏结束的点(通常为0点)均为必败点 必胜点等价于必有一种方式可以到达必败 ...
分类:
其他好文 时间:
2020-11-02 10:50:17
阅读次数:
37
#include <bits/stdc++.h> using namespace std; const int mn=1e6+7; const int mod=1e9+7; int v[mn],p[mn],s[mn]; int main() { int n,tot=0; cin>>n; for(in ...
分类:
其他好文 时间:
2020-11-02 10:09:59
阅读次数:
47
1. 题目描述 2. 代码 1 class Solution: 2 def removeDuplicates(self, nums: 'List[int]') -> int: 3 prevalue = 0 4 n = len(nums) 5 count = 0 6 i,j = 0,0 7 while ...
分类:
编程语言 时间:
2020-11-02 09:55:41
阅读次数:
32
5556. 可以到达的最远建筑 刚开始写得时候感觉像贪心,但没分析好不敢写,自己写了个记忆化搜索,后来看讲解把贪心法给补上 记忆化搜索 const int MAXN = 1e5+50; class Solution { public: int dp[MAXN]; int dfs(int now, v ...
分类:
其他好文 时间:
2020-11-01 22:29:28
阅读次数:
84
好题: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e6 + 5; const LL Mod = 1e9 + 7; #define INF 1e9 #define dbg(x) c ...
分类:
其他好文 时间:
2020-11-01 22:04:43
阅读次数:
23
前边有大概介绍过materialize,以下是一个简单的试用(基于官方文档,官方同时也提供了容器的运行环境) 环境准备 docker-compose 文件 version: "3" services: materialize: image: materialize/materialized:v0.5 ...
分类:
其他好文 时间:
2020-11-01 21:34:05
阅读次数:
32
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annota ...
分类:
移动开发 时间:
2020-11-01 21:28:17
阅读次数:
28