結果

問題 No.1748 Parking Lot
ユーザー square1001
提出日時 2021-11-19 21:24:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 974 ms
コンパイル使用メモリ 73,156 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-31 20:51:09
合計ジャッジ時間 1,500 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N, K;
	cin >> N >> K;
	if (N == 1) {
		cout << 1 << endl;
	}
	else if (N == 2) {
		cout << (K == 1 ? 2 : 1) << endl;
	}
	else {
		if (2 * K - 1 <= N) {
			cout << N - 1 << endl;
		}
		else {
			cout << (K != N ? N : N - 1) << endl;
		}
	}
	return 0;
}
0