题目大意:给一个多边形,每个顶点有一个值,每个边编号从1到N,边的属性是加或者乘。首先先拆掉一条边,剩下的如下做:选定一条边以及这条边的两个端点(两个数)用新顶点替换(新顶点即:按照这条边的属性(加或乘)算出这两个数的乘积或者和)。到最后剩一个点,也就是一个值。求这些值的最大值输出,并输出此时最先拆掉的是哪条边。 Input: 4 t -7 t 4 x 2 x 5 Outpu
文章目录 一、题目二、题解 一、题目 You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex (i.e., clock
Polygon Triangles Gym-101466F 题目链接 题意: 给出n行a, b, c, 判断是否每一行a, b, c都可以组成三角形。 做法: 三角形两边之和大于第三边。 #include <stdio.h>int // 判断a, b, c是否可以组成三角形f(int a, int b, int c) {if( (a + b > c) && (a + c > b
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, n is always even, and in C2, n is always odd. You are given a regular polygon wit
The statement of this problem is the same as the statement of problem C1. The only difference is that, in problem C1, n is always even, and in C2, n is always odd. You are given a regular polygon wit