結果
問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
ユーザー |
![]() |
提出日時 | 2017-08-25 23:32:30 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 2,288 ms |
コンパイル使用メモリ | 78,448 KB |
実行使用メモリ | 41,336 KB |
最終ジャッジ日時 | 2024-10-15 16:13:19 |
合計ジャッジ時間 | 6,808 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
import java.util.Scanner;import java.util.stream.IntStream;public class Main{static IntStream REPS(int v){return IntStream.range(0,v);}static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}static IntStream INS(int n) {return REPS(n).map(i->getInt());}static Scanner s=new Scanner(System.in);static int getInt(){return Integer.parseInt(s.next());}public static void main(String[]$){int n=getInt(),d=getInt();System.out.println(d==0||d>n?0:n%2==1&&n/2+1==d?n-1:n-2);}}