题目 题目 当然,根固定为$1$,但是第一个被点亮的灯不一定是$1$。 做法 这里我只会讲最终做法,但是如果你要问这个结果到底是怎么得到的,其中的心路历程是什么,这篇博客:https://www.luogu.com.cn/blog/MachineryCountry/solution-p4253相信能 ...
分类:
其他好文 时间:
2020-10-20 16:40:42
阅读次数:
36
1 #include<bits/stdc++.h> 2 void quickSort(int a[],int first,int end) 3 { 4 if(first==end) return; 5 int i = first,j = end,temp; 6 while(i<j){ 7 while ...
分类:
编程语言 时间:
2020-10-20 16:26:37
阅读次数:
21
[TOC]## 1. Python基础### 1.1. 准备工作+ 安装python3,版本要求>=3.6+ 了解python的运行 启动python-IDLE,并运行 `print('hello world')`+ 预习内容请自行完成 + 教程推荐 + [《Python入门,从19个语法开始》](... ...
分类:
其他好文 时间:
2020-10-19 23:02:11
阅读次数:
34
##题目描述 假设银行有K个窗口提供服务,窗口前设一条黄线,所有顾客按到达时间在黄线后排成一条长龙。当有窗口空闲时,下一位顾客即去该窗口处理事务。当有多个窗口可选择时,假设顾客总是选择编号最小的窗口。 本题要求输出前来等待服务的N位顾客的平均等待时间、最长等待时间、最后完成时间。 ##输入 输入第1 ...
分类:
其他好文 时间:
2020-10-19 22:49:09
阅读次数:
22
import random #把random模块调用出来 age = random.randint(10,25)#用rand.randint制造一个随机数表 count = 0 while count < 3:#共有三次机会 n = int(input('Guess the age:'))#输入用户 ...
分类:
编程语言 时间:
2020-10-19 22:35:39
阅读次数:
23
#include <iostream> #include <cstring> using namespace std; char a[260]; int main() { int len,k; cin>>a; cin>>k; len=strlen(a); while(k--) { for(int i ...
分类:
其他好文 时间:
2020-10-19 22:33:48
阅读次数:
21
循环结构 循环结构: 重复执行特定语句 循环结构分类 for循环 while循环 3.do...while循环 1.for循环 1.1 语法: for(初始条件语句;终止条件语句;迭代条件语句){ 循环执行体 } 1.2 执行过程 (1) 初始化条件表达式 (2)判断循环表达式 (3)成立则执行条件 ...
分类:
编程语言 时间:
2020-10-19 22:33:00
阅读次数:
18
先序遍历 Stack<TreeNode> stk = new Stack<>(); stk.push(root); while (!stk.empty()) { TreeNode cur = stk.pop(); if (cur != null) { // visit cur stk.push(cu ...
分类:
其他好文 时间:
2020-10-19 22:18:07
阅读次数:
24
简介 java 基础数据结构 SET, java核心编程 统计不同的字符串 code import java.util.HashSet; import java.util.Iterator; import java.util.Scanner; import java.util.Set; public ...
分类:
编程语言 时间:
2020-10-18 16:16:23
阅读次数:
17