結果
問題 | No.333 門松列を数え上げ |
ユーザー |
![]() |
提出日時 | 2016-01-15 23:46:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,570 bytes |
コンパイル時間 | 1,156 ms |
コンパイル使用メモリ | 159,424 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 19:34:39 |
合計ジャッジ時間 | 1,616 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
ソースコード
#include "bits/stdc++.h"#ifndef MYDEBUG#define err(...)#define errs(...)#endifusing 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;}}