結果

問題 No.293 4>7の世界
ユーザー ngtkanangtkana
提出日時 2020-03-22 01:04:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 194,372 KB
最終ジャッジ日時 2025-01-09 09:28:12
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::string s,t;std::cin>>s>>t;
    std::cout<<((s.length()!=t.length()
        ?s.length()<t.length()
        :std::lexicographical_compare(s.begin(),s.end(),t.begin(),t.end(),[](char c,char d){
            if(c=='4'&&d=='7')return false;
            if(c=='7'&&d=='4')return true;
            return c<d;
        }))?t:s)<<'\n';
}
0