結果
問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
ユーザー |
![]() |
提出日時 | 2017-06-02 23:05:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 409 bytes |
コンパイル時間 | 1,011 ms |
コンパイル使用メモリ | 63,744 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-22 02:50:32 |
合計ジャッジ時間 | 8,816 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 RE * 5 TLE * 1 -- * 17 |
ソースコード
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; int main() { long long int n,k; long long int cnt=0; cin>>n>>k; long long int A[n]; for(int i=0;i<n;i++) { A[i] = 0; A[k] = 1; A[n-k+1] = 1; if(A[i] == 0) cnt = cnt + 1; } if((n==1 && k==1) || (n==2 && k==2)) cout<<0<<endl; else if(n-k < 0 || k == 0) cout<<0<<endl; else cout<<cnt<<endl; return 0; }