結果

問題 No.531 エヌスクミ島の平和協定
ユーザー uafr_csuafr_cs
提出日時 2017-06-23 22:36:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 3,034 ms
コンパイル使用メモリ 75,184 KB
実行使用メモリ 41,912 KB
最終ジャッジ日時 2024-04-15 14:16:16
合計ジャッジ時間 8,920 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
41,196 KB
testcase_01 AC 143 ms
41,368 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 139 ms
41,336 KB
testcase_05 WA -
testcase_06 AC 143 ms
41,680 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 141 ms
41,136 KB
testcase_10 AC 140 ms
41,268 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 141 ms
41,408 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 139 ms
41,644 KB
testcase_17 WA -
testcase_18 AC 139 ms
41,440 KB
testcase_19 WA -
testcase_20 AC 141 ms
41,244 KB
testcase_21 WA -
testcase_22 AC 138 ms
41,912 KB
testcase_23 WA -
testcase_24 AC 139 ms
41,416 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 138 ms
41,368 KB
testcase_28 WA -
testcase_29 AC 141 ms
41,176 KB
testcase_30 AC 136 ms
41,160 KB
testcase_31 AC 140 ms
41,452 KB
testcase_32 AC 143 ms
41,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 140 ms
41,268 KB
testcase_36 WA -
testcase_37 AC 139 ms
41,376 KB
testcase_38 AC 137 ms
41,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final long n = sc.nextLong();
		final long m = sc.nextLong();
		
		if(n == m){
			System.out.println(1);
		}else if(n % 2 == 1){
			System.out.println(-1);
		}else if(n / 2 < m){
			System.out.println(-1);
		}else{
			System.out.println(2);
		}
	}
}
0