結果
| 問題 | No.293 4>7の世界 | 
| コンテスト | |
| ユーザー |  hogeover30 | 
| 提出日時 | 2015-10-28 02:06:30 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 506 bytes | 
| コンパイル時間 | 755 ms | 
| コンパイル使用メモリ | 55,768 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-30 11:26:46 | 
| 合計ジャッジ時間 | 1,614 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main()
{
    string a, b; cin>>a>>b;
    if (a.size()>b.size()) {
        cout<<a<<endl;
    }
    else if (a.size()<b.size()) {
        cout<<b<<endl;
    }
    else {
        auto s=a, t=b;
        for(int i=0;i<a.size();++i) {
            if (a[i]=='4' and b[i]=='7')
                a[i]='7', b[i]='4';
            else if (a[i]=='7' and b[i]=='4')
                a[i]='4', b[i]='7';
        }
        cout<<(a>b ? s : t)<<endl;
    }
}
            
            
            
        