結果

問題 No.333 門松列を数え上げ
ユーザー koyumeishikoyumeishi
提出日時 2016-01-15 22:34:53
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,251 bytes
コンパイル時間 744 ms
コンパイル使用メモリ 88,608 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 23:13:24
合計ジャッジ時間 1,261 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
using namespace std;
template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& val: vec) is >> val; return is;}
template<class T> istream& operator , (istream& is, T& val){ return is >> val;}
template<class T> ostream& operator << (ostream& os, vector<T>& vec){for(int i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"\n":" ");return os;}
template<class T> ostream& operator , (ostream& os, T& val){ return os << " " << val;}
template<class T> ostream& operator >> (ostream& os, T& val){ return os << " " << val;}
bool is_kadomatsu_sequence(vector<int> x){
    if(x.size() != 3) return false;
    if(x[0] < x[1] && x[1] > x[2] && x[2] != x[0]) return true;
    if(x[0] > x[1] && x[1] < x[2] && x[2] != x[0]) return true;
    return false;
}
int main(){
	int a,b;
	cin >> a,b;

	long long ans = 0;
	if(a<b){
		if(a==1 && b==2){
			ans = 0;
		}else{
			ans = b-2;
		}
	}else{
		if(b==2000000000-1){
			ans = 0;
		}else{
			ans = 2000000000 - b - 1;
		}
	}
	cout << ans << endl;

	return 0;
}
0