結果

問題 No.1915 Addition
ユーザー shojin_proshojin_pro
提出日時 2022-04-29 22:04:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 3,618 ms
コンパイル使用メモリ 71,016 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-09-11 13:16:30
合計ジャッジ時間 5,319 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,852 KB
testcase_01 AC 145 ms
55,964 KB
testcase_02 AC 142 ms
56,096 KB
testcase_03 AC 144 ms
56,160 KB
testcase_04 AC 145 ms
55,944 KB
testcase_05 AC 146 ms
55,480 KB
testcase_06 AC 143 ms
55,848 KB
testcase_07 AC 146 ms
55,864 KB
testcase_08 AC 145 ms
56,040 KB
testcase_09 AC 141 ms
55,856 KB
testcase_10 AC 146 ms
56,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            int a = sc.nextInt();
            if(a % 2 == 0){
                System.out.println(a/2);
            }else{
                System.out.println(a*2);
            }
        }
    }
}
0