結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー zaichuzaichu
提出日時 2017-06-17 01:02:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 692 ms
コンパイル使用メモリ 76,264 KB
実行使用メモリ 814,580 KB
最終ジャッジ日時 2024-04-08 14:02:40
合計ジャッジ時間 2,485 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 RE -
testcase_04 AC 2 ms
6,548 KB
testcase_05 RE -
testcase_06 MLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int n,k;
  cin >> n >> k;
  vector<int> ans(n,1);
  ans[k-1] = 0;
  ans[n-1-k] = 0;
  for(int i = 0; i < n - 1; i++){
    ans[i+1] += ans[i];
  }
  cout << ans[n-1] << endl;
}
0