码迷,mamicode.com
首页 >  
搜索关键字:动态数组 索引越界 vector    ( 12363个结果
3基础、Simulink信号
3.1 Simulink信号概述 3.2 Simulink信号的操作 3.3 Simulink信号的分类 3.3.1 Scalar信号 3.3.2 Vector信号 3.3.3 Matrix信号 3.3.4 Bus信号 3.3.5 Fucntion-call信号 3.3.6 尺寸可变信号 3.3.7 ...
分类:其他好文   时间:2021-02-22 12:30:17    阅读次数:0
1037 Magic Coupon (25 分)
水题~。 魔鬼变量名。 vector<int> positive_coupon,negative_coupon; vector<int> positive_product,negative_product; int nc,np; int main() { cin>>nc; for(int i=0;i ...
分类:其他好文   时间:2021-02-20 11:51:01    阅读次数:0
第三节:观察者模式——JDK应用的源码分析
一、观察者模式在 JDK 应用的源码分析 1、JDK 的 Observable 类就使用了观察者模式 2、源码分析 Observable 通过 Vector 来管理 Observer 其中提供了 add/delete/notify 等方法来管理观察者; Observer 是一个接口,提供了一个 up ...
分类:其他好文   时间:2021-02-20 11:49:24    阅读次数:0
CCF 201809-1 卖菜
#include <iostream> #include <bits/stdc++.h> #include <string> using namespace std; int main() { int n; cin>>n; vector<int> a; for(int i=0;i<n;i++) { ...
分类:其他好文   时间:2021-02-19 13:54:37    阅读次数:0
1047 Student List for Course (25 分)
兄弟题1039 Course List for Student (25 分),一样很水。 vector<string> course[2510]; int n,m; int main() { cin>>n>>m; for(int i=0;i<n;i++) { string name; name.re ...
分类:其他好文   时间:2021-02-19 12:59:54    阅读次数:0
剑指 Offer 59 - I. 滑动窗口的最大值
一、题目描述 给定一个数组 nums 和滑动窗口的大小 k,请找出所有滑动窗口里的最大值。 示例: 输入: nums = [1,3,-1,-3,5,3,6,7], 和 k = 3输出: [3,3,5,5,6,7] 解释: 滑动窗口的位置 最大值 [1 3 -1] -3 5 3 6 7 3 1 [3 ...
分类:其他好文   时间:2021-02-18 13:06:38    阅读次数: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
完数与盈数
试除法求约数。 int check(int n) { int res=1; for(int i=2;i*i<=n;i++) if(n % i == 0) { res+=i; if(i != n/i) res+=n/i; } return res; } int main() { vector<int> ...
分类:其他好文   时间:2021-02-17 14:12:57    阅读次数:0
Educational Codeforces Round 102 (Rated for Div. 2)E题(分层图、最短路)
https://codeforces.com/contest/1473/problem/E vector存图: 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0),cin.tie(0 ...
分类:其他好文   时间:2021-02-15 12:17:20    阅读次数:0
is_sorted
leetcode打卡 题面 class Solution { public: bool checkPossibility(vector<int> &nums) { int n = nums.size(); for (int i = 0; i < n - 1; ++i) { int x = nums[ ...
分类:其他好文   时间:2021-02-08 12:11:43    阅读次数:0
12363条   上一页 1 ... 13 14 15 16 17 ... 1237 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!