码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
11.04 实验课第一题往往搞人心态
取一组数据的最大值和最小值:(实验课第一题给我整傻了)先定义两个变量max,min,注意,这是变量而不是函数,所以在后面用的时候只起到了一个比较的作用。例如if(c>max)max=c.就是将这组数据的每一个数据与max比较,取较大的那一个。#include<stdio.h>intmain(){inta,b,c,max,min;while(scanf("%d"
分类:其他好文   时间:2020-11-06 01:32:35    阅读次数:18
The Delivery Dilemma
链接 : http://codeforces.com/problemset/problem/1443/C 标签 : binary search greedy sorting *1400 二分答案 AC代码 #include <bits/stdc++.h> using namespace std; # ...
分类:其他好文   时间:2020-11-06 01:18:03    阅读次数:19
二分查找(C++实现)
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
Cannot initiate the connection to ports.ubuntu.com:80
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
LeetCode 26 _ 删除排序数组中的重复项
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
leetcode213周赛
5556. 可以到达的最远建筑 刚开始写得时候感觉像贪心,但没分析好不敢写,自己写了个记忆化搜索,后来看讲解把贪心法给补上 记忆化搜索 const int MAXN = 1e5+50; class Solution { public: int dp[MAXN]; int dfs(int now, v ...
分类:其他好文   时间:2020-11-01 22:29:28    阅读次数:84
materialize 试用
前边有大概介绍过materialize,以下是一个简单的试用(基于官方文档,官方同时也提供了容器的运行环境) 环境准备 docker-compose 文件 version: "3" services: materialize: image: materialize/materialized:v0.5 ...
分类:其他好文   时间:2020-11-01 21:34:05    阅读次数:32
Android.5
import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annota ...
分类:移动开发   时间:2020-11-01 21:28:17    阅读次数:28
while单循环练习
单循环实现一行十个★ # 方法一 i = 0 while i < 10: print("★", end="") i += 1 print() # 方法二(通过变量的形式实现) i = 0 str_var = "" while i < 10: strvar += "★" i += 1 print(st ...
分类:其他好文   时间:2020-11-01 21:00:01    阅读次数:29
LeetCode 2.两数之和
class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { auto dummy = new ListNode(-1), cur = dummy; int t = 0; while(l1 || l2 | ...
分类:其他好文   时间:2020-11-01 20:59:38    阅读次数:11
29426条   上一页 1 ... 56 57 58 59 60 ... 2943 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!