ICode9

精准搜索请尝试: 精确搜索
  • PAT Advanced 1021 Deepest Root(25)2022-08-20 22:31:11

    题目描述: A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root is called the deepest root. Input Specification:

  • 1021 ObstacleCourse障碍训练课 优先队列+bfs+转弯2022-08-19 13:31:44

    链接:https://ac.nowcoder.com/acm/contest/26077/1021来源:牛客网 题目描述 考虑一个 N x N (1 <= N <= 100)的有1个个方格组成的正方形牧场。有些方格是奶牛们不能踏上的,它们被标记为了’x’。例如下图: . . B x . . x x A . . . . x . . x . . . .

  • 1021 郊区春游 TSP+floyd2022-08-03 18:36:29

    链接:https://ac.nowcoder.com/acm/contest/25022/1021来源:牛客网 题目描述 今天春天铁子的班上组织了一场春游,在铁子的城市里有n个郊区和m条无向道路,第i条道路连接郊区Ai和Bi,路费是Ci。经过铁子和顺溜的提议,他们决定去其中的R个郊区玩耍(不考虑玩耍的顺序),

  • 1021 Ocean Currents bfs+优先队列2022-07-02 17:34:50

    For a boat on a large body of water, strong currents can be dangerous, but with careful planning, theycan be harnessed to help the boat reach its destination. Your job is to help in that planning.At each location, the current flows in some direction. The

  • 1021删除最外层括号2022-05-28 20:05:02

    题意:取所有有效括号串集合 后删除最外层括号 题解:首先题目给我们的括号串一定符合题目要求的 所以我们只需要记录左括号的个数后当遇到右括号数-1即可 因为要删掉每一个有效括号最外层括号所以我们遇到每个有效集合括号串第一个右括号后删除一个左括号 这样即可符合题目要求 class

  • 信息学奥赛一本通1021-10302022-02-22 20:03:20

    1021` #include"iostream" #include"cstdio" using namespace std; int main() { int a; scanf("%d",&a); printf("%c",a); return 0; } 1022 #include"iostream" #include"cstdio" using namespace s

  • 1021. Deepest Root (25)(图的遍历,dfs,连通分量的个数)2022-02-10 23:03:43

    A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root is called the deepest root. Input Specification: Each i

  • PAT 乙级 1021 个位数统计2021-12-29 23:59:01

    第一次写博客,加油加油呐!! 给定一个 k 位整数 N=dk−1​10k−1+⋯+d1​101+d0​ (0≤di​≤9, i=0,⋯,k−1, dk−1​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。 输入格式: 每个输入包含 1 个测试用例,即一个不超过 1000 位的正

  • 1021. 货币系统2021-12-09 17:31:59

    题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 20; const int M = 3010; int n, m; LL v[N]; LL f[M]; int main() { cin >> n >> m; //base case f[0] = 1; for (int i = 1; i <= n; i

  • LeetCode刷题之1021. 删除最外层的括号2021-10-16 12:02:18

    LeetCode刷题之1021. 删除最外层的括号 我不知道将去向何方,但我已在路上! 时光匆匆,虽未曾谋面,却相遇于斯,实在是莫大的缘分,感谢您的到访 ! 题目: 有效括号字符串为空 ""、"(" + A + ")" 或 A + B ,其中 A 和 B 都是有效的括号字符串,+ 代表字符串的连接。 例如,"","()","(())()"

  • PAT甲级10212021-10-06 23:33:45

    简单地说一下今天写这道题的感受吧. \(①\) \(:\) 审题时主观地默认了样例中的 \(1\) 是根,导致样例没看懂. \(②\) \(:\) 求连通块个数的时候只想到并查集,其实用 \(dfs\) 标记更好. \(③\) \(:\) 出现了fa[x] = x 的情况,其实是fa[x] == x ,查错了好久. \(④\) \(:\) 认为第一遍

  • 1021 个位数统计2021-09-24 23:04:00

    给定一个 k 位整数 N=dk−1​10k−1+⋯+d1​101+d0​ (0≤di​≤9, i=0,⋯,k−1, dk−1​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。 输入格式: 每个输入包含 1 个测试用例,即一个不超过 1000 位的正整数 N。 输出格

  • 1021 货币系统(完全背包问题求方案数)2021-09-12 22:32:50

    1. 问题描述: 给你一个n种面值的货币系统,求组成面值为m的货币有多少种方案。 输入格式 第一行,包含两个整数n和m。接下来n行,每行包含一个整数,表示一种货币的面值。 输出格式 共一行,包含一个整数,表示方案数。 数据范围 n ≤ 15,m ≤ 3000 输入样例: 3 10 1 2 5 输出样例: 10 来源:https

  • 二刷PAT:advanced1018,1019,1020,10212021-07-25 23:30:22

    手热做了四道,还行 1018Public Bike Management 大概就是在一个自行车管理监控系统中,你会实时得到各个站点含有的自行车数,我们需要从PBMC出发到达给出的存在问题的站点使其变成完美状态(也需要使途径的站点变成完美状态,完美状态是指站点的自行车数等于Cmax/2) 去年做的时候

  • Java PAT (Basic Level) 1021 个位数统计 (15 分)2021-07-19 13:33:20

    问题描述: 给定一个 k 位整数 N=d​k−1​​10​k−1​​+⋯+d​1​​10​1​​+d​0​​ (0≤d​i​​≤9, i=0,⋯,k−1, d​k−1​​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。 输入格式: 每个输入包含 1 个测试用

  • 【数字信号去噪】基于matlab中值滤波+奇异值分解(SVD)数字信号降噪【含Matlab源码 1021期】2021-06-18 21:33:41

    一、简介 基于SVD(奇异值分解)的去噪声技术属于子空间算法的一种。简单的来说我们希望将带噪信号向量空间分解为分别由纯净信号主导和噪声信号主导的两个子空间,然后通过简单地去除落在“噪声空间”中的带噪信号向量分量来估计纯净信号。要将带噪信号向量空间分解为“信号子空间”和

  • PAT甲级题解 10212021-03-01 11:59:13

    先判断有几个连通块吗,因为已经满足边的个数等于顶点个数减1所以一定是一棵树,只要是1. 本来用的是优先队列,最后发现没过,其实是Error: K components 少了个s看题目一定要仔细 #include<bits/stdc++.h> using namespace std; const int MAXN = 10100; vector<int> G[MAXN]; int

  • [LeetCode] 1021. Remove Outermost Parentheses 去除最外层括号2021-02-08 02:32:44

    A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation.  For example, "", "()", "(())()", and

  • 1021 个位数统计2021-02-07 15:31:55

    1021 个位数统计 分析代码 分析 【统计字符串中每个字符出现次数】的问题可以用指针遍历(n2)、可以用数组存储、etc我用的是数组,最大长度为1000时建一个≥1001的数组,要记得末尾的’\0’,不然测试点3会显示运行时错误。 代码 #include <stdio.h> #include <stdlib.h> int ma

  • SSL_1021&&P1037【产生数】2021-01-09 11:05:14

    产生数 题目 产生数 解析 利用乘法原理,得到将每一位能拓展到的个数相乘即可 这题有一些注意点: 1:用字符串输入n 2:开高精(int128好像也能卡过去,longlong应该不行) 3:没了Floyd记得a[i][i]=1 code: #include<iostream> #include<cstring> #include<cstdio> using namespace std;

  • 【SSL】1021 &【洛谷】1037产生数2021-01-09 10:34:19

    【SSL】1021 &【洛谷】1037产生数 Time Limit:1000MS Memory Limit:65536K Description 给出一个整数 n(n<10^30) 和 k 个变换规则(k<=15)。   规则:    一位数可变换成另一个一位数:    规则的右部不能为零。   例如:n=234。有规则(k=2):     2-> 5     3-> 6   上

  • 【leetcode_easy_stack】1021. Remove Outermost Parentheses2020-12-02 08:02:18

    problem 1021. Remove Outermost Parentheses solution#1: stack; code   solution#2:  code   参考 1. leetcode_easy_stack_1021. Remove Outermost Parentheses; 2. 【leetcode刷题】1021. Remove Outermost Parentheses; 完

  • [PAT乙级]1021 个位数统计 (思路+精简代码)2020-11-25 23:29:45

    1021 个位数统计 给定一个 k 位整数 N = d​k−110​k−1 +⋯+d​1​​101 +d​0​​ (0≤d​i​​ ≤9, i=0,⋯,k−1, d​k−1​​ >0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。 输入格式: 每个输入包含 1 个测试用例,即一

  • 1021 Deepest Root(甲级)2020-11-22 16:57:12

    1021 Deepest Root (25分) A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root is called the deepest root. I

  • 1021上午考试T22020-10-22 06:31:26

    1021上午考试T2 ​ 题目大意: ​ N个庄家。你可以到庄家那边下注,每次可以猜大猜小,猜一次一元钱。每一次开彩前,你都可以到任意个庄家那里下赌注。如果开彩结果是大,你就可以得到你之前猜大的庄家相应的ai元钱。如果开彩结果是小,你就可以得到你之前猜小的庄家相应的bi元钱。你可以在同

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

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

ICode9版权所有