結果

問題 No.293 4>7の世界
ユーザー eSeF
提出日時 2020-11-06 11:05:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,201 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 115,548 KB
最終ジャッジ日時 2025-01-15 20:01:40
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<limits>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
int main(){
    cout << fixed << setprecision(10);
    string A,B;
    cin >> A >> B;
    int N=A.size(),M=B.size();
    if(N!=M){
        if(N>M)cout << A << endl;
        else cout << B << endl;
    }
    else{
        for(int i=0;i<N;i++){
            if(A[i]==B[i])continue;
            if((A[i]=='4'&&B[i]=='7')){
                cout << A << endl;
            }
            else if(A[i]=='7'&&B[i]=='4'){
                cout << B << endl;
            }
            else if(A[i]>B[i]){
                cout << A << endl;
            }
            else{
                cout << B << endl;
            }
            break;
        }
    }
    return 0;
}
0