結果

問題 No.544 Delete 7
ユーザー masastat
提出日時 2017-07-14 23:39:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 616 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 68,004 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-07 23:48:29
合計ジャッジ時間 6,180 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 13 WA * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#define MP make_pair
using ll = long long;
using namespace std;

int main()
{
  string n;
  cin >> n;
  vector<int>S;
  for(int i=0; i < n.size(); i++){
    //cout << n[i] << endl;
    if(n[i] == '7')
      S.push_back(i);
  }
  string a,b;
  a = n;
  b = n;
  int j=0;
  for(int i=0; i < S.size(); i++)
    a[S[i]] = '6';
  for(int i=0; i < b.size(); i++){
    if(i == S[j])
      b[S[j]] = '1';
    else
      b[i] = '0';
  }
  cout << atoi(a.c_str()) << " " << atoi(b.c_str()) << endl;
  return 0;
}
0