Codeforces Round #645 (Div. 2)题目+详解+代码(A、B、C、D)

Codeforces Round #645 (Div. 2) 重点:D:The Best Vacation 题目链接:点这里 D. The Best Vacation 题意:一年有n个月,每个月有di天,给你len天假期,如果在每个月的第j天拜访他人就会获得j个拥抱,让你最大化拥抱。 解题思路:主流思路叫做双指针,但是不是双指针的那种典型的写法,首先做这道题之前需要证明一下,假期选择天数的结尾一定是每个月的结尾天数 ... 阅读详情

A. Park Lighting

来源:http://codeforces.com/contest/1358/problem/A

Due to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of the city Semyon wants to light up Gluharniki park so that people could see each other even at night to keep the social distance.

The park is a rectangular table with n rows and m columns, where the cells of the table are squares, and the boundaries between the cells are streets. External borders are also streets. Every street has length 1. For example, park with n=m=2 has 12 streets.

You were assigned to develop a plan for lighting the park. You can put lanterns in the middle of the streets. The lamp lights two squares near it (or only one square if it stands on the border of the park).
在这里插入图片描述

The park sizes are: n=4, m=5. The lighted squares are marked yellow. Please note that all streets have length 1. Lanterns are placed in the middle of the streets. In the picture not all the squares are lit.
Semyon wants to spend the least possible amount of money on lighting but also wants people throughout the park to keep a social distance. So he asks you to find the minimum number of lanterns that are required to light all the squares.

Input
The first line contains a single integer t (1≤t≤104) — the number of test cases in the input. Then t test cases follow.

Each test case is a line containing two integers n, m (1≤n,m≤104) — park sizes.

Output
Print t answers to the test cases. Each answer must be a single integer — the minimum number of lanterns that are required to light all the squares.

Example
inputCopy
5
1 1
1 3
2 2
3 3
5 3
outputCopy
1
2
2
5
8
Note
Possible optimal arrangement of the lanterns for the 2-nd test case of input data example:
在这里插入图片描述
Possible optimal arrangement of the lanterns for the 3-rd test case of input data example:
在这里插入图片描述

题意:
给你一个 n*m 的表格,单元格的边界是街道,长度都为1;现在街道中央放路灯·,其能照亮街道两旁的两个方块。问最少需要多少个灯才能照亮整个公园

思路:
比较好想,算出所有表格的数量,既然是一盏灯两个方块,那就除以2,如果余1,那就ans再加上1,具体看代码吧

代码实现:

#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n, m;
		cin >> n >> m;
		int ans = n * m / 2;
		if ((n * m) % 2 != 0)ans += 1;
		cout << ans << endl;
	}
	return 0;
}

B. Maria Breaks the Self-isolation

来源:http://codeforces.com/contest/1358/problem/B

Maria is the most active old lady in her house. She was tired of sitting at home. She decided to organize a ceremony against the coronavirus.

She has n friends who are also grannies (Maria is not included in this number). The i-th granny is ready to attend the ceremony, provided that at the time of her appearance in the courtyard there will be at least ai other grannies there. Note that grannies can come into the courtyard at the same time. Formally, the granny i agrees to come if the number of other grannies who came earlier or at the same time with her is greater than or equal to ai.

Grannies gather in the courtyard like that.

Initially, only Maria is in the courtyard (that is, the initial number of grannies in the courtyard is 1). All the remaining n grannies are still sitting at home.
On each step Maria selects a subset of grannies, none of whom have yet to enter the courtyard. She promises each of them that at the time of her appearance there will be at least ai other grannies (including Maria) in the courtyard. Maria can call several grannies at once. In this case, the selected grannies will go out into the courtyard at the same moment of time.
She cannot deceive grannies, that is, the situation when the i-th granny in the moment of appearing in the courtyard, finds that now there are strictly less than ai other grannies (except herself, but including Maria), is prohibited. Please note that if several grannies appeared in the yard at the same time, then each of them sees others at the time of appearance.
Your task is to find what maximum number of grannies (including herself) Maria can collect in the courtyard for the ceremony. After all, the more people in one place during quarantine, the more effective the ceremony!

Consider an example: if n=6 and a=[1,5,4,5,1,9], then:

at the first step Maria can call grannies with numbers 1 and 5, each of them will see two grannies at the moment of going out into the yard (note that a1=1≤2 and a5=1≤2);
at the second step, Maria can call grannies with numbers 2, 3 and 4, each of them will see five grannies at the moment of going out into the yard (note that a2=5≤5, a3=4≤5 and a4=5≤5);
the 6-th granny cannot be called into the yard — therefore, the answer is 6 (Maria herself and another 5 grannies).
Input
The first line contains a single integer t (1≤t≤104) — the number of test cases in the input. Then test cases follow.

The first line of a test case contains a single integer n (1≤n≤105) — the number of grannies (Maria is not included in this number).

The second line contains n integers a1,a2,…,an (1≤ai≤2⋅105).

It is guaranteed that the sum of the values n over all test cases of the input does not exceed 105.

Output
For each test case, print a single integer k (1≤k≤n+1) — the maximum possible number of grannies in the courtyard.

Example
inputCopy
4
5
1 1 2 2 1
6
2 3 4 5 6 7
6
1 5 4 5 1 9
5
1 2 3 5 6
outputCopy
6
1
6
4
Note
In the first test case in the example, on the first step Maria can call all the grannies. Then each of them will see five grannies when they come out. Therefore, Maria and five other grannies will be in the yard.

In the second test case in the example, no one can be in the yard, so Maria will remain there alone.

The third test case in the example is described in the details above.

In the fourth test case in the example, on the first step Maria can call grannies with numbers 1, 2 and 3. If on the second step Maria calls 4 or 5 (one of them), then when a granny appears in the yard, she will see only four grannies (but it is forbidden). It means that Maria can’t call the 4-th granny or the 5-th granny separately (one of them). If she calls both: 4 and 5, then when they appear, they will see 4+1=5 grannies. Despite the fact that it is enough for the 4-th granny, the 5-th granny is not satisfied. So, Maria cannot call both the 4-th granny and the 5-th granny at the same time. That is, Maria and three grannies from the first step will be in the yard in total.

题意:
Maria有n个朋友,每个朋友都有一个a[i]作为区分, 她想叫他们到家里玩,现有一个规则:
如果比我早来或和我同时来的其他朋友的数量大于或等于ai,我就同意来。
请注意,盆友们可以在同一时间进入院子,而且Maria一直在院子里等待着
问院子里最多能有多少人

思路:
肯定是优先让a[i]小的朋友先来家里,所以需要升序排列一下,然后我们发现只要 i 是大于 a[i] 的,那么前i个人都可以到家里去,找到满足上述情况的最大的i,然后加上Maria就得出答案了

代码:

#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int main()
{
	int t;
	cin >> t;
	int n;
	while (t--)
	{
		int ans = 0;
		cin >> n;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + 1 + n);
		for (int i = 1; i <= n; i++)
		{
			if (i>=a[i])ans = i;//标记
		}
		cout << ans+1 << endl;
	}
	return 0;
}

C. Celex Update

来源:http://codeforces.com/contest/1358/problem/C

During the quarantine, Sicromoft has more free time to create the new functions in “Celex-2021”. The developers made a new function GAZ-GIZ, which infinitely fills an infinite table to the right and down from the upper left corner as follows:
在这里插入图片描述

The cell with coordinates (x,y) is at the intersection of x-th row and y-th column. Upper left cell (1,1) contains an integer 1.
The developers of the SUM function don’t sleep either. Because of the boredom, they teamed up with the developers of the RAND function, so they added the ability to calculate the sum on an arbitrary path from one cell to another, moving down or right. Formally, from the cell (x,y) in one step you can move to the cell (x+1,y) or (x,y+1).

After another Dinwows update, Levian started to study “Celex-2021” (because he wants to be an accountant!). After filling in the table with the GAZ-GIZ function, he asked you to calculate the quantity of possible different amounts on the path from a given cell (x1,y1) to another given cell (x2,y2), if you can only move one cell down or right.

Formally, consider all the paths from the cell (x1,y1) to cell (x2,y2) such that each next cell in the path is located either to the down or to the right of the previous one. Calculate the number of different sums of elements for all such paths.

Input
The first line contains one integer t (1≤t≤57179) — the number of test cases.

Each of the following t lines contains four natural numbers x1, y1, x2, y2 (1≤x1≤x2≤109, 1≤y1≤y2≤109) — coordinates of the start and the end cells.

Output
For each test case, in a separate line, print the number of possible different sums on the way from the start cell to the end cell.

Example
inputCopy
4
1 1 2 2
1 2 2 4
179 1 179 100000
5 7 5 7
outputCopy
2
3
1
1
Note
In the first test case there are two possible sums: 1+2+5=8 and 1+3+5=9.
在这里插入图片描述

题意:
给你两个坐标,问你从(x1,y1)到(x2,y2)一共有多少条路径。
注意是在以(x1,y1)为左上角(x2,y2)为右下角构成的矩形中,而且每一步都只能向下或者向右

思路:
一开始还以为是dp的题目,后来好好想了一下应该是找规律的题目,然后就开始分析样例找规律,最后找到一个正确的,详见代码
规律:

  • 若是矩形只有一行或者一列,只有一种路径
  • 有多行或者多列时,路径的个数=矩形的方格数-最下边一行方格数-最右边一行方格数-起始方格,即n * m - (y2 - y1 + x2-x1 + 2)

代码:

#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e9;
typedef long long ll;
int main()
{
	int t;
	cin >> t;
	ll x1, y1, x2, y2;
	while (t--)
	{
		cin >> x1 >> y1 >> x2 >> y2;
		if (x1 == x2 || y1 == y2)
		{
			cout << '1' << endl;
			continue;
		}
		ll n = x2 - x1 + 1, m = y2 - y1 + 1;
		ll k = n * m - (y2 - y1 + x2-x1 + 2);
		ll ans = k + 2;
		cout << ans << endl;
	}
	return 0;
}

D. The Best Vacation

来源:http://codeforces.com/contest/1358/problem/D

You’ve been in love with Coronavirus-chan for a long time, but you didn’t know where she lived until now. And just now you found out that she lives in a faraway place called Naha.

You immediately decided to take a vacation and visit Coronavirus-chan. Your vacation lasts exactly x days and that’s the exact number of days you will spend visiting your friend. You will spend exactly x consecutive (successive) days visiting Coronavirus-chan.

They use a very unusual calendar in Naha: there are n months in a year, i-th month lasts exactly di days. Days in the i-th month are numbered from 1 to di. There are no leap years in Naha.

The mood of Coronavirus-chan (and, accordingly, her desire to hug you) depends on the number of the day in a month. In particular, you get j hugs if you visit Coronavirus-chan on the j-th day of the month.

You know about this feature of your friend and want to plan your trip to get as many hugs as possible (and then maybe you can win the heart of Coronavirus-chan).

Please note that your trip should not necessarily begin and end in the same year.

Input
The first line of input contains two integers n and x (1≤n≤2⋅105) — the number of months in the year and the number of days you can spend with your friend.

The second line contains n integers d1,d2,…,dn, di is the number of days in the i-th month (1≤di≤106).

It is guaranteed that 1≤x≤d1+d2+…+dn.

Output
Print one integer — the maximum number of hugs that you can get from Coronavirus-chan during the best vacation in your life.

Examples
inputCopy
3 2
1 3 1
outputCopy
5
inputCopy
3 6
3 3 3
outputCopy
12
inputCopy
5 6
4 2 3 1 3
outputCopy
15
Note
In the first test case, the numbers of the days in a year are (indices of days in a corresponding month) {1,1,2,3,1}. Coronavirus-chan will hug you the most if you come on the third day of the year: 2+3=5 hugs.

In the second test case, the numbers of the days are {1,2,3,1,2,3,1,2,3}. You will get the most hugs if you arrive on the third day of the year: 3+1+2+3+1+2=12 hugs.

In the third test case, the numbers of the days are {1,2,3,4,1,2,1,2,3,1,1,2,3}. You will get the most hugs if you come on the twelfth day of the year: your friend will hug you 2+3+1+2+3+4=15 times.
题意:
你有连续x天的假期,想要去找你的小女朋友玩耍,但是她那里的时间计算方式不同,一年有n个月,每个月的长度为a[i]天,且你每个月的第几天去找她你就会获得几个拥抱,问你要尽可能的获得更多的拥抱,需要哪几天去(可以跨年,但是必须连续),最多能获得多少拥抱

思路:
有点像dp中的最大子段和问题,但是其实不一样,用vector解决比较容易,详见代码

代码:

#include <iostream>
#include <vector>
#define ll long long
using namespace std;
int main()
{
    ll n, x;
    cin >> n >> x;
    vector<ll>v(2 * n);
    for (ll i = 0; i < n; i++)
    {
        cin >> v[i]; 
        v[i + n] = v[i];
    }
    ll ans = 0;
    ll d = 0, cnt = 0;
    ll in = 0;
    for (ll i = 0; i < 2 * n; i++)
    {
        d += v[i];
        cnt += ((v[i] + 1) * v[i]) / 2;
        if (d < x)continue;
        while (d - x >= v[in]) 
        {
            d -= v[in];
            cnt -= (v[in] * (v[in] + 1)) / 2;
            in++;
        }
        ll k = d - x;
        ll val = cnt - ((k + 1) * k / 2);
        if (val > ans)ans = val;
    }
    cout << ans << endl;
    return 0;
}
DEA-Malmquist指数模型实战:从理论到应用的全流程解析 本文全面解析了DEA-Malmquist指数模型从理论到应用的全流程。文章详细阐述了该模型如何动态衡量效率随时间的变化,并将其分解为技术效率变化与技术进步,从而精准定位效率变动的根源。通过实战步骤演示了数据准备、软件操作(如DEAP 2.1)及结果解读,并结合水资源环境效率等案例,展示了其在包含非期望产出时的应用价值,为研究者进行动态效率分析提供了清晰指南。 阅读详情

相关推荐

双参数威布尔分布(Weibull分布)参数计算(根据故障数据,求双参数威布尔分布的参数详细步骤)

根据故障数据求威布尔分布参数步骤 根据众多文献研究,设备故障数据大多服从指数分布、威布尔分布或对数正态分布。其中威布尔分布较为常用,本文主要介绍威布尔分布的简单应用,并根据某设备故障数据为例简单介绍威布尔分布参数的计算方法。 参考文献11参考文献22 1.双参数威布尔分布的概率密度函数、概率分布函数、可靠度函数: 2.预处理故障数据 将故障数据按时间排序,假设设备分别在以下时间点失效:11.1 、23.5、58.4……则将此时间从小到大排序。并计算中位秩。中位秩的计算公式如下: 其中i表示第几个数据,n

biaochengxiaobai的博客 4万+

(二分查找+前缀和)Codeforces Round #645 (Div. 2) D - The Best Vacation

这题知道是末端一定是在月末这题就没啥了,可惜这题做的时候迷迷糊糊的,这都没想到,然后就s[i]表示前缀和(要扩大一倍),查一下s[i]-x在哪个地方就可以了, You've been in love with Coronavirus-chan for a long time, but you didn't know where she lived until now. And just now you found out that she lives in a faraway place cal..

天涯沧海的博客 261

保姆级教程:手把手教你用RKISP TURN为RV1106生成和配置IQfile(附AIQ版本匹配避坑指南)

本文提供RV1106 ISP调试的完整指南,详细讲解如何使用RKISP TURN工具生成和配置IQfile,包括环境搭建、参数调试、设备树配置及常见问题解决方案。特别强调AIQ版本匹配的重要性,帮助开发者避免常见陷阱,提升图像信号处理效率。

weixin_42520796的博客 507

C. Celex Update (思维)

题意 给你一个这样的图形,只能向右向下走,问你从(x1,y1)走到(x2,y2),对经过的数字进行求和,问你求得的和有多少种。 思路 我们可以找一组数两组数进行枚举找一下规律。 假如我们从(1,1)到(3,3),我们可以求出每种情况的和。 1+2+4+8+13=28 1+2+5+8+13=29 1+2+5+9+13=30 1+3+5+9+13=31 1+3+6+9+13=32 我们可以从这些数中看出规律,情况数就是路径的最大值减去路径的最小值+1。 然后我们再解决如何求最大值减去最小值的差,如果直接算肯

qq_45719639的博客 544

Dell Precision 7920 Tower开机点不亮?别慌,看电源灯闪烁密码快速定位故障(附BIOS恢复指南)

本文详细解析了Dell Precision 7920 Tower工作站开机点不亮时的电源灯闪烁密码,帮助用户快速定位故障。从内存问题到BIOS恢复,再到CPU配置错误,提供了全面的诊断和修复指南,并附有实用的维护建议和工具推荐。

weixin_30892037的博客 491

如何在高版本的ubuntu系统里安装gcc4.1.2

1、下载安装包,一共五个http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.1/,根据计算机系统位数   进行下载,64位下载amd64结尾的。开头分别是cpp-4.1_4.1.2、g++-4.1_4.1.2、gcc-4.1-base_4.1.2、gcc-     4.1_4.1.2、libstdc++6-4.1 2、使用sudo d

lsr_fighting的博客 1939

The Best Vacation CodeForces - 1358D(贪心+尺取)

You’ve been in love with Coronavirus-chan for a long time, but you didn’t know where she lived until now. And just now you found out that she lives in a faraway place called Naha. You immediately decided to take a vacation and visit Coronavirus-chan. Your

starlet_kiss的博客 641

LLC 谐振变换器开发设计1

本文档详细介绍了基于DSP28335的LLC谐振变换器开发设计。系统采用频率调制(FM)控制方式,实现高效率、高功率密度的隔离型DC/DC变换。文档阐述了LLC拓扑结构和工作原理,给出了谐振频率、品质因数等关键参数的计算公式。硬件设计包括功率器件选型和采样电路实现,软件部分提供了DSP28335的核心控制算法和代码示例,涵盖频率转换、PI控制和PWM生成。系统还设计了启动策略和保护机制,确保可靠运行。该设计实现了主开关零电压开通和低纹波输出特性。

344

CODEFORCES ROUND #645 (DIV. 2)

http://www.yyycode.cn/index.php/2020/05/30/codeforces-round-645-div-2/ A. Park Lightingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output Due to the coronavirus pandemic, city authorities obligated .

代码笔记本 607

华为OD机试 - 末世分配资源包 - 二分查找 + 贪心(Python/JS/C/C++ 新系统 100分)

本专栏收录于《华为OD机试真题(Python/JS/C/C++)》。刷的越多,抽中的概率越大,私信哪吒,备注华为OD,加入华为OD刷题交流群,每一题都有详细的答题思路、详细的代码注释、3个测试用例、为什么这道题采用XX算法、XX算法的适用场景,发现新题目,随时更新。末世时代,政府为各地方配资源,现有资源分配表 nums[n],要求按如下规则分配给 k 个营地:在最优平均分配情况下,得到最大团队所获得的资源数4,3,6,9,7 216最佳划分之一:[4,3,6] -> 13 [9,7] -> 16最大

学Java,找哪吒 232

华为OD机试真题 新系统2026-04-01 C++ 实现【勇攀数字高峰】

请你在给定的数字地形图中寻找登山路径,数字代表当前位置的海拔高度,要求从最低海拔出发,不断攀登,最终到达最高山峰。你需要寻找所有满足条件的登山路径。地图已经保证最低海拔和最高山峰都只有一个。

MISAYAONE的博客 390

Codeforces Round #645 (Div. 2)

A. Park Lighting time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Due to the coronavirus pandemic, city authorities obligated citizens to keep a social distance. The mayor of the city Semyon wants to

苦鬼·。 312

UE4 Unlua源码解析8 - Lua与C++之间的参数转换的实现原理

Lua与C++之间的参数转换的实现原理

TurboQ珞珈 902

Codeforces Round #645 (Div. 2)解题报告

Codeforces Round #645 (Div. 2) A.Park Lighting 题目大意 给你一个由n * m个方块组成的小区,每两个方块相交的边视为街道,一个街道上的灯可以照亮与其相邻的方块,问你最少点亮多少个街道的灯可以使所有方块全部亮起 解题思路 一开始想的是n和m根据奇偶分为4种情况,可以A,但是更好的思路是有n * m个方块需要点亮,一盏灯最多可以点亮两个方块,那么答案就是[(n * m) / 2] = (n * m + 1) / 2([]表示向上取整) AC代码 #include

weixin_44211980的博客 336

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Codeforces Round #645 (Div. 2) May/26/2020 22:35UTC+8

Codeforces Round #645 Div. 2C. Celex UpdateD. The Best VacationE. Are You Fired? 比赛链接 https://codeforces.com/contest/1358 比赛记录 https://blog.csdn.net/cheng__yu_/article/details/105395197 C. Celex Update #include <bits/stdc++.h> #define ll long long u

cheng__yu_的博客 274

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Codeforces Round #645(Div.2)

Codeforces Round #645 Div.2A. Park Lighting(签到)B. Maria Breaks the Self-isolation(~~阅读理解~~)C. Celex Update(找规律)D. The Best Vacation(二分)E(待补)F(待补) A. Park Lighting(签到) 题意:每盏路灯可以照亮两个格子,求照亮全部格子最少需要多少盏路灯。 题记:将所有格子的数量除以二向上取整即可。 #include<bits/stdc++.h> us

moyangxian 199

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

Codeforces Round #645 (Div. 2)补题

好久没写题了…… 最近好像能做出2D了,不过上分还是困难。 比赛传送门 本场关键词 贪心、找规律、前缀和、二分 A.Park Lighting 题意 给你n×mn\times mn×m的网格,你可以在两个网格之间的边上放一个灯,这个灯将会照亮这两个网格。 求出照亮所有的n×mn\times mn×m个格子的最小需要的灯数。 思路 贪心,只要nnn和mmm中间有一个是偶数,那么答案就是总格子数除以二;如果都为奇数,那么先暂时去掉一行,将这部分如上计算,再对剩下这一行贪心考虑。 代码 #include<b

WA制造机的博客 371

Codeforces 1087 Div2(ABCDEF)

CF1087Div2

2402_89326161的博客 392

Codeforces Round #645 (Div. 2) / contest 1358

目录A Park LightingB Maria Breaks the Self-isolationC Celex UpdateD The Best VacationE Are You Fired?F A B C D E F √ √ √ √ ●○ ● ( √:做出; ●:尝试未做出; ○:已补题 ) 题目地址:https://codeforces.com/contest/1358 这次是疫情主题。 A Park Lighting 题意: 思路: 代码: #pragma GCC

dragonylee的博客 309

补题--3 Codeforces Round #645 (Div. 2)

补题–3 最近比的赛都没有及时的看,现在一起补充一下 。 首先呢是5.26号的Div.2https://codeforces.com/contest/1358 #include <iostream> #include <vector> #include <algorithm> using namespace std; void solve() { int n; cin >> n; vector<int> arr(n);

weixin_45789915的博客 215

[codeforces 1358C] Celex Update 找规律+猜公式

Codeforces Round #645 (Div. 2) 参与排名人数14819 [codeforces 1358C] Celex Update 动归dp+找规律 总目录详见https://blog.csdn.net/mrcrack/article/details/103564004 在线测评地址https://codeforces.com/contest/1358/problem/C ...

mrcrack的博客 749

【Codeforces Round #645 (Div. 2) C】Celex Update

题目链接 【题目翻译】 给你个蛇形的图...你每次可以到右边或者下边一个相邻的格子。 问你从起点到终点的路径上遇到的和有多少种可能。 【题解】 首先明确一件事情啊,绝对不是直接输出从起点到终点的不同走法个数哦。 比如这张图的情况: 显然这两种是不同的走法但是和是一样的。 我们会发现,如果我们从起点一直往右走,然后一直往下走,得到的和肯定是最小的,记为min。 如果从起点一...

AWCXV 241
上一篇: Codeforces Round #644 (Div. 3)题目+题解+代码(A、B、C、D、E、G)
下一篇: Educational Codeforces Round 88 (Rated for Div. 2)A. Berland Poker------题目+题解
xh_Dopamine
博客等级 码龄7年 78粉丝 160原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值