結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー hotpepsi
提出日時 2017-06-06 16:33:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 57,536 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 11:48:20
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[])
{
	int n, k, ans = 0;
	cin >> n >> k;
	if (k > 0 && k <= n) {
		ans = n - 2 + ((n - k + 1) == k);
	}
	cout << ans << endl;
	return 0;
}
0