Submission #935372
Source Code Expand
import java.util.Arrays; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().run(); } void run() { int n = ni(); System.out.println(n % 2 == 0 ? n - 1 : n + 1); } int ni() { return Integer.parseInt(sc.next()); } void debug(Object... os) { System.err.println(Arrays.deepToString(os)); } /* class BIT<T> { int n; ArrayList<T> bit; BiFunction<T, T, T> bif; BIT(int n, BiFunction<T, T, T> bif, T defaultValue) { this.n = n; bit = new ArrayList<>(n + 1); for (int i = 0; i < n + 1; ++i) { bit.add(defaultValue); } this.bif = bif; } void update(int i, T v) { for (int x = i; x <= n; x += x & -x) { bit.set(x, bif.apply(bit.get(x), v)); } } T reduce(int i, T defaultValue) { T ret = defaultValue; for (int x = i; x > 0; x -= x & -x) { ret = bif.apply(ret, bit.get(x)); } return ret; } } */ }
Submission Info
Submission Time | |
---|---|
Task | B - ペア |
User | arukuka |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 1099 Byte |
Status | AC |
Exec Time | 282 ms |
Memory | 24152 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s0.txt, s1.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, s0.txt, s1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 269 ms | 24048 KB |
001.txt | AC | 264 ms | 24036 KB |
002.txt | AC | 272 ms | 24072 KB |
003.txt | AC | 273 ms | 24048 KB |
004.txt | AC | 273 ms | 24072 KB |
005.txt | AC | 274 ms | 24076 KB |
006.txt | AC | 272 ms | 24152 KB |
007.txt | AC | 270 ms | 24108 KB |
008.txt | AC | 270 ms | 24068 KB |
009.txt | AC | 270 ms | 24056 KB |
010.txt | AC | 268 ms | 24068 KB |
011.txt | AC | 265 ms | 24124 KB |
012.txt | AC | 282 ms | 23976 KB |
013.txt | AC | 266 ms | 24048 KB |
014.txt | AC | 273 ms | 24064 KB |
015.txt | AC | 269 ms | 24064 KB |
016.txt | AC | 270 ms | 24148 KB |
017.txt | AC | 265 ms | 24028 KB |
018.txt | AC | 267 ms | 24040 KB |
019.txt | AC | 282 ms | 24064 KB |
s0.txt | AC | 267 ms | 24076 KB |
s1.txt | AC | 268 ms | 24044 KB |