ICode9

精准搜索请尝试: 精确搜索
  • 【Leetcode】1115. Print FooBar Alternately2022-01-02 11:02:14

    题目地址: https://leetcode.com/problems/print-foobar-alternately/ 要求设计多线程的程序,使得两个线程可以交替打印"foo"和"bar"两个单词,各 n n n次。 可以将打印的部分加锁,设置一个变量

  • 1115. 交替打印 FooBar(待完成)2021-12-21 23:03:27

    class FooBar { public void foo() {     for (int i = 0; i < n; i++) {       print("foo");   } } public void bar() {     for (int i = 0; i < n; i++) {       print("bar");     } } } 两个不同的线程将会共用一个 FooBar 实例: 线程 A 将会调用

  • 11152021-11-16 19:34:19

    定时器 var timer =  可选 setInterval(() => { 执行语句 }, 时间);  清楚定时器         clearInterval(timer);  var 的名字 // //  加上类 删除兄弟的类 // $(".points-list>li").eq(找到位置).addClass("类名").siblings().removeClass("类名");

  • 11152021-11-16 14:33:43

     样式 var $list = $(this).closest(".filter-list");    var height = $list.css("height");       if(height === "30px"){    $(this).addClass("active");   $list.css({"overflow":"auto","height"

  • 1115练习赛总结2021-11-15 22:03:49

    看来还是一如既往的菜呢。 T1简单题。 T2这种题没怎么见过,以后需要更多去发现题目性质,大胆爆搜+优化。 T3,要学会“对症下药”,对着数据想一些合适的算法,看到20,不是容斥就是状压。 今天这场比赛“二选一”的计数较多,是我的薄弱项目,只有多见一点,多想一点,才有提高的可能。

  • 1115 模拟赛总结2021-11-15 14:03:39

    赛时安排 8:00~8:15 读题目 8:15~8:30 T1想了一个思路,预处理出来每一个位置下一个和它相同的字母的位置,然后判断前后是否能分解,然后这样会出问题,然后想着反过来处理上一个相同的位置…然后思路有点卡,就先往下看。 8:30~9:10 看了看T2,先写了个

  • 1115. 交替打印FooBar2021-09-05 17:01:33

    1115. 交替打印FooBar 我们提供一个类: class FooBar { public void foo() { for (int i = 0; i < n; i++) { print("foo"); } } public void bar() { for (int i = 0; i < n; i++) { print("bar"); } } } 两个不同的线程将会共用一

  • 【运动学】基于matlab GUI地球自转模拟【含Matlab源码 1115期】2021-07-23 11:00:06

    一、简介 基于matlab GUI地球自转模拟 二、源代码 function varargout = globegui(varargin) % GLOBEGUI M-file for globegui.fig created with GUIDE % % Creates a GUI for viewing a spinning Earth globe % % GLOBEGUI, by itself, creates a new GLOBEGUI or rais

  • 【运动学】基于matlab GUI地球自转模拟【含Matlab源码 1115期】2021-07-08 20:51:42

    ## 一、简介 基于matlab GUI地球自转模拟 ## 二、源代码 ```c function varargout = globegui(varargin) % GLOBEGUI M-file for globegui.fig created with GUIDE % % Creates a GUI for viewing a spinning Earth globe % % GLOBEGUI, by itself, creates a new GLOBE

  • 题目 1115: DNA2021-04-04 22:34:46

    又是图形输出题。 找规律代码如下。 int main() { int T; cin>>T; while(T--) { int a,b; cin>>a>>b; for(int k=0;k<b;k++) { for(int i=0;i<a/2;i++) { for(int j=0;j<

  • 最长M字段和(1052 1115 1053)2020-12-02 20:02:13

    这三个版本最大的区别就是数据范围的区别:N<=5000时,用n^2的dp可以过;当n达到50000时,用nlogn的dp可以过。       51nod 1052: 设dp[i][j]表示前j个数分成i段的最大字段和,转移方程由:dp[i][j]=max(max(dp[i-1][k](k=1...j-1)),dp[i][j])+a[j]); 由于空间会超限,可采用滚动数组;用f[j]数

  • 1115 Counting Nodes in a BST(禁止输出容器map[不存在的数])2020-03-21 13:00:38

    题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805355987451904 大致题意就是给出一个序列,构造一棵二叉查找树,输出最大深度和次最大深度的结点个数之和。 方法一,BFS 1 #include<iostream> 2 #include<unordered_map> 3 #include<queue> 4 #include<alg

  • 1115 .另外打印FooBar2019-07-14 09:05:41

    Suppose you are given the following code: class FooBar {   public void foo() {     for (int i = 0; i < n; i++) {       print("foo");     }   }   public void bar() {     for (int i = 0; i < n; i++) {       print("bar");     }   }

  • HDU-1115计算几何2019-07-13 20:01:25

    HDU-1115 题目大意:给你n个点的坐标,这n个点可以围成一个多边形,求此多边形的重心 计算多边形重心的方法: 每个三角形重心:cx = x1 + x2 + x3;cy同理。每个三角形面积:s =  ( (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1) ) / 2;多边形重心:cx = (∑ cx[i]*s[i]) / (3*∑s[i]);  cy = (∑

  • 洛谷-1115 最大子段和2019-05-14 12:49:38

    题目描述 给出一段序列,选出其中连续且非空的一段使得这段和最大。 输入输出格式 输入格式: 第一行是一个正整数N,表示了序列的长度。 第二行包含N个绝对值不大于10000的整数Ai,描述了这段序列。 输出格式: 一个整数,为最大的子段和是多少。子段的最小长度为1。 输入输出样例 输

  • PAT 甲级 1115 Counting Nodes in a BST2019-02-17 14:37:29

    https://pintia.cn/problem-sets/994805342720868352/problems/994805355987451904   A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than or e

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

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

ICode9版权所有