結果

問題 No.1860 Magnets
ユーザー 👑 CleyL
提出日時 2023-03-25 22:42:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 746 ms
コンパイル使用メモリ 65,736 KB
最終ジャッジ日時 2025-02-11 18:06:17
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int a,b;cin>>a>>b;
    if(a>b)swap(a,b);
    if(a==b){
        cout << a*2+1 << endl;
    }else if(a == 0){
        cout << b*2 << endl;
    }else{
        cout << a*2+1+(b-a-1)*2 << endl;
    }
}
0