結果
| 問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2024-09-30 01:51:25 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 329µs | |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 969 ms |
| コンパイル使用メモリ | 163,416 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-06 10:23:03 |
| 合計ジャッジ時間 | 2,725 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n,k;
cin>>n>>k;
if(k==0||k>n) {
cout<<0<<endl;
return 0;
}
ll ans = 0;
if(k==n-k+1){
ans = n - 1;
}else{
ans = n - 2;
}
ans = max(ans,0ll);
cout<<ans<<endl;
}
momoyuu