ICode9

精准搜索请尝试: 精确搜索
  • Codeforces Round #808 (Div. 1)(A~C)2022-07-17 10:01:23

    Codeforces Round #808 (Div. 1)(A~C) A:Doremy's IQ 题目大意 给你一个序列,然后你从左到右可以选择弄或者不弄。 然后你有一个智商值,如果你当前弄的数小于等于它就无影响,否则智商值减一,如果变成了 \(0\) 就无法操作。 要你最大化弄的次数,并构造方案。 思路 小溪了这题就卡了半天。

  • P1006 [NOIP2008 提高组] 传纸条 题解2022-07-16 23:07:39

    传纸条 这题一眼看就是 DP。考虑如何建状态。 首先,我们可以把问题转化为从 \((1,1)\) 出发,选择到 \((n,n)\) 的两个路径,使这两个路径中途没有交点。 有一个显然的性质:从 \((1,1)\) 出发,走到 \((x,y)\) 需要 \((x-1)+(y-1)\) 步。在这道题里,只要同一时刻,两个点的纵坐标不相等,则这两

  • Lab10 mmap2022-07-15 15:32:37

    Lab10 mmap(hard) (期末复习操作系统的时候,过于无聊,因为题目都写不来,于是做了这个lab,比做题有意思多了。这个实验是hard,不过我做的很顺利,感觉有一种自己变强的假象hhh) void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); 这个实验要

  • 两数加和2022-07-15 01:00:31

    两数之和     给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target  的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 你可以按任意顺序返回答案。   示例 1: 输入

  • Linux 备份2022-07-14 23:04:05

    备份 dump -0aj -f /tmp/home0.bak /home #制作一个 '/home' 目录的完整备份dump -1aj -f /tmp/home0.bak /home #制作一个 '/home' 目录的交互式备份restore -if /tmp/home0.bak

  • 文件管理之:创建/复制/移动/删除2022-07-14 21:32:01

    文件管理之:创建/复制/移动/删除 1.文件创建touch touch file #无则创建,有则修改时间 touch file2 file3 touch /home/od/file4 file5 touch file{a,b,c} #{}集合,等价 touch a b c touch file{1..10} touch file{a..z} 2.目录创建命令mkdir 选项:-

  • 【超详细】手把手教你搭建MongoDB集群搭建2022-07-14 15:02:57

    MongoDB集群搭建 MongoDB集群简介 mongodb 集群搭建的方式有三种: 主从备份(Master - Slave)模式,或者叫主从复制模式。 副本集(Replica Set)模式 分片(Sharding)模式 其中,第一种方式基本没什么意义,官方也不推荐这种方式搭建。另外两种分别就是副本集和分片的方式。 Mongo分片高可

  • ARC142D Deterministic Placing2022-07-13 22:33:38

    原题链接 https://atcoder.jp/contests/arc142/tasks/arc142_d 对我来说,这是一道很复杂的 \(dp\) 题,很考验基本功,也十分考验分析问题的准确性。 考场上我的大致思路已经大差不差了,但是 \(dp\) 转移的细节实在是过于冗杂,导致我经过了一个月才把这道题目搞定,其中经历了各种没有考虑

  • 1084 外观数列 测试点4 超时2022-07-13 13:34:04

    易错点 测试点4超时 解决方案 tmps=tmps+tmpc+to_string(tmp); 改成 tmps+=tmpc+to_string(tmp); 原因 a+=b比a=a+b快很多! 因此+=的形式不仅仅是代码书写习惯的问题,关系到代码运行速度,可以尽量写成+=的形式。 代码 #include <iostream> #include <cstdio> #include <string> usi

  • C++模板基本语法2022-07-13 13:01:46

    #include <iostream> template<typename T> void myswap(T &a, T &b) { T tmp = a; a = b; b = tmp; } int main() { using namespace std; int a = 1; int b = 2; myswap(a, b); cout << "a " << a &l

  • Mongodb-Robo 3T使用js函数遍历集合+分割数组+拼接字段+修改对象2022-07-13 09:36:04

    db.getCollection("t_ythgk_yjxxfkpz").find({"fkmc": {"$regex":","}}). forEach( function(item) { var tmp = []; var pjtmp = ""; tmp = item.fkmc.split(","); for(var k in tmp){ var fhmc = db.getCollec

  • 1078 字符串压缩与解压 较简单2022-07-12 22:31:07

    代码 #include <iostream> #include <cstdio> #include <string> using namespace std; int main() { char ch; string s; char tmpc; int tmp=0; cin>>ch; getchar(); if(ch=='C'){ getline(cin,s); for(int i=0;s[i]!=NULL;i+

  • 1064 朋友数 较简单2022-07-11 20:31:11

    代码 #include <iostream> #include <cstdio> #include <string> #include <set> using namespace std; int main() { int n; string a; int tmp; set<int> st; cin>>n; for(int i=0;i<n;i++){ cin>>a; tmp=0; for(in

  • 1063 计算谱半径 较简单2022-07-11 20:09:30

    注意点 开方用到cmath 代码 #include <iostream> #include <cstdio> #include <cmath> #include <iomanip> using namespace std; int main() { int n; int a,b; float tmp; float max=-1; cin>>n; for(int i=0;i<n;i++){ cin>>a>&g

  • 配置文件——zabbix proxy2022-07-11 16:08:36

    ProxyMode=0Server=127.0.0.1ServerPort=10051Hostname=zabbixserverListenPort=10051SourceIP=192.168.20.60LogType=fileLogFile=/tmp/zabbix_proxy.logLogFileSize=100LogRemoteCommands=0PidFile=/tmp/zabbix_proxy.pidSocketDir=/tmpDBHost=localhostDBName=zabbix_proxy

  • 配置文件——zabbix agent2022-07-11 16:06:16

    PidFile=/tmp/zabbix_agentd.pidLogType=fileLogFile=/tmp/zabbix_agentd.logLogFileSize=100DebugLevel=3SourceIP=192.168.20.60Server=127.0.0.1ListenPort=10050ListenIP=0.0.0.0StartAgents=3ServerActive=127.0.0.1Hostname=zabbixserverTimeout=3AllowRoot=0User=zabbi

  • linux yum2022-07-11 16:03:17

    linux yum 1.1 保存离线安装包 最好是同一版本同一个模板下的系统,否则可能会少包或者版本不对 //下载yum插件 yum -y install yum-plugin-downloadonly //离线docker的rpm包保存到/tmp/docker/ yum install -y docker-ce --downloadonly --downloaddir=/tmp/docker/ //进入目录,rpm

  • 1055 集体照 较复杂2022-07-11 12:07:09

    关键 双端队列的使用 数值和字符串的相互映射(有重复值) 代码 #include <iostream> #include <cstdio> #include <string> #include <set> #include <deque> #include <algorithm> using namespace std; string array[300][2000]; int a[10001]; string h[10001]

  • LeetCode 3Sum 双指针2022-07-11 03:31:06

    Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Solution 我们需要输出方案,不在乎下标,

  • c++ 模板2022-07-10 15:01:53

    1 函数模板 语法: (其中typename可以使用class代替) template <typename 类型名称1, typename 类型名称2[, ...]> 返回值类型 函数名(形式参数){ //TODO, 可以使用类型参数 } 举例 #include <iostream> template <typename T> void Swap0(T *x, T *y){ //使用指针为参数

  • 1050 螺旋矩阵 二维矩阵 难度较大2022-07-10 11:06:11

    问题分解 数组倒序排列 指定正整数,求其两个最接近的因子m、n 顺时针螺旋矩阵打印 注意点 二维数组 代码 #include <iostream> #include <cstdio> #include <set> #include <vector> using namespace std; int main(){ int N; int a; int m,n; int level; multiset<int>

  • DCL2022-07-10 10:38:52

    DCL - 用户管理 1. 查询用户 use mysql; #用户名都放在mysql数据库的user表中 select * from user; 2. 创建用户 create user '用户名'@'主机名' identified by '密码';主机名替换为%,表示任意主机都可以访问 3.修改用户密码 alter user '用户名'@'主机名' identified with

  • leetcode-1422. 分割字符串的最大得分2022-07-09 15:01:56

    1422. 分割字符串的最大得分 刷题代码汇总:https://www.cnblogs.com/geaming/p/16428234.html 题目 思路 首先统计出整个字符串中的所有0的个数,采用for循环从左到右依次计算不同分割方式的得分情况。 \[num_{right1} = len - n - 1 - (num_0-num_{left0}) \]右侧字符串1个数=右侧

  • day122022-07-09 12:39:41

    1.剑指 Offer 25. 合并两个排序的链表 把l2链合并到l1链上 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; 8 */ 9 class Solution {

  • NC50940 Running Median2022-07-09 00:03:31

    题目链接 题目 题目描述 For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, output the median (middle value) of the elements received so far. 输入描述 The first line of input cont

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有