結果

問題 No.544 Delete 7
ユーザー 0x19f
提出日時 2017-07-15 17:21:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 57,684 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 02:29:53
合計ジャッジ時間 8,559 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 3 WA * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;

string S;

int main(void) {
  cin >> S;
  reverse(S.begin(), S.end());
  int A = 0, N = 0;
  REP(i, 0, S.size()) {
    N = N * 10 + (S[i] - '0');
    if(S[i] != '7') A = A * 10 + (S[i] - '0');
    else A = A * 10 + 6;
  }
  cout << A << " " << (N - A) << endl;
}
0