結果

問題 No.333 門松列を数え上げ
ユーザー おいがみおいがみ
提出日時 2016-01-15 23:46:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,570 bytes
コンパイル時間 1,868 ms
コンパイル使用メモリ 159,796 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 23:41:18
合計ジャッジ時間 1,757 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#ifndef MYDEBUG
#define err(...)
#define errs(...)
#endif

using namespace std;
void Calc();
#define ALL(a) begin(a),end(a)
#define RALL(a) (a).rbegin(),(a).rend()
typedef int64_t ll;
typedef uint64_t ull;
signed  main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  cin.exceptions(istream::failbit | istream::badbit);
  Calc();
  cout.flush();
  return 0;
}

struct Scanner {
  template<class A = string>static A Next() { A a; cin >> a; return a; }
  template<class A = int>static vector<A> Array(int n) { vector<A> a(n); for (A& i : a) cin >> i; return a; }
  static string Line() { string s; getline(cin, s); return s; }
  static int Int() { return Next<int>(); }
  template<class A>Scanner&operator,(A&a) { a = Next<A>(); return *this; }
  template<class A>operator A() { return Next<A>(); }
};
Scanner in;

/*---------------------------------------------------------------------*/
template<size_t n, class T>struct NestV {
  typedef vector<typename NestV<n - 1, T>::t> t;
  static t C(int*it, T init) { return t(*it, NestV<n - 1, T>::C(it + 1, init)); }
};
template<class T>struct NestV<0, T> { typedef T t; static T C(int*, T init) { return init; } };
template<size_t n, class T = int>typename NestV<n, T>::t DP(array<int, n>size, T init = 0) {
  return NestV<n, T>::C(&size[0], init);
}
/*---------------------------------------------------------------------*/

void Calc() {
  ll a, b;
  in, a, b;
  if (a < b) {
    cout << b - 2 << endl;
  } else {
    cout << 2000000000 - b - 1 << endl;
  }
}
0