結果

問題 No.544 Delete 7
ユーザー k
提出日時 2020-07-14 22:01:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 1,000 ms
コード長 720 bytes
コンパイル時間 2,022 ms
コンパイル使用メモリ 196,888 KB
最終ジャッジ日時 2025-01-11 20:38:51
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++)
#define ALL(x) (x).begin(), (x).end()

const double PI = acos(-1);

int conv(vector<int> x) {
  int ret = 0;
  for (int a: x)
    ret = 10 * ret + a;
  return ret;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  string s;
  cin >> s;

  int t = stoi(s);
  vector<int> x;
  while (t) {
    x.push_back(t % 10);
    t /= 10;
  }

  reverse(ALL(x));
  vector<int> y;

  REP (i, x.size()) {
    if (x[i] == 7) {
      x[i] = 6;
      y.push_back(1);
    } else {
      y.push_back(0);
    }
  }

  cout << conv(x) << " " << conv(y) << endl;
  return 0;
}
0