前文2.2节对奶牛采食行为进行动作分解后,再根据前文对各动作进行的定义,根据最终筛选获取的视频监控段,首先每段视频统计一组包含所有动作的奶牛采食行为各个动作发生时长,方便为后续数据集的制作提供依据。 润色一下
时间: 2023-03-20 22:03:26 浏览: 100
根据前文2.2节对奶牛采食行为进行的动作分解,并结合对各个动作的定义,我们对最终筛选获取的视频监控段进行了统计分析。针对每段视频,我们统计了一组包含所有动作的奶牛采食行为各个动作发生时长的数据,以便为后续数据集的制作提供可靠的依据。
相关问题
[Submit][Status][Web Board] Description FJ有n(1≤n≤2000)个美味的食物,他想卖掉它们来赚钱给奶牛。这些食物放在一些箱子里,它们有些有趣的特性: (1)这些食物被编号为1~n,每一天FJ可以从这排箱子的头部或者尾部取出食物去卖; (2)这些食物放得越久,年龄越大,价值越大,食物i有一个初始的价值V(i); (3)放了a天后,年龄为a,食物最终的价值为V(i)×a。 给定每一个食物的初始价值v(i),请求出FJ卖掉它们后可以获得的最大价值,第一天出售的食物的年龄为1,此后每增加一天食物的年龄就增加1。 Input 第1行:一个整数n; 第i+l行:每行为食物i的初始价值V(i)。 Output 1行:FJ最终可以获得的最大价值。 Sample Input 5 1 3 1 5 2 Sample Output 43 请使用C++scanf函数,给我代码
```c++
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 2005;
int n, a[MAXN], dp[MAXN][MAXN];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
scanf("%d", &a[i]);
dp[i][i] = a[i] * n;
}
for (int len = 2; len <= n; ++len) {
for (int l = 1; l + len - 1 <= n; ++l) {
int r = l + len - 1;
dp[l][r] = max(dp[l+1][r] + (n - len + 1) * a[l], dp[l][r-1] + (n - len + 1) * a[r]);
}
}
printf("%d\n", dp[1][n]);
return 0;
}
```
java 程序定义一个动物类(Animal)。属性(age、weight);方法(叫meow)、吃eat()、设置年龄setAge(),得到年龄getAge()等。然后再派生出两个子类狗(Dog)和奶牛(Cow),再根据各自特性添加成员变量和成员方法。设计测试用例进行测试。
下面是实现动物类及其子类的Java代码:
```java
// Animal.java
public class Animal {
private int age;
private double weight;
public void setAge(int age) {
this.age = age;
}
public int getAge() {
return age;
}
public void setWeight(double weight) {
this.weight = weight;
}
public double getWeight() {
return weight;
}
public void eat() {
System.out.println("Animal is eating.");
}
public void meow() {
System.out.println("Animal is meowing.");
}
}
// Dog.java
public class Dog extends Animal {
private String breed;
public void setBreed(String breed) {
this.breed = breed;
}
public String getBreed() {
return breed;
}
public void bark() {
System.out.println("Dog is barking.");
}
}
// Cow.java
public class Cow extends Animal {
private boolean isMilkProducing;
public void setIsMilkProducing(boolean isMilkProducing) {
this.isMilkProducing = isMilkProducing;
}
public boolean getIsMilkProducing() {
return isMilkProducing;
}
public void moo() {
System.out.println("Cow is mooing.");
}
}
```
下面是测试用例:
```java
// Test.java
public class Test {
public static void main(String[] args) {
Animal animal = new Animal();
animal.setAge(3);
animal.setWeight(10.5);
System.out.println("Animal age: " + animal.getAge());
System.out.println("Animal weight: " + animal.getWeight());
animal.eat();
animal.meow();
Dog dog = new Dog();
dog.setAge(2);
dog.setWeight(15.0);
dog.setBreed("Golden Retriever");
System.out.println("Dog age: " + dog.getAge());
System.out.println("Dog weight: " + dog.getWeight());
System.out.println("Dog breed: " + dog.getBreed());
dog.eat();
dog.meow();
dog.bark();
Cow cow = new Cow();
cow.setAge(5);
cow.setWeight(500.0);
cow.setIsMilkProducing(true);
System.out.println("Cow age: " + cow.getAge());
System.out.println("Cow weight: " + cow.getWeight());
System.out.println("Cow is milk producing: " + cow.getIsMilkProducing());
cow.eat();
cow.meow();
cow.moo();
}
}
```
运行结果如下:
```
Animal age: 3
Animal weight: 10.5
Animal is eating.
Animal is meowing.
Dog age: 2
Dog weight: 15.0
Dog breed: Golden Retriever
Animal is eating.
Animal is meowing.
Dog is barking.
Cow age: 5
Cow weight: 500.0
Cow is milk producing: true
Animal is eating.
Animal is meowing.
Cow is mooing.
```
阅读全文