結果

問題 No.544 Delete 7
ユーザー tetsuzuki1115
提出日時 2017-11-08 22:41:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 689 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 79,696 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-21 16:39:26
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
    
    string N,A,B;
    cin >> N;
    
    for ( int i = 0; i < N.length(); i++ ) {
        if ( N[i] == '7' ) { A += '6'; B+= '1'; }
        else { A+= N[i]; B += '0'; }
    }
    
    while ( true ) {
        if ( B.length() == 1 ) { break; }
        if ( B[0] == '0' ) { B.erase( 0, 1 ); }
        else { break; }
    }
    
    cout << A << " " << B << endl;
    
    return 0;
}
0