結果
| 問題 |
No.1748 Parking Lot
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2021-11-19 21:24:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 340 bytes |
| コンパイル時間 | 880 ms |
| コンパイル使用メモリ | 73,416 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-31 20:48:13 |
| 合計ジャッジ時間 | 1,833 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 5 |
ソースコード
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
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;
}
square1001