Contest Duration: - (local time) (100 minutes) Back to Home

Submission #6569659

Source Code Expand

Copy
```import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Function;
import java.util.stream.Collectors;

@SuppressWarnings("unused")
public class Main {
FastScanner in = new FastScanner(System.in);
PrintWriter out = new PrintWriter(System.out);
final int MOD = (int)1e9+7;
void printlnYN(boolean b){out.println((b ? "YES" : "NO"));}

//System.out.println();はつかわない！！
void solve() throws Exception{
int A = in.nextInt(), B = in.nextInt();
if((A + B) % 2 == 0){
out.println((A + B) / 2);
}else{
out.println("IMPOSSIBLE");
}
}

public static void main(String[] args) throws Exception {
new Main().m();
}

void m() throws Exception {
solve();
out.flush();
}

class FastScanner {

FastScanner() {this(System.in);}

int nextInt() {return (int) nextLong();}

long nextLong() {
try {
int sign = 1;
while ((b < '0' || '9' < b) && b != '-' && b != '+') {
}
if (b == '-') {
sign = -1;
} else if (b == '+') {
}
long ret = b - '0';
while (true) {
if (b < '0' || '9' < b) return ret * sign;
ret *= 10;
ret += b - '0';
}
} catch (IOException e) {
e.printStackTrace();
return -1;
}
}

double nextDouble() {
try {
double sign = 1;
while ((b < '0' || '9' < b) && b != '-' && b != '+') {
}
if (b == '-') {
sign = -1;
} else if (b == '+') {
}
double ret = b - '0';
while (true) {
if (b < '0' || '9' < b) break;
ret *= 10;
ret += b - '0';
}
if (b != '.') return sign * ret;
double div = 1;
while ('0' <= b && b <= '9') {
ret *= 10;
ret += b - '0';
div *= 10;
}
return sign * ret / div;
} catch (IOException e) {
e.printStackTrace();
return Double.NaN;
}
}

char nextChar() {
try {
while (Character.isWhitespace(b)) {
}
return (char) b;
} catch (IOException e) {
e.printStackTrace();
return 0;
}
}

String nextStr() {
try {
StringBuilder sb = new StringBuilder();
while (Character.isWhitespace(b)) {
}
while (b != -1 && !Character.isWhitespace(b)) {
sb.append((char) b);
}
return sb.toString();
} catch (IOException e) {
e.printStackTrace();
return "";
}
}

public int[] nextIntArray(int n) {
int[] res = new int[n];
for (int i = 0; i < n; i++) {
res[i] = nextInt();
}
return res;
}

public int[] nextIntArrayDec(int n) {
int[] res = new int[n];
for (int i = 0; i < n; i++) {
res[i] = nextInt() - 1;
}
return res;
}

public int[] nextIntArray1Index(int n) {
int[] res = new int[n + 1];
for (int i = 0; i < n; i++) {
res[i + 1] = nextInt();
}
return res;
}

public long[] nextLongArray(int n) {
long[] res = new long[n];
for (int i = 0; i < n; i++) {
res[i] = nextLong();
}
return res;
}

public long[] nextLongArrayDec(int n) {
long[] res = new long[n];
for (int i = 0; i < n; i++) {
res[i] = nextLong() - 1;
}
return res;
}

public long[] nextLongArray1Index(int n) {
long[] res = new long[n + 1];
for (int i = 0; i < n; i++) {
res[i + 1] = nextLong();
}
return res;
}

public double[] nextDoubleArray(int n) {
double[] res = new double[n];
for (int i = 0; i < n; i++) {
res[i] = nextDouble();
}
return res;
}
}
}
/* end Main */```

#### Submission Info

Submission Time 2019-07-27 21:19:23+0900 A - Harmony Oland Java8 (OpenJDK 1.8.0) 100 4159 Byte AC 70 ms 21076 KB

#### Judge Result

Set Name All Sample
Score / Max Score 100 / 100 0 / 0
Status
 AC × 11
 AC × 3
Set Name Test Cases
All sample_01, sample_02, sample_03, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
sample_01 AC 69 ms 20180 KB
sample_02 AC 68 ms 20948 KB
sample_03 AC 69 ms 18260 KB
testcase_01 AC 68 ms 18132 KB
testcase_02 AC 68 ms 20948 KB
testcase_03 AC 70 ms 18772 KB
testcase_04 AC 69 ms 21076 KB
testcase_05 AC 68 ms 19156 KB
testcase_06 AC 68 ms 18260 KB
testcase_07 AC 68 ms 19284 KB
testcase_08 AC 69 ms 18260 KB