結果

問題 No.333 門松列を数え上げ
ユーザー masamasa
提出日時 2016-01-15 22:36:59
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 53,940 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 19:10:27
合計ジャッジ時間 807 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>

using namespace std;

const int longest = 2000000000;

int main() {
	int a, b, ans;

	cin >> a >> b;
	if (a == b) {
		ans = 0;
	} else if (a > b) {
		ans = longest - b - 1;
	} else {
		ans = b - 1 - 1;
	}
	cout << ans << endl;
	return 0;
}
0