码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
P1939 【模板】矩阵加速(数列)
Aimee 矩阵加速递推的模板了。 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #define int long long #define ll long long using names ...
分类:其他好文   时间:2021-02-22 12:24:51    阅读次数:0
Codeforces Round #703 (Div. 2) C2. Guessing the Greatest(二分,交互)
https://codeforces.com/contest/1486/problem/C2 #include<cstdio> #include<iostream> #include<deque> #include<cstring> #include<cmath> #include<map> #in ...
分类:其他好文   时间:2021-02-22 12:10:32    阅读次数:0
网络流24题:最长 k 可重区间集问题题解
最长 k 可重区间集问题题解: 突然想起这个锅还没补,于是来把这里补一下qwq。 1.题意简述: 有$n$个开区间,这$n$个开区间组成了一个直线$L$,要求选择一些区间,使得在直线$L$上的任意一点,对于你选择的区间来说,包含这个点的区间个数不超过$k $,且满足区间长度和最大。 2.要点: 因为 ...
分类:其他好文   时间:2021-02-22 12:07:29    阅读次数:0
leetCode第一题
题目描述: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 ...
分类:其他好文   时间:2021-02-19 13:36:23    阅读次数:0
循环结构
循环结构 while循环结构 编程是为了解决人的问题 while是最基本的循环,他的结构为: while(布尔表达式){ //循环内容 } 只要布尔表达式为true,循环就会一直执行下去。 比如说while(true),就会一直表达true。 我们大多数情况是会让循环停下来,我们需要一个让表达式失效 ...
分类:其他好文   时间:2021-02-19 12:54:54    阅读次数:0
python中break语句
1、 aaa = "123" answer = input("please input the answer:") while True: if answer == aaa: break answer = input("please input the answer,again:") print(" ...
分类:编程语言   时间:2021-02-18 13:38:19    阅读次数:0
解决C++编译程序后闪退的方法
解决C++编译程序后闪退的方法 1)在return 0;前添加一条while(1); 2)编译不直接用F5,而是Ctrl+F5。 以上两种方法皆可解决。 ...
分类:编程语言   时间:2021-02-18 13:15:50    阅读次数:0
leetcode1539 第k个缺失的正整数
思路1: 暴力枚举。 实现1: 1 class Solution 2 { 3 public: 4 int findKthPositive(vector<int>& arr, int k) 5 { 6 int n = arr.size(); 7 vector<int> cnt(2001, 0); 8 ...
分类:其他好文   时间:2021-02-18 12:54:30    阅读次数:0
leetcode 82 删除排序列表中重复元素
没啥太难的思路,代码如下: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * List ...
分类:编程语言   时间:2021-02-18 12:53:10    阅读次数:0
JavaSE-统计字符在字符串中出现的次数
/** * 方法一:使用indexOf和subString方法,循环判断并截取 */ public static void getStrCount1(String str, String con) { int count = 0; while (str.indexOf(con) >= 0) { // ...
分类:编程语言   时间:2021-02-17 14:46:16    阅读次数:0
29426条   上一页 1 ... 30 31 32 33 34 ... 2943 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!