結果

問題 No.333 門松列を数え上げ
ユーザー koyumeishi
提出日時 2016-01-15 22:34:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,251 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 88,884 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 19:09:49
合計ジャッジ時間 1,052 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0