結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2020-09-28 01:00:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 737 bytes |
コンパイル時間 | 1,464 ms |
コンパイル使用メモリ | 168,184 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 16:58:17 |
合計ジャッジ時間 | 2,394 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; const ll MOD=1000000007; int main(void){ string s,t; cin>>s>>t; if(s.size()>t.size()){ cout<<s<<endl; }else if(s.size()<t.size()){ cout<<t<<endl; }else{ for(int i=0;i<s.size();i++){ int S=s[i]-'0',T=t[i]-'0'; if(S==4&&T==7){ cout<<s<<endl; return 0; }else if(S==7&&T==4){ cout<<t<<endl; return 0; }else if(S<T){ cout<<t<<endl; return 0; }else if(S>T){ cout<<s<<endl; return 0; } } } }