結果
問題 | No.333 門松列を数え上げ |
ユーザー |
![]() |
提出日時 | 2016-01-16 00:08:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 831 bytes |
コンパイル時間 | 623 ms |
コンパイル使用メモリ | 83,520 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 19:39:48 |
合計ジャッジ時間 | 1,078 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
ソースコード
#include <iostream>#include <iomanip>#include <vector>#include <list>#include <deque>#include <queue>#include <stack>#include <set>#include <map>#include <algorithm>#include <cmath>#include <cstring>#include <limits>using namespace std;#define REP(x,y) for(int x = 0;x < (y);x++)#define LLI long long int#define FORR(x,arr) for(auto& x:arr)#define ALL(a) (a.begin()),(a.end())#define _L(x) cout<<(x)<<endlint main(){LLI A, B;cin >> A >> B;LLI sum = 0;if(A > B){LLI value =(A - B - 1L);sum += value > 0 ? value : 0;sum += 2000000000 - A;cout << sum << endl;return 0;}else{LLI value =(B - A - 1L);sum += value > 0 ? value : 0;sum += A - 1;cout << sum << endl;return 0;}}