結果
| 問題 | No.293 4>7の世界 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-12-19 04:37:01 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 636 bytes | 
| コンパイル時間 | 2,338 ms | 
| コンパイル使用メモリ | 159,344 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-30 11:43:58 | 
| 合計ジャッジ時間 | 3,279 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
#define in(T,V) T V;cin>>V;
const int MOD = int(1e9+7);
int main(){
    in(string,A);
    in(string,B);
    string res = [&]()->string{
        if(A.length() > B.length()) return A;
        if(A.length() < B.length()) return B;
        int n = A.length();
        REP(i,n){
            if(A[i] == '4' && B[i] == '7') return A;
            if(A[i] == '7' && B[i] == '4') return B;
            if(A[i] != B[i]) return A[i]<B[i]?B:A;
        }
        return "";
    }();
    cout << res << endl;
}
            
            
            
        