首页 > TAG信息列表 > 1091

1091. 二进制矩阵中的最短路径(标准BFS)

1091. 二进制矩阵中的最短路径 给你一个 n x n 的二进制矩阵 grid 中,返回矩阵中最短 畅通路径 的长度。如果不存在这样的路径,返回 -1 。 二进制矩阵中的 畅通路径 是一条从 左上角 单元格(即,(0, 0))到 右下角 单元格(即,(n - 1, n - 1))的路径,该路径同时满足下述要求: 路

ybt 1091:求阶乘的和

1091:求阶乘的和   时间限制: 1000 ms 内存限制: 65536 KB 提交数: 46469 通过数: 35279 【题目描述】 给定正整数n,求不大于n的正整数的阶乘的和(即求1!+2!+3!+...+n!),输出阶乘的和。   【输入】 输入有一行,包含一个正整数n(1 < n < 12)。   【输出】 输出有一行:阶乘的

1091 Acute Stroke

1091 Acute Stroke One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stro

1091 N-自守数 (15 分)

原题 https://pintia.cn/problem-sets/994805260223102976/problems/1071785664454127616 代码 #include <iostream> #include <algorithm> using namespace std; int main() { int M,N; cin>>M; for(int i=0;i<M;i++){ bool flag=true

国家开放大学2021春1091应用概率统计题目

教育 教育 试卷代号: 1091 2021年春季学期期末统一考试 应用概率统计 试题 2021年7月 判断题(回答对或错,每小题3分,共15分) 1.设。( ) 2.设随机变量和的方差存在且不为零,若成立,则和一定不相关。( ) 3.当随机事件同时发生时,事件必发生,则。( ) 4.设随机变量的方差,相关系数,贝0方差

1091. 二进制矩阵中的最短路径 bfs_c++

1091. 二进制矩阵中的最短路径 上代码 class Solution { public: int bfs(vector<vector<int>>& grid) { queue<pair<int,int>> q; int step=1; if(grid.size()==1) return 1; q.push(make_pair(0,0)); int d

1091: 整数幂(多实例测试)

时间限制: 1 Sec  内存限制: 128 MB 题目描述 求A^B的最后三位数表示的整数(1<=A,B<=1000) 输入 n个测试实例,每个实例给出两个正整数A,B 输出 输出A^B的最后三位(没有前导0) 样例输入 Copy 2 2 3 12 6 样例输出 Copy 8 984 #include<stdio.h> int main() { int A,B,i,ncas

pat-1091 N-自守数

pat-1091 N-自守数 第一次提交发现有3个测试点不过 最后发现是again没有设置重置; 然后提示格式错误 最后把输出的no加上\n就好了 (我实在没明白他说的结尾无换行是什么玩意,不加换行反到格式错误了) #pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #inc

1091 N-自守数 (15 point(s))

最开始没有将思路写清楚,把自己绕晕了。后面重新捋顺,一下就AC 了。 学下别人的方法,一个是用字符串截取 substr() 将 NK2 比 K 多出来的长度放入函数,以截取后半 K 长度的部分。 还有一种写法是通过求余,来得到跟 K 相同位数的数,跟 K 比较是否相同。 看参考代码评论有一种不需要循

PTA basic 1091 N-自守数 (15 分) c++语言实现(g++)

如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392的末尾两位正好是 92,所以 92 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入在第一行

MySQL 1091 can‘t drop check that column/key exists

大致报错内容 MySQL 1091 can’t drop check that columnkey exists 背景描述 在navicat中创建外键时报错(想为myorder表创建外键userId,关联user表的主键userId)   关于navicat创建外键具体步骤,参见此文:navicat 数据表添加外键 可能的原因(任意一个) 1.myorder表没有创建字段u

1091. Shortest Path in Binary Matrix

In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that: Adjacent cells C_i and C_{i+1} are connected 8-dir

1091 N-自守数 (15 分)

如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入在第

Educational Codeforces Round 100 (Rated for Div. 2)B. Find The Array(构造)

You are given an array [

1091 Acute Stroke

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core. Input Specific

PAT乙级 1091 N-自守数 (15分) ---(C语言 + 详细注释)

如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入在第

1091 N-自守数 (15 分)

1091 N-自守数 (15 分) 如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392 的末尾两位正好是 92,所以 92是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自

PAT(甲级)1091

解题思路:flood_fill,由二维变为三维的,解题思路不变,给出DFS和BFS代码进行比较。 注意点:使用DFS会导致最后两个测试点过不了(递归太深,爆栈) 此处应该使用BFS进行搜索 DFS版本(最后两个测试点无法通过): #include<bits/stdc++.h> #define lowbit(x) ((x)&(-(x))) #define ll lon

1091 Acute Stroke (30 分)DFS 内存超限, 未完待续

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core. Input Sp

PAT甲级——1091 Acute Stroke (广度优先搜索BFS)

本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/94207638 1091 Acute Stroke (30 分)   One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which th

1091. Shortest Path in Binary Matrix

@1091. Shortest Path in Binary Matrix方法1: bfs方法2: dfs, TLE In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, …, C_k such t

1091. Shortest Path in Binary Matrix

In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that: Adjacent cells C_i and C_{i+1} are connected 8-d

PAT乙级 1091 N-自守数

题目: 如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。 本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。 输入格式: 输入

PAT-B 1091 N-自守数

                                              PAT-B 1091 N-自守数                      https://pintia.cn/problem-sets/994805260223102976/problems/1071785664454127616     题目 如果某个数 K 的平方乘以 N 以后,结果的末尾几

1091: 大大的求和

题目描述 小明在做小红给他出的算术题加法题,但是小红为了治一治小明懒惰的毛病,给他出的数都很大,这下小明郁闷了,想请你帮忙。 输入 输入的第一行是一个正整数N,表示一共有N组测试数据。每组数据由1~100行正整数组成,每行正整数的长度不大于100位。当输入0时,表示此组数据输入完毕。 输