結果

問題 No.2224 UFO Game
ユーザー AngrySadEight
提出日時 2022-12-11 01:11:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 67,072 KB
最終ジャッジ日時 2025-02-09 09:24:26
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cassert>
using namespace std;
typedef long long ll;

int main(){
    string S;
    cin >> S;
    ll ans;
    if (S[0] == 'x'){
        int len = S.size();
        string T = S.substr(1, len - 1);
        ans = (1LL << 32) - stoll(T);
    }
    else{
        ans = stoll(S);
    }
    assert(ans >= 0 && ans < (1LL << 32));
    assert(ans % 10 == 0);
    cout << ans << endl;
}
0