結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2016-01-02 22:04:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 992 bytes |
コンパイル時間 | 866 ms |
コンパイル使用メモリ | 72,108 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 11:46:16 |
合計ジャッジ時間 | 1,969 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <map> #include <set> #include <cstdio> #include <cmath> #define rep(i,l,n) for(lint i=l;i<n;i++) #define rer(i,l,n) for(lint i=l;i<=n;i++) #define all(a) a.begin(),a.end() #define o(a) cout<<a<<endl #define pb(a) push_back(a) #define mk(a,b) make_pair(a,b) #define fi first #define se second using namespace std; typedef long long lint; typedef vector<int> vi; typedef vector<lint> vli; typedef vector<vi> vvi; typedef pair<int,int> pii; int main(){ string a[2]; cin>>a[0]>>a[1]; if(a[0].size()>a[1].size()) o(a[0]); else if(a[0].size()<a[1].size()) o(a[1]); else{ int ans=0; rep(i,0,a[0].size()){ if(a[0][i]==a[1][i]) continue; else if(a[0][i]=='4' && a[1][i]=='7'){ ans=0; break; }else if(a[0][i]=='7' && a[1][i]=='4'){ ans=1; break; }else if(a[0][i]>a[1][i]){ ans=0; break; }else{ ans=1; break; } } if(ans) o(a[1]); else o(a[0]); } }