結果
問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
ユーザー |
![]() |
提出日時 | 2020-05-02 15:46:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 1,919 ms |
コンパイル使用メモリ | 165,064 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 06:08:03 |
合計ジャッジ時間 | 3,025 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n, k; cin >> n >> k; if (k > n || k == 0) { puts("0"); return 0; } int b = n - (k - 1); if (b == k) cout << n - 1 << '\n'; else cout << n - 2 << '\n'; return 0; }