結果
問題 | No.1748 Parking Lot |
ユーザー |
|
提出日時 | 2021-11-19 23:10:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 1,195 ms |
コンパイル使用メモリ | 160,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-01 21:48:12 |
合計ジャッジ時間 | 2,044 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h>#define rep(i, l, r) for (int i = (l); i < (r); i++)using namespace std;typedef long long ll;int main() {int K, N, ans;cin >> N >> K;if (N == 1) {ans = 1;} else if (N == 2) {ans = 3 - K;} else {if (K == N - 1) ans = N;else ans = N - 1;}cout << ans << endl;}