Submission #3788623


Source Code Expand

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n % 2 == 0) {
            System.out.println(n - 1);
            return;
        }
        System.out.println(n + 1);
    }
}

Submission Info

Submission Time
Task B - ペア
User wdkkou
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 310 Byte
Status AC
Exec Time 97 ms
Memory 22612 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 22
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 95 ms 20692 KB
001.txt AC 96 ms 21076 KB
002.txt AC 96 ms 20692 KB
003.txt AC 95 ms 20052 KB
004.txt AC 94 ms 18900 KB
005.txt AC 95 ms 19796 KB
006.txt AC 96 ms 19284 KB
007.txt AC 96 ms 19156 KB
008.txt AC 94 ms 21588 KB
009.txt AC 97 ms 18900 KB
010.txt AC 96 ms 18004 KB
011.txt AC 97 ms 19412 KB
012.txt AC 96 ms 21844 KB
013.txt AC 97 ms 22612 KB
014.txt AC 95 ms 18768 KB
015.txt AC 95 ms 22612 KB
016.txt AC 94 ms 19924 KB
017.txt AC 97 ms 20692 KB
018.txt AC 95 ms 21844 KB
019.txt AC 97 ms 17748 KB
s0.txt AC 96 ms 19668 KB
s1.txt AC 95 ms 20948 KB