結果

問題 No.333 門松列を数え上げ
ユーザー penta2himajin
提出日時 2018-11-16 22:34:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 705 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 14:17:12
合計ジャッジ時間 1,144 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<numeric>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<ctype.h>
#include <fstream>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
int dy[4]={0,1,0,-1};
//----------program from here----------

int main(){
  int A=0,B=0;
  cin >> A >> B;
  if(A<B){
    cout << (A-1)+(B-A-1) << endl;
  }else{
    cout << (A-B-1)+(2000000000-A) << endl;
  }
}
0