Answer:
OPT[i] : segment that end in i with largest amount N
OPT[0] = 0
OPT[i] = max{OPT[i-1] + ai, 0}
for i from 1 to n
if (OPT[i] > max) {
max = OPT[i]
max_i = i
}
count = 0
for i from max_i to 1
count +=a[i]
if (count== max) {
start = i ;
break;
}
I need more context
Explanation:
you didn't the whole question
import java.util.Scanner;
public class InchesToFeetInteractive
{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
final int INCHES_IN_FOOT = 12;
int inches = scan.nextInt();
int feet;
int inchesLeft;
feet = inches / INCHES_IN_FOOT;
inchesLeft = inches % INCHES_IN_FOOT;
System.out.println(inches + " inches is " +
feet + " feet and " + inchesLeft + " inches");
}
}
We import the Scanner class and then initialize a new Scanner named scan. We then get an integer representation of inches from the user and calculate the feet and inches from the value entered by the user.
Answer:
Hello there! :) It could be considered a portrait but that is not exactly what a portrait is.
Explanation:
A portrait is mostly considered a painting or drawing of someone that that same person has drawn. For example, a portrait of the Mona Lisa would have been her drawing/painting herself. Now someone just looking at camera lens would'nt exactly be true, it would be false so the answer is B. False
Hope this helps!