結果

問題 No.333 門松列を数え上げ
ユーザー ゆるくゆるく
提出日時 2019-04-30 23:31:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 993 ms
コンパイル使用メモリ 78,248 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-30 04:10:55
合計ジャッジ時間 1,899 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<stdio.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e9

int main()
{
	int a, b, ans = 0;
	cin >> a >> b;
	if (a < b) {
		ans += b - a - 1;
		ans += a - 1;
	} else {
		ans += 2000000000 - a;
		ans += a - b - 1;
	}
	cout << ans << endl;
	return 0;
}
0