結果

問題 No.99 ジャンピング駒
ユーザー shinwisteriashinwisteria
提出日時 2019-01-23 19:50:01
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 3,077 ms
コンパイル使用メモリ 72,124 KB
実行使用メモリ 56,484 KB
最終ジャッジ日時 2023-10-14 09:28:54
合計ジャッジ時間 4,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
56,364 KB
testcase_01 AC 127 ms
55,964 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No99 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt() , k = 0;
		s.nextLine();
		for(int i = 0;i < n;i++){
			if(Math.abs(k % 2) == 1){
				k++;
			}else{
				k--;
			}
		}
		s.close();

		System.out.println(Math.abs(k));

	}

}
0