# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
213518 | berryzed | 님 무기가 좀 나쁘시네여 (kriii3_S) | Java | 141 ms | 14184 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import java.util.Scanner;
/**
* https://oj.uz/problem/view/kriii3_S
* <p>
* https://oj.uz/submission/19070
* https://oj.uz/submission/15556
*/
class relay {
private final static int P1 = 0; // 크리
private final static int P2 = 1; // 파부
private final static int CURRENT = 0; // 자기 무기 장착 후 데이터
private final static int WEAPON = 1; // 무기 데이터
private final static int BODY = 2; // 맨몸 데이터
private final static int ANOTHER = 3; // 상대방 무기 장착 후 데이터
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long[][][] players = new long[2][4][5];
for (int i = 0; i < 2; i++) { // 장착여부
for (int j = 0; j < 2; j++) { // 사람
for (int k = 0; k < 5; k++) {
players[j][i][k] = scanner.nextInt();
}
}
}
// 맨 몸 데이터 입력
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 5; j++) {
players[i][BODY][j] = players[i][CURRENT][j] - players[i][WEAPON][j];
}
}
// 상대방 무기 장착 데이터 입력
for (int j = 0; j < 5; j++) {
players[P1][ANOTHER][j] = players[P1][BODY][j] + players[P2][WEAPON][j];
players[P2][ANOTHER][j] = players[P2][BODY][j] + players[P1][WEAPON][j];
}
float p1Current = getCombatPower(players[P1][CURRENT]);
float p1Another = getCombatPower(players[P1][ANOTHER]);
float p2Current = getCombatPower(players[P2][CURRENT]);
float p2Another = getCombatPower(players[P2][ANOTHER]);
char p1Changed = p1Current > p1Another ? '-' : p1Current < p1Another ? '+' : '0';
char p2Changed = p2Current > p2Another ? '-' : p2Current < p2Another ? '+' : '0';
System.out.println(p1Changed);
System.out.println(p2Changed);
}
private static float getCombatPower(long[] datas) {
long attack = datas[0];
long power = datas[1];
long criChance = datas[2];
long criDamRate = datas[3];
long atkSpeed = datas[4];
return attack * (100 + power) * (10000 - 100 * Math.min(100, criChance) + (long) Math.min(100, criChance) * criDamRate) * (100 + atkSpeed);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |