점수기준은 100이 아닌, 최고점을 기준으로 보정되므로 다시 100 기준으로 점수를 봤을떄 올라가는 경향이 있다
max와 sum(plate) 를 한번에 계산하여 바로 투입
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// ISC
Scanner sc = new Scanner(System.in);
int V = sc.nextInt();
// D2F
int max = 0;
int plate = 0;
int[] TP = new int[V+1];
for (int i = 1; i <= V; i++) {
TP[i] = sc.nextInt();
if (max < TP[i])
max = TP[i];
plate += TP[i];
}
// OP
int result = (100 * plate) / (max*V);
// OEC
System.out.println(result);
}
}
'Hard deck > reindexing d2' 카테고리의 다른 글
004 : 2차원 배열의 구간 합 (0) | 2023.06.21 |
---|---|
003 : 1차원 배열의 구간 합 (0) | 2023.06.20 |
001 - string 입력을 개별합해서 출력하기 (0) | 2023.06.20 |
009 : sliding window (0) | 2023.06.19 |
008 : 좋은 수 구하기 (0) | 2023.06.19 |