結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
nico_shindannin
|
| 提出日時 | 2015-10-23 22:40:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,618 bytes |
| コンパイル時間 | 894 ms |
| コンパイル使用メモリ | 89,908 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-23 01:29:07 |
| 合計ジャッジ時間 | 1,605 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 WA * 4 |
ソースコード
#include <stdio.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <bitset>
#include <stdio.h>
#include <string.h>
#include <assert.h>
using namespace std;
static const double EPS = 1e-9;
template<class T> bool INRANGE(T x,T a,T b){return a<=x&&x<=b;}
template<class T> void amin(T &a,T v){if(a>v) a=v;}
template<class T> void amax(T &a,T v){if(a<v) a=v;}
int ROUND(double x) { return (int)(x+0.5); }
bool ISINT(double x) { return fabs(ROUND(x)-x)<=EPS; }
bool ISEQUAL(double x,double y) { return fabs(x-y)<=EPS*max(1.0,max(fabs(x),fabs(y))); }
double SQSUM(double x,double y) { return x*x+y*y; }
#define PI (acos(-1))
#define ARRAY_NUM(a) (sizeof(a)/sizeof(a[0]))
#define NG (-1)
#define BIG ((int)1e9)
#define BIGLL ((ll)4e18)
#define SZ(a) ((int)(a).size())
#define SQ(a) ((a)*(a))
typedef long long ll;
typedef unsigned long long ull;
int main()
{
string a,b;
cin >> a >> b;
string ans(a);
if(SZ(a)>SZ(b))
{
ans = a;
}
else if (SZ(a)<SZ(b))
{
ans = b;
}
else
{
for (int i = 0; i < SZ(a); ++i)
{
if(a[i]==b[i]) continue;
if(a[i]=='4' && b[i]=='7')
{
ans = a;
break;
}
else if(a[i]=='7' && b[i]=='4')
{
ans = b;
break;
}
else if (a[i]>b[i])
{
ans = a;
}
else
{
ans = b;
}
}
}
cout << ans << endl;
return 0;
}
nico_shindannin