首页 > TAG信息列表 > 1139

1139: 输出最短字符串

题目描述 输入n和n个字符串,输出其中最短的字符串。若长度相同则输出出现较早的那一个。 输入 第一行是一个整数n,后面跟着n行,每行包括一个由字母和数字和空格组成的字符串,长度不超过1000。 输出 长度最短的字符串,若长度相同则输出出现较早的那一个。 样例输

[LeetCode] 1139. Largest 1-Bordered Square 最大的以1为边界的正方形

Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid. Example 1: Input: grid = [[1,1,1],[1,0,1],[1,1,1]] Output: 9 Example 2: I

信息学奥赛一本通(1139:整理药名)

1139:整理药名 时间限制: 1000 ms         内存限制: 65536 KB 提交数: 23347     通过数: 11538 【题目描述】 医生在书写药品名的时候经常不注意大小写,格式比较混乱。现要求你写一个程序将医生书写混乱的药品名整理成统一规范的格式,即药品名的第一个字符如果是字母

1139 First Contact (30分)

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly in the first place. Instead, he might ask another boy C,

LeetCode 1139. 最大的以 1 为边界的正方形(DP)

1. 题目 给你一个由若干 0 和 1 组成的二维网格 grid,请你找出边界全部由 1 组成的最大 正方形 子网格,并返回该子网格中的元素数量。如果不存在,则返回 0。 示例 1: 输入:grid = [[1,1,1],[1,0,1],[1,1,1]] 输出:9 示例 2: 输入:grid = [[1,1,0,0]] 输出:1 提示: 1 <= grid.length

PAT 甲级 1139 First Contact (30 分)

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly in the first place. Instead, he might ask another boy

codeforces-1139 (div2)

A.如果第i个数字是偶数,总贡献就加上i #include <map>#include <set>#include <ctime>#include <cmath>#include <queue>#include <stack>#include <vector>#include <string>#include <cstdio>#include <cstdlib>#include &l

1139 B. Chocolates bymrhao61 vectora可以直接传入long long int ,long long 很重要

这道题告诉我们long long 真的很重要 #include<iostream> #include<vector> using namespace std; int main() { long long int ans=0,max=0; long long int n;cin>>n; vector<int>a; for(long long int i=0;i<n;i++) { long long int x;cin>>x;