結果

問題 No.544 Delete 7
ユーザー heterochan
提出日時 2020-09-07 01:24:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 453 bytes
コンパイル時間 1,323 ms
コンパイル使用メモリ 166,820 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-29 07:58:24
合計ジャッジ時間 2,847 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;

int main(void){
    string s;
    cin >> s;

    ll a = 0;
    ll n = 0;
    for(int i = 0; i < s.length(); i++){
        n *= 10;
        n += (s[i] - '0');

        a *= 10;
        if(s[i] == '7'){
            a += 1;
        }
        else{
            a += (s[i] - '0');
        }
    }
    ll b = n - a;
    cout << a << " " << b << endl;
    return 0;
}
0