結果
問題 |
No.293 4>7の世界
|
ユーザー |
![]() |
提出日時 | 2018-08-03 14:51:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 459 bytes |
コンパイル時間 | 2,015 ms |
コンパイル使用メモリ | 166,408 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 12:40:46 |
合計ジャッジ時間 | 2,972 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ string a,b; cin>>a>>b; if(a.size()!=b.size()) return cout<<(a.size()>b.size()?a:b)<<endl,0; Int n=a.size(); 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<<b<<endl; else cout<<a<<endl; return 0; } return 0; }